Ad Widget

Collapse

zabbix_get returning blank instead of a value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Goomie
    Junior Member
    • Jun 2014
    • 3

    #1

    zabbix_get returning blank instead of a value

    Hi,

    I have a few userparameters that return values fine via zabbix_get and are being monitored without issues.
    However when trying to return a value to do with smartctl I get blank when returning zabbix_get on my server. The zabbix_agentd -t on the client works perfectly.

    Is there any reason why a userparameter would work on the client but not my server when I have other userparameters that work fine.

    Script
    smartctl -a /dev/sda | egrep -i "Reallocated_Sector_Ct" | awk '{ print $10 }'

    Zabbix_agentd.conf
    UserParameter=dev.sda, /usr/bin/sda.sh

    Works on client
    zabbix_agentd -t dev.sda

    Returns blank on server
    zabbix_get -s [IP ADDRESS] -p 10050 -k dev.sda

    Any pointers appreciated.
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    permissions.

    when you test the parameters on the client - zabbix_agentd works under root/administrator account

    when you request the same parameter from zabbix server using zabbix_get - zabbix_agent on client works under Zabbix credentials.
    Sincerely yours,
    Aleksey

    Comment

    • Goomie
      Junior Member
      • Jun 2014
      • 3

      #3
      Thanks Aib,

      I did suspect this but thought it was strange that all my other scripts work fine, just that the smartctl ones have issues. But I guess it's a feature for smartctl to need user privileges set

      I've added 'zabbix ALL=NOPASSWD: ALL' to my sudeors file, which hasn't made a difference.

      Do you know if I have to restart the server for the sudeors change to take affect? It's just it's difficult to find time for the server restart, it's heavily used.

      Many thanks

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        Not only Zabbix has a problem with smartctl.
        Nagios/Cacti/etc also faced with the same trouble because: "smartctl requires root permissions"

        You can play around sudo, or you can give a permission for file /dev/cciss/c0d0: as it was described here
        Sincerely yours,
        Aleksey

        Comment

        • Goomie
          Junior Member
          • Jun 2014
          • 3

          #5
          Great thanks for the pointers Aleksey.

          Comment

          Working...