updated zabbix state

This commit is contained in:
Paul 2023-02-10 13:53:05 +01:00
parent 7b0eaf0361
commit f2b91422c7
2 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,8 @@ zabbix:
LogFile: /var/log/zabbix/zabbix_server.log
LogType: file
PidFile: /run/zabbix/zabbix_server.pid
StartDBSyncers: 1
CacheSize: 33554432
agent:
enable: true
user: zabbix

View File

@ -0,0 +1,22 @@
#!/usr/bin/env python3
import socket
import json
HOST = "127.0.0.1"
PORT = 8060
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b"1")
data = bytes()
while True:
recv = s.recv(512)
if len(recv) > 0:
data += recv
else:
break
out = data.decode()
jsout = json.loads(out)
print(len(jsout.keys()))