Ad Widget

Collapse

Zabbix-agent returning wrong value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dreas
    Member
    • Aug 2007
    • 89

    #1

    Zabbix-agent returning wrong value

    We ran into a very weird bug. Using Zabbix Agent v1.4.6 and Zabbix server 1.8.2.

    The agent is returning the correct response (0):
    Code:
    host:~$ zabbix_agent -c /etc/zabbix/zabbix_agentd.conf -t mysql.replication.status
    mysql.replication.status                      [t|0]
    host:~$
    The agent log however shows:
    Code:
    mysql.replication.status:120:0
      2603:20100701:121955 Parsed [mysql.replication.status:120:0]
      2603:20100701:121955 In add_check('mysql.replication.status', 120, 0)
      2603:20100701:121955 Run remote command [/home/user/zabbix/mysql.replication.status] Result [1] [1]...
      2603:20100701:121955 For key [mysql.replication.status] received value [1]
    The server indeed received value 1, whilst it should definitely be 0. We have had this problem on different machines. Any ideas how it can be resolved? We cannot trust our monitoring if the agent results are wrongly sent of course.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Are your sure your script does not depend on some environment variables, a special shell, user, whatever? Show us the command.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • dreas
      Member
      • Aug 2007
      • 89

      #3
      Code:
      #!/bin/bash
      SQLresponse=`mysql -e "show slave status \G" | grep -i "Slave_SQL_Running"| gawk '{print $2}'`
      IOresponse=`mysql  -e "show slave status \G" | grep -i "Slave_IO_Running"| gawk '{print $2}'`
      
      if [ "$SQLresponse" = "No" ]; then
            echo "0"
            exit
      fi
      
      if [ "$IOresponse" = "No" ]; then
            echo "0"
            exit 
      fi
      
      echo "1"
      exit
      So manually running the script was indeed responding 0.

      Comment

      • dreas
        Member
        • Aug 2007
        • 89

        #4
        Okay, so the user "zabbix" indeed has no MySQL permission (we should pass the password), which is why this is failing :S Apologies! Completely a mistake on our end.

        Comment

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

          #5
          I knew it!
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          Working...