Skip to content

Commit

Permalink
misc: improve sender configuration
Browse files Browse the repository at this point in the history
Signed-off-by: djerfy <[email protected]>
  • Loading branch information
djerfy committed Jan 11, 2024
1 parent d959832 commit f8f9881
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/zabbix-kubernetes-discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@
logging.debug(f"-> Cluster name: {config['kubernetes']['name']}")

def executeSender(data):
try:
for d in data:
if len(d) != 3:
logging.error(f"Invalid zabbix format: {d}")
host, key, value = d[0], d[1], d[2]
logging.info(f"host={host} key={key} value={value}")
zabbix.send_value(host, key, value)
except Exception as e:
logging.error(e)
for d in data:
if len(d) != 3:
logging.error(f"Invalid format: {d}")
host, key, value = d[0], d[1], d[2]
logging.info(f"Zabbix server request: host={host} key={key} value={value}")
try:
resp = zabbix.send_value(host, key, value)
logging.info(f"Zabbix server response: {resp}")
except Exception as e:
logging.error(e)

def executeJobs():
while True:
Expand Down

0 comments on commit f8f9881

Please sign in to comment.