--- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias.userparam_smart 2009-08-28 05:28:21.000000000 +0200 +++ smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias 2009-08-28 05:28:55.000000000 +0200 @@ -1,5 +1,5 @@ { -my $runasroot = '/usr/bin/mysqladmin status, /sbin/e-smith/db yum_updates show, /var/lib/zabbix/bin/sensors *'; +my $runasroot = '/usr/bin/mysqladmin status, /sbin/e-smith/db yum_updates show, /var/lib/zabbix/bin/sensors *, /usr/sbin/smartctl -A /dev/*'; if ( -x '/opt/MegaRAID/MegaCli/MegaCli' ){ $runasroot .= ', /opt/MegaRAID/MegaCli/MegaCli *'; } --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_smart.userparam_smart 2009-08-28 05:29:14.000000000 +0200 +++ smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_smart 2009-08-28 05:31:05.000000000 +0200 @@ -0,0 +1,39 @@ +# Smart Monitoring + +# Description: Smart Value +# Key can be one of: Raw_Read_Error_Rate, Spin_Up_Time, Start_Stop_Count +# Reallocated_Sector_Ct, Seek_Error_Rate, Power_On_Hours, Spin_Retry_Count, +# Power_Cycle_Count, Temperature_Celsius, Hardware_ECC_Recovered, +# Current_Pending_Sector, Offline_Uncorrectable, UDMA_CRC_Error_Count, +# Multi_Zone_Error_Rate, TA_Increase_Count + +# Type: Agent or Agent (active) +# Key: system.smart.hdX[] (for example system.smart.hd1[Reallocated_Sector_Ct]) +# Type of information: Numeric (integer 64bit) +# Units: (none) +# Use multiplier: No +# Update interval: 120 (for example) +# Store Value: As is +# Show Value: As is + +# For Seek_Error_Rate, Raw_Read_Error_Rate, Hardware_ECC_Recovered you can store value as Delta +# in order to graph the error rate in a readable format + +# For these UserParameter to work, you need to configure the drives you want to monitor +# in the DB: +# db configuration setprop zabbix-agent SmartDrives /dev/sda,/dev/sdb,/dev/sdc,/dev/sdd +# signal-event zabbix-agent-update + +{ + +my @hd = split( /[,;]/,( ${'zabbix-agent'}{'SmartDrives'} || '' )); + +my $cnt = 1; +foreach my $drive (@hd){ + if ( -e $drive){ + $OUT .= "UserParameter=system.smartd.hd" . $cnt. "[*],/usr/bin/sudo /usr/sbin/smartctl -A $drive| grep \$1| tail -1| cut -c 88-|cut -f1 -d' '"; + $cnt++; + } +} +} +