updated zabbix state
This commit is contained in:
parent
7b0eaf0361
commit
f2b91422c7
@ -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
|
||||
|
22
states/zabbix/scripts/ipblc.py
Normal file
22
states/zabbix/scripts/ipblc.py
Normal 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()))
|
Loading…
Reference in New Issue
Block a user