Ad Widget

Collapse

User parameter returns wrong value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saqib
    Junior Member
    • Feb 2011
    • 4

    #1

    User parameter returns wrong value

    I have created custom service monitor by using "User Parameter"

    In Agent config file i placed below line
    UserParameter=service.status[*],/etc/init.d/$1 status > /dev/null 2>&1; echo $?
    Now i created Items dhcpd, radiusd , named with below keys
    service.status[dhcpd]
    serviice.status[radiusd]
    service.status[named]
    All services are running on System, so all should return Value "0". But unfortunately only dhcpd is giving value 0. radisud and named is showing value 2
    I dont know whats the issue.I trun this command locally which is giving
    /etc/init.d/radiusd status > /dev/null 2>&1; echo $?

    It return 0

    I also queried from zabbix agent directly
    /usr/local/zabbix/sbin/zabbix_agentd -t service.status[radiusd]
    service.status[] [t|0]
    Which also return 0

    However Zabbix Frontend and Debug level logs of zabbix agent is showing value 2

    25455:20110218:095656.006 Requested [service.status[dhcpd]]
    25455:20110218:095656.039 Run remote command [/etc/init.d/dhcpd status > /dev/null 2>&1; echo $?] Result [1] [0]...
    25456:20110218:095657.088 Requested [service.status[radiusd]]
    25456:20110218:095657.176 Run remote command [/etc/init.d/radiusd status > /dev/null 2>&1; echo $?] Result [1] [2]...
    25456:20110218:095658.192 Requested [service.status[named]]
    25456:20110218:095658.336 Run remote command [/etc/init.d/named status > /dev/null 2>&1; echo $?] Result [1] [2]...

    Can any body help me out in this matter?
  • saqib
    Junior Member
    • Feb 2011
    • 4

    #2
    same issue on monitoring squid service

    I am getting same issue while monirotring squid serive.zabbix agent on local machine return "0" as squid service is ruuning.However zabbix web displays value 134. Is it bug? Please reply me

    Comment

    • saqib
      Junior Member
      • Feb 2011
      • 4

      #3
      User Parameter returns wrong value

      Can any body give me advise on above mentioned issue. I am facing this issue.

      Comment

      • saqib
        Junior Member
        • Feb 2011
        • 4

        #4
        I am unable to check LDAP service status

        I Tried multiple options.

        net.tcp.service[ldap]
        net.tcp.service[ldap,389]
        net.tcp.service[ldap,,389]

        But all of the above returned [m|ZBX_NOTSUPPORTED]

        I tried custom Userparameter
        UserParameter=service.status[*],/etc/init.d/$1 status > /dev/null;echo $?

        But it display wrong value 3 on Zabbix frontend. However return 0 if i query from local host

        # zabbix_agentd -t service.status[ldap]
        service.status[ldap] [t|0]

        Why it is showing Inconsistant information. I wil be thankful if anybody help me

        Comment

        • ableev
          Senior Member
          Zabbix Certified Specialist
          • Oct 2012
          • 276

          #5
          zabbix user allow to use this init scripts?

          for comparison:
          Code:
          localhost ~ # /etc/init.d/lighttpd status > /dev/null 2>&1; echo $?
          4
          localhost ~ # sudo -u zabbix /etc/init.d/lighttpd status > /dev/null 2>&1; echo $?
          1
          root got '4' code, user got '1'
          Code:
          localhost ~ # sudo -u zabbix /etc/init.d/lighttpd status
          chown: changing ownership of `/var/run/lighttpd': Operation not permitted

          Comment

          Working...