--- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_megaRaid.megaraid_options_from_db 2010-03-17 09:57:11.000000000 +0100 +++ smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_megaRaid 2010-03-17 10:06:04.000000000 +0100 @@ -1,6 +1,16 @@ { +my $options = ''; +my $spares = ${'zabbix-agent'}{'MegaRaidSpares'} || ''; +$options .= "-s $spares " if ($spares =~ /\d+/); +my $media_error = ${'zabbix-agent'}{'MegaRaidMediaError'} || ''; +$options .= "-m $media_error " if ($media_error =~ /\d+/); +my $other_error = ${'zabbix-agent'}{'MegaRaidOtherError'} || ''; +$options .= "-o $other_error " if ($other_error =~ /\d+/); +my $predictive_error = ${'zabbix-agent'}{'MegaRaidPredictiveError'} || ''; +$options .= "-p $predictive_error " if ($predictive_error =~ /\d+/); + # As this check requires the MegaCli utility, first check if it's present: if ( -x '/opt/MegaRAID/MegaCli/MegaCli' ){ $OUT .=<<"HERE"; @@ -20,7 +30,7 @@ # Tips: You can add a simple trigger on this check like: # \{ hostname:raid.mega.status.str( OK ) \}=0 -UserParameter=raid.mega.status,/usr/bin/sudo /var/lib/zabbix/bin/megaraid-parser.pl +UserParameter=raid.mega.status,/usr/bin/sudo /var/lib/zabbix/bin/megaraid-parser.pl $options HERE }