Zabbix: debug external script

scriptingzabbix

I have made an external script (snmp_max_io written in Perl). When run with and IP-address, it logs input to syslog and it prints a single 64-bit numeric value and set the exit value to 0.

Example output:

916418801

I have added it in /usr/lib/zabbix/externalscripts where I have a different script, that works.

I have configured an item:

  • Type: External check
  • Key: snmp_max_io["{HOST.CONN}"]
  • Host interface: i.p.n.r 10050
  • Type of information: Numeric
  • Data type: decimal
  • Units: b

After a while Zabbix changes the status to: 'Not supported' and "Received value [] is not numeric".

The command works fine when run on the command line as root or as zabbix.

But the command is never run by the zabbix server (nothing is logged).

How do I find out why Zabbix thinks the command returns [] while it clearly never runs it?

The solution is in the comments: The script MUST be a bash script. So a perl-script must have a bash wrapper.

Best Answer

Do you have SELinux enabled in your server? I've bitten by it several times in the similar situations while using Zabbix.

If getenforce returns enabled for you, then it's time to see /var/log/audit directory logs and see what particularly prevents Zabbix running the script.