Ad Widget

Collapse

user parameter checks not working when polled by the server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pdwalker
    Senior Member
    • Dec 2005
    • 166

    #1

    user parameter checks not working when polled by the server

    I've recently upgraded from 1.1b4 to 1.1. The upgrade went without problem.

    Everything works except for UserParameters (which used to work in 1.1b4).

    === zabbix_agentd.conf ===
    UserParameter=mysql.ping,mysqladmin -u<user> -p<pass> -h<host> ping|grep alive|wc -l|tr -d [:cntrl:]
    UserParameter=mysql.uptime,mysqladmin -u<user> -p<pass> -h<host> status|cut -f2 -d" "|tr -d [:cntrl:]
    UserParameter=mysql.threads,mysqladmin -u<user> -p<pass> -h<host> status|cut -f5 -d" "|tr -d [:cntrl:]
    UserParameter=mysql.questions,mysqladmin -u<user> -p<pass> -h<host> status|cut -f8 -d" "|tr -d [:cntrl:]
    UserParameter=mysql.slowqueries,mysqladmin -u<user> -p<pass> -h<host> status|cut -f12 -d" "|tr -d [:cntrl:]
    UserParameter=mysql.qps,mysqladmin-u<user> -p<pass> -h<host>status|cut -f29 -d" "|tr -d [:cntrl:]
    UserParameter=mysql.version,mysql -V|tr -d [:cntrl:]
    === zabbix_agentd.conf ===
    (tr -d [:cntrl:] removes line feeds (0x0A) from the stream)


    running zabbix/bin/zabbix_agentd -p returns the following data:

    mysql.ping [t|1]
    mysql.uptime [t|1147268]
    mysql.threads [t|19]
    mysql.questions [t|1213036282]
    mysql.slowqueries [t|691]
    mysql.qps [t|1057.326]
    mysql.version [t|mysql Ver 14.7 Distrib 4.1.15, for pc-linux-gnu (i686) using EditLine wrapper]


    running zabbix/bin/zabbix_get -s localhost -k <each parameter> | bmore (bmore is a binary file viewer) returns the following:

    00000000 30 0A 0. (a zero and a newline)
    00000000 0A . (a newline only)
    00000000 0A . (a newline only)
    00000000 0A . (a newline only)
    00000000 0A . (a newline only)
    00000000 0A . (a newline only)
    00000000 0A . (a newline only)


    With the debugging turned on for zabbix_agentd, the following is generated

    === zabbix_agentd debug log, results from zabbix_agentd -p ===
    010320:20060608:135206 Run remote command [mysqladmin -u<user> -p<pass> -h<host> ping|grep alive|wc -l|tr -d [:cntrl:]] Result [1] [1]
    010320:20060608:135206 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f2 -d" "|tr -d [:cntrl:]] Result [7] [1147268]
    010320:20060608:135206 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f5 -d" "|tr -d [:cntrl:]] Result [2] [19]
    010320:20060608:135206 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f8 -d" "|tr -d [:cntrl:]] Result [10] [1213036282]
    010320:20060608:135206 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f12 -d" "|tr -d [:cntrl:]] Result [3] [691]
    010320:20060608:135206 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f29 -d" "|tr -d [:cntrl:]] Result [8] [1057.326]
    010320:20060608:135206 Run remote command [mysql -V|tr -d [:cntrl:]] Result [79] [mysql Ver 14.7 Distrib 4.1.15, for pc-linux-gnu (i686) using EditLine wrapper]
    === zabbix_agentd debug log, results from zabbix_agentd -p ===

    === zabbix_agentd debug log, results from zabbix_get -s localhost -k <user key> ===

    010152:20060608:135540 In check_security()
    010152:20060608:135540 Connection from [127.0.0.1]. Allowed servers [202.83.245.166,localhost]
    010152:20060608:135540 Before read()
    010152:20060608:135540 After read() 2 [11]
    010152:20060608:135540 Got line:mysql.ping
    010152:20060608:135540 Run remote command [mysqladmin -u<user> -p<pass> -h<host> ping|grep alive|wc -l|tr -d [:cntrl:]] Result [1] [0]
    010152:20060608:135540 Sending back:0
    010154:20060608:135600 In check_security()
    010154:20060608:135600 Connection from [127.0.0.1]. Allowed servers [202.83.245.166,localhost]
    010154:20060608:135600 Before read()
    010154:20060608:135600 After read() 2 [13]
    010154:20060608:135600 Got line:mysql.uptime
    010154:20060608:135600 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f2 -d" "|tr -d [:cntrl:]] Result [0] []
    010154:20060608:135600 Sending back:
    010157:20060608:135627 Sleeping for 60 seconds
    010155:20060608:135634 In check_security()
    010155:20060608:135634 Connection from [127.0.0.1]. Allowed servers [202.83.245.166,localhost]
    010155:20060608:135634 Before read()
    010155:20060608:135634 After read() 2 [14]
    010155:20060608:135634 Got line:mysql.threads
    010155:20060608:135634 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f5 -d" "|tr -d [:cntrl:]] Result [0] []
    010155:20060608:135634 Sending back:
    010156:20060608:135644 In check_security()
    010156:20060608:135644 Connection from [127.0.0.1]. Allowed servers [202.83.245.166,localhost]
    010156:20060608:135644 Before read()
    010156:20060608:135644 After read() 2 [16]
    010156:20060608:135644 Got line:mysql.questions
    010156:20060608:135644 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f8 -d" "|tr -d [:cntrl:]] Result [0] []
    010156:20060608:135644 Sending back:
    010152:20060608:135651 In check_security()
    010152:20060608:135651 Connection from [127.0.0.1]. Allowed servers [202.83.245.166,localhost]
    010152:20060608:135651 Before read()
    010152:20060608:135651 After read() 2 [18]
    010152:20060608:135651 Got line:mysql.slowqueries
    010152:20060608:135651 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f12 -d" "|tr -d [:cntrl:]] Result [0] []
    010152:20060608:135651 Sending back:
    010157:20060608:135727 In refresh_metrics()
    010157:20060608:135727 get_active_checks: host[202.83.245.166] port[10051]
    010157:20060608:135727 Sending [ZBX_GET_ACTIVE_CHECKS
    adb01
    ]
    010157:20060608:135727 Before read
    010157:20060608:135727 In delete_all_metrics()
    010157:20060608:135727 Parsed [ZBX_EOF]
    010157:20060608:135727 Sleeping for 60 seconds
    010154:20060608:135810 In check_security()
    010154:20060608:135810 Connection from [127.0.0.1]. Allowed servers [202.83.245.166,localhost]
    010154:20060608:135810 Before read()
    010154:20060608:135810 After read() 2 [10]
    010154:20060608:135810 Got line:mysql.qps
    010154:20060608:135810 Run remote command [mysqladmin -u<user> -p<pass> -h<host> status|cut -f29 -d" "|tr -d [:cntrl:]] Result [0] []
    010154:20060608:135810 Sending back:
    010155:20060608:135816 In check_security()
    010155:20060608:135816 Connection from [127.0.0.1]. Allowed servers [202.83.245.166,localhost]
    010155:20060608:135816 Before read()
    010155:20060608:135816 After read() 2 [14]
    010155:20060608:135816 Got line:mysql.version
    010155:20060608:135816 Run remote command [mysql -V|tr -d [:cntrl:]] Result [0] []
    010155:20060608:135816 Sending back:
    === zabbix_agentd debug log, results from zabbix_get -s localhost -k <user key> ===


    So, for some reason, when the zabbix_get command is run (or when the server polls the agent, improper values are returned.

    Is this a bug in the agent when a network connection is made to poll for values? Anyone have any advice on how I could better track this problem down?

    Any ideas or help would be greatly appreciated. Thanks in advance.

    - Paul
  • pdwalker
    Senior Member
    • Dec 2005
    • 166

    #2
    *bump*

    anyone experience this or a similar problem with the agent?

    A confirmation one way or another would be very helpful in tracking this problem down.

    - Paul

    Comment

    • pdwalker
      Senior Member
      • Dec 2005
      • 166

      #3
      *bump*

      Can anyone who is running zabbix 1.1 confirm that their user parameters are working?

      Comment

      • pdwalker
        Senior Member
        • Dec 2005
        • 166

        #4
        to confirm:

        running zabbix_agend -p returns useful data, including the user parameters

        when I telnet localhost 10050 and ask for one of the user parameters, I get back a null.

        in the agentd log file, I get the following results

        === running zabbix_agentd -p ===
        032022:20060619:113128 Run remote command [mysqladmin -u<user> -p<password> -h<server> status|cut -f8 -d" "|tr -d [:cntrl:]] Result [10] [2129608828]

        === telnet locahost 10050 and asking for mysql.questions on the same machine ===
        031486:20060619:113239 Run remote command [mysqladmin -u<user> -p<password> -h<host> status|cut -f8 -d" "|tr -d [:cntrl:]] Result [0] []

        There are no firewalls on the machine.

        Why is zabbix_agentd -p able to retrieve the values, but telnetting to the port and asking for the data returns nothing?

        - Paul

        Comment

        • pdwalker
          Senior Member
          • Dec 2005
          • 166

          #5
          resolved: user parameter checks not working when polled by the server

          The problem appears to be because the zabbix_agentd was not picking up the environment from the zabbix user.

          hard coding the paths explicitly to the programs run by the user parameters resolved the problem.

          - Paul

          Comment

          • marc
            Senior Member
            • Oct 2004
            • 146

            #6
            ack. and in 1.1beta8 it was working. just had to change it myself after updating last week.

            Comment

            • stever
              Member
              • Jun 2006
              • 36

              #7
              Originally posted by pdwalker
              *bump*

              Can anyone who is running zabbix 1.1 confirm that their user parameters are working?
              I have a new install ( started off with zabbix 1.1 ), and user parameters are working correctly.

              Comment

              Working...