I want to use ICMPPING in zabbix as a simple check. I know it uses fping. But I want to override the fping program to do my desired work. fping utility can give me the result of an ICMP request from the system that runs it. I mean it investigates the availability of an IP address from just one server. But I want to use an API which is performed by the use of CURL that returns the results of availability of an IP address from multiple servers. I wrote the program with python and it is working well. But I don't know how to send the result to zabbix! By now it simply produce 1 if the IP is online and 0 if it is offline. I think I should submit the result in a JSON like format, but I do not know the right syntax!! I formerly wrote a script for discovering LVM partitions and submit the result with the following JSON synax:
{"data":[{"{#MDNAME}":"md1"},{"{#MDNAME}":"md127"},{"{#MDNAME}":"md2"}]}
But I don't know the correct json syntax for the icmpping!
Any help is appreciated
zabbix: fping failed: simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
587 views Asked by Sinai At
1
It does not use JSON, Zabbix just parses the fping output - you would have to emulate that.
For example, fping output with the default settings and 3 packets sent looks like this: