Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-677

zabbix_sender doesn't read config file parameters

    XMLWordPrintable

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Agent (G)
    • Labels:
      None
    • Environment:
      CentOS v5

      Description

      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:

      1. /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
      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>]

      1. 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);

        Attachments

          Activity

            People

            Assignee:
            sasha Alexander Vladishev
            Reporter:
            jsosic Jakov Sosic
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: