Indicate if a prometheus export was done logged in or not
This commit is contained in:
@@ -2,6 +2,7 @@ from . import Mu5001Tool
|
|||||||
from http.server import BaseHTTPRequestHandler, HTTPServer, HTTPStatus
|
from http.server import BaseHTTPRequestHandler, HTTPServer, HTTPStatus
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
import socket
|
import socket
|
||||||
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
class HTTPServerV6(HTTPServer):
|
class HTTPServerV6(HTTPServer):
|
||||||
@@ -118,11 +119,14 @@ def make_prometheus_exporter_request_handler(m):
|
|||||||
"cmd": ",".join(cmds_as_metric_value + cmds_as_metric_label),
|
"cmd": ",".join(cmds_as_metric_value + cmds_as_metric_label),
|
||||||
})
|
})
|
||||||
|
|
||||||
if data.get("loginfo") != "ok":
|
|
||||||
m.login_if_possible()
|
|
||||||
|
|
||||||
out = []
|
out = []
|
||||||
|
|
||||||
|
if data.get("loginfo") == "ok":
|
||||||
|
out.append("mu5001tool_logged_in 1")
|
||||||
|
else:
|
||||||
|
out.append("mu5001tool_logged_in 0")
|
||||||
|
m.login_if_possible()
|
||||||
|
|
||||||
for cmd in cmds_as_metric_value:
|
for cmd in cmds_as_metric_value:
|
||||||
d = data.get(cmd)
|
d = data.get(cmd)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user