Ad Widget

Collapse

zabbix_sender error code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ngarnier
    Junior Member
    • Mar 2008
    • 21

    #1

    zabbix_sender error code

    Hi,

    When I send a value with zabbix_sender, I get a "0" error code (echo $?) when "failed" is 0 or 1, no difference.

    How can I get the error code when I use zabbix_sender in a shell script with a for loop and 800 host ?

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

    #2
    Originally posted by ngarnier
    When I send a value with zabbix_sender, I get a "0" error code (echo $?) when "failed" is 0 or 1, no difference.

    How can I get the error code when I use zabbix_sender in a shell script with a for loop and 800 host ?
    It seems you are using zabbix_sender in a highly inefficient way. The binary supports sending of multiple values from a file. In this case, only one execution of the sender is required.

    I think that currently the sender always returns '0'.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • ngarnier
      Junior Member
      • Mar 2008
      • 21

      #3
      It's not the problem, if I have 800 hosts in a file, how can I know if I have an error if zabbix_sender always ends with value 0 ?

      Mostly in a shell script ?

      Example :
      [root@diane ~]# /opt/zabbix/sbin/zabbix_sender -i outage_snd.txt
      sent: 488; failed: 7; total: 495
      [root@diane ~]# echo $?
      0

      How can I know which "sent" has failed ?

      No way to know if it's OK or not ?
      Last edited by ngarnier; 02-12-2008, 17:34.

      Comment

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

        #4
        I understand. Well, the only way is to parse output of the sender, which is quite simple task.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        Working...