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
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
Comment