1 |
vip-ire |
1.1 |
--- 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 |
2 |
|
|
+++ 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 |
3 |
|
|
@@ -1,6 +1,16 @@ |
4 |
|
|
|
5 |
|
|
{ |
6 |
|
|
|
7 |
|
|
+my $options = ''; |
8 |
|
|
+my $spares = ${'zabbix-agent'}{'MegaRaidSpares'} || ''; |
9 |
|
|
+$options .= "-s $spares " if ($spares =~ /\d+/); |
10 |
|
|
+my $media_error = ${'zabbix-agent'}{'MegaRaidMediaError'} || ''; |
11 |
|
|
+$options .= "-m $media_error " if ($media_error =~ /\d+/); |
12 |
|
|
+my $other_error = ${'zabbix-agent'}{'MegaRaidOtherError'} || ''; |
13 |
|
|
+$options .= "-o $other_error " if ($other_error =~ /\d+/); |
14 |
|
|
+my $predictive_error = ${'zabbix-agent'}{'MegaRaidPredictiveError'} || ''; |
15 |
|
|
+$options .= "-p $predictive_error " if ($predictive_error =~ /\d+/); |
16 |
|
|
+ |
17 |
|
|
# As this check requires the MegaCli utility, first check if it's present: |
18 |
|
|
if ( -x '/opt/MegaRAID/MegaCli/MegaCli' ){ |
19 |
|
|
$OUT .=<<"HERE"; |
20 |
|
|
@@ -20,7 +30,7 @@ |
21 |
|
|
|
22 |
|
|
# Tips: You can add a simple trigger on this check like: |
23 |
|
|
# \{ hostname:raid.mega.status.str( OK ) \}=0 |
24 |
|
|
-UserParameter=raid.mega.status,/usr/bin/sudo /var/lib/zabbix/bin/megaraid-parser.pl |
25 |
|
|
+UserParameter=raid.mega.status,/usr/bin/sudo /var/lib/zabbix/bin/megaraid-parser.pl $options |
26 |
|
|
|
27 |
|
|
HERE |
28 |
|
|
} |