Ad Widget

Collapse

UserParameters return empty value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mel128
    Junior Member
    • Sep 2013
    • 3

    #1

    UserParameters return empty value

    Hello everybody !

    All my Zabbix installation is a new one at version 3.0 LTS. On a Debian Jessie I've a running agent behind a proxy. Both works fine since months with the default Linux OS template.

    Now I would to monitor the SMART data of the hardisks.

    I've create a discovery scripts that works fine. Both hard disks are detected.

    To get the ATA error count, I've added :

    UserParameter=HW.HDD.smart.errorcount[*], smartctl -l error /dev/$1 |grep "ATA Error Count"| cut -f2 -d: |tr -d " "

    In a console, the command returns the correct value when I replace $1 by sdb, there are actually 2 errors logged for sdb.

    zabbix_agentd -t HW.HDD.smart.errorcount[sdb] returns also the correct value [t|2]

    Meanwhile, after having restarted the agent, zabbix_get -s CORRECTIPADDRESS -p 10050 -k HW.HDD.smart.errorcount[sdb] return nothing neither from the proxy nor from the monitored host.

    The parameter sdb seems passed because in the log in extensive mode I see :

    6994:20170104:135038.901 EXECUTE_STR() command:' smartctl -l error /dev/sdb |grep "ATA Error Count"| cut -f2 -d: |tr -d " "' len:0 cmd_result:''

    All commands are working fine, and the server retreive the correct value, if I try a simple UserParameter like : UserParameter=HW.HDD.smart.errorcount.test[*], echo $1

    Any idea to solve this issue ?

    Best regards.

    Michel
  • guzzijason
    Senior Member
    • Dec 2015
    • 106

    #2
    Two possibilities:

    1) smartctl needs to be executed as the root user, and the zabbix user doesn't have permissions.

    2) I think smartctl is located in /usr/sbin/ and zabbix may not find it in its default path. You probably want to execute the command using the full path /usr/sbin/smartctl just to be sure.

    I suspect that you may have a problem with *both* of these issues, actually.

    __Jason

    Comment

    • mel128
      Junior Member
      • Sep 2013
      • 3

      #3
      Thank a lot Jason, you are right !

      Comment

      Working...