-
Incident report
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
CentOS v5
From version 1.6 of Zabbix, zabbix_sender has changed, and it doesn't read config file from the command line anymore. I've strace-ed zabbix_sender, and there is no open call for anything I put after -c parameter... Here are the examples:
- /usr/sbin/zabbix_sender -z myserver.mydomain.com -c /etc/zabbix/zabbix_agentd.conf -k mysql.bytesreceived -o 45940
Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.004097"
sent: 1; skipped: 0; total: 1
- /usr/sbin/zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k mysql.bytesreceived -o 45940
usage: zabbix_sender [-Vhv] {[-zpsI] -ko | [-zpI] -i <file>}[-c <file>]
- strace /usr/sbin/zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k mysql.bytesreceived -o 45940 2>&1 | grep open | grep etc
open("/etc/ld.so.cache", O_RDONLY) = 3
Problem is that function that parses options from command line has wrong check... It only checks if ZABBIX_SERVER is on the command line ('-z' argument), and if it's not, it exits with error. That is not the correct behaviour because ZABBIX_SERVER can be stated in the config file too. Here is the patch....
— src/zabbix_sender/zabbix_sender.c 2008-12-19 16:59:18.428357863 +0100
+++ src/zabbix_sender/zabbix_sender.c 2008-12-19 17:07:56.309106954 +0100
@@ -360,7 +360,7 @@
break;
}
- if(ZABBIX_SERVER == NULL)
+ if((ZABBIX_SERVER == NULL) && (CONFIG_FILE == NULL))
{
usage();
exit(FAIL);