Ad Widget

Collapse

zabbix_agent doesn't load config by default on CLI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arioch
    Junior Member
    • Dec 2009
    • 19

    #1

    zabbix_agent doesn't load config by default on CLI

    Hi,

    I'm wondering why zabbix_agent doesn't load it's config file by default.

    Default behaviour:
    Code:
    # zabbix_agent -t mysql.version
    system.test [m|ZBX_NOTSUPPORTED]
    When I run it with the config specified:
    Code:
    # zabbix_agent -c /etc/zabbix/zabbix_agentd.conf -t mysql.version
    mysql.version                                 [t|mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1]
    I've fixed it temporarily with an alias (alias zabbix_agent='zabbix_agent -c /etc/zabbix/zabbix_agentd.conf').
    But I'd like to know why it doesn't load the config by default. Anybode got a clue?
  • Firm
    Senior Member
    • Dec 2009
    • 342

    #2
    $ strings /usr/local/sbin/zabbix_agent|grep zabbix_agent.conf
    /etc/zabbix/zabbix_agent.conf
    $

    So my version reads /etc/zabbix/zabbix_agent.conf by default. Check what config file is being used by default in your case.

    Comment

    • Arioch
      Junior Member
      • Dec 2009
      • 19

      #3
      I see...

      It results in the same behaviour again. When I disable the alias I get this error:
      Code:
      # zabbix_agent -t mysql.version
      -bash: mysql.version: command not found
      With the zabbix_agent.conf specified it works.

      It -should- load zabbix_agent.conf according to strings, but it doesn't.

      Comment

      • Firm
        Senior Member
        • Dec 2009
        • 342

        #4
        Do you see the difference between /etc/zabbix/zabbix_agent.conf and /etc/zabbix/zabbix_agentd.conf?

        Comment

        • Arioch
          Junior Member
          • Dec 2009
          • 19

          #5
          Originally posted by Firm
          Do you see the difference between /etc/zabbix/zabbix_agent.conf and /etc/zabbix/zabbix_agentd.conf?
          Yes I do, what kind of idiot do you take me for?

          I'm just saying it doesn't load any of those two by default on my system. I've fixed it using an alias, but it's a dirty way.
          Server loads it's config by default, so why shouldn't the Agent do so too?
          Last edited by Arioch; 14-01-2010, 10:37.

          Comment

          • Firm
            Senior Member
            • Dec 2009
            • 342

            #6
            Try the following:
            - move /etc/zabbix/zabbix_agent.conf to /etc/zabbix/zabbix_agent.conf.old and run something like 'zabbix_agent -t system.uptime'. If it does really read /etc/zabbix/zabbix_agent.conf file then it should reply with 'zabbix_agent [2716]: Cannot open config file [/etc/zabbix/zabbix_agent.conf] [No such file or directory].'

            If you get it then move your config file back. Start zabbix_agent again as 'zabbix_agent -t mysql.version'. (you should get an error as you had in 1st post, right?)

            Now, strace/truss to monitor the execution of zabbix_agent: 'strace zabbix_agent -t mysql.version'. Check for lines like:
            open("/etc/zabbix/zabbix_agent.conf", O_RDONLY) = 3
            fstat64(3, {st_mode=S_IFREG|0644, st_size=5086, ...}) = 0
            mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fb7000
            read(3, "# This is a config file for Zabb"..., 4096) = 4096

            Comment

            Working...