Ad Widget

Collapse

UserParameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cptnzod
    Member
    • Jan 2007
    • 56

    #1

    UserParameter

    I got everything figured out on zabbix and need this last bit to go to production.

    I have this in my zabbix_agentd.conf:
    UserParameter=dhcpd.test,/usr/local/bin/check_dhcp.sh

    [root@oolong init.d]# zabbix_agentd -t dhcpd.test
    dhcpd.test [m|ZBX_NOTSUPPORTED]

    [root@oolong init.d]# zabbix_get -s localhost -k dhcpd.test
    ZBX_NOTSUPPORTED

    The actual script exits with status zero:
    [root@oolong init.d]# /usr/local/bin/check_dhcp.sh
    [root@oolong init.d]# echo $?
    0

    I guess the question is how to fix this?
  • cptnzod
    Member
    • Jan 2007
    • 56

    #2
    Just figured this one out.
    The script should actually echo a result out. I was just depending on the exit status which will not work.

    Comment

    • dsipe
      Senior Member
      • Oct 2006
      • 184

      #3
      it's simple.
      Zabbix dont care about shell return code. It just wait for a value on stdout.
      So just use a "print 0" or "echo 0" inside your shell script to correct the problem.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Originally posted by dsipe
        Zabbix dont care about shell return code.
        This is true for 1.1.2 (or 1.1.3) and later releases. ZABBIX did check return codes in earlier versions.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        Working...