Ad Widget
Collapse
HP P2000 G3 monitoring (Zabbix 2.0)
Collapse
X
-
Has anyone added anything to this script / template to detect disk and volume failures by chance? -
You can create test version of script
Check zabbix_agentd.conf ServerActive parameter. Must be IP zabbix_server.Code:diff -u zabbix_hp_msa.pl zabbix_hp_msa_test.pl --- zabbix_hp_msa.pl 2013-03-06 18:14:37.646311331 +0400 +++ zabbix_hp_msa_test.pl 2013-03-07 14:33:23.346248736 +0400 @@ -14,7 +14,7 @@ my $USERNAME = "admin"; my $PASSWORD = "XXXXXXXX"; - +my $test; sub getHPP200Objects { my $ua = shift; my $sessionKey = shift; @@ -165,13 +165,16 @@ die "Could not close file $sendFile!" unless (close(FH)); $zabbixSendCommand .= $sendFile." 2>&1"; - if ( qx($zabbixSendCommand) =~ /Failed 0/ ) { + print "test $zabbixSendCommand\n"; + $test=qx($zabbixSendCommand); + print "test $test\n"; + if ( $test =~ /Failed 0/ ) { $res = 1; } else { $res = 0; } - die "Can not remove file $sendFile!" unless(unlink ($sendFile)); + #die "Can not remove file $sendFile!" unless(unlink ($sendFile)); print "$res\n"; exit ($res - 1); }
ServerActive=127.0.0.1
It turns out the only problem was not having the ServerActive line set correctly since my agent was using passive checks. Once I configured that line correctly it resolved things and now this template is working great. Thanks for the suggestion, it did the trick!
Kind regards,Leave a comment:
-
You can create test version of script
Check zabbix_agentd.conf ServerActive parameter. Must be IP zabbix_server.Code:diff -u zabbix_hp_msa.pl zabbix_hp_msa_test.pl --- zabbix_hp_msa.pl 2013-03-06 18:14:37.646311331 +0400 +++ zabbix_hp_msa_test.pl 2013-03-07 14:33:23.346248736 +0400 @@ -14,7 +14,7 @@ my $USERNAME = "admin"; my $PASSWORD = "XXXXXXXX"; - +my $test; sub getHPP200Objects { my $ua = shift; my $sessionKey = shift; @@ -165,13 +165,16 @@ die "Could not close file $sendFile!" unless (close(FH)); $zabbixSendCommand .= $sendFile." 2>&1"; - if ( qx($zabbixSendCommand) =~ /Failed 0/ ) { + print "test $zabbixSendCommand\n"; + $test=qx($zabbixSendCommand); + print "test $test\n"; + if ( $test =~ /Failed 0/ ) { $res = 1; } else { $res = 0; } - die "Can not remove file $sendFile!" unless(unlink ($sendFile)); + #die "Can not remove file $sendFile!" unless(unlink ($sendFile)); print "$res\n"; exit ($res - 1); }
ServerActive=127.0.0.1Leave a comment:
-
I decided to revisit this script today and the problem I get is that it returns the number "0" every time I run the script. Any suggestions?
Kind regards,Code:./hp-msa.pl hostname.example.com stats 0
Leave a comment:
-
How to use this template/script with a Zabbix Proxy, does anyone known ?Leave a comment:
-
in zabbix_server.conf see
In my system ${datadir}=/usr/local/share/Code:ExternalScripts=${datadir}/zabbix/externalscripts
Path /usr/local/share/zabbix/externalscripts.
You can define any other path in ExternalScripts.Leave a comment:
-
HI,
I have install zabbix 2.0.5 on Unbuntu and monitor San P2000 G3, but I do not know to copy this file hp-msa.pl to directory. please help thanksLeave a comment:
-
-
Zabbix_sender 2.0.3
/usr/local/bin/zabbix_sender.old -c /etc/zabbix/zabbix_agentd.conf -i /tmp/zabbixSenderHPP2000_VMware_Array_16901 1>test1.txt
cat test1.txt
info from server: "Processed 36 Failed 0 Total 36 Seconds spent 0.000587"
sent: 36; skipped: 0; total: 36
Zabbix_sender 2.0.5
/usr/local/bin/zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -i /tmp/zabbixSenderHPP2000_VMware_Array_16901 1>test.txt
cat test.txt
sent: 36; skipped: 0; total: 36
Don’t print Zabbix_sender 2.0.5 in stdout string “info from server: "Processed 36 Failed 0 Total 36 Seconds spent 0.000587"
Patch for script
Code:diff zabbix_hp_msa.pl.old zabbix_hp_msa.pl 13c13 < my $zabbixSendCommand="$zabbixSender -c $zabbixConfd -i "; --- > my $zabbixSendCommand="$zabbixSender -vv -c $zabbixConfd -i "; 167c167 < $zabbixSendCommand .= $sendFile; --- > $zabbixSendCommand .= $sendFile." 2>&1";
Last edited by dima_dm; 07-03-2013, 08:29.Leave a comment:
-
Running CentOS 6.3 x86_64 with perl-5.10.1-127.el6.x86_64 hp-msa.pl returns the following error:
syntax error at line 1, column 0, byte 0 at /usr/lib64/perl5/XML/Parser.pm line 187
It would be great if someone could help me please. Thanks!Leave a comment:
-
The script appears to be succeeding in my zabbix_proxy.log but I'm not seeing anything populated in the latest data area. Any suggestions?Leave a comment:
-
It seems that problem has been solved with the upgrade of P2000 firmware to the latest version. Emir Imamagic, thanks again for share the script.Leave a comment:
-
So, I have solved some problems by reimporting the template. Now I can successfully send data from files, generated with the script, to zabbix-server with zabbix_sender. I can see item values, graphs etc in the latest data. But still no luck with external checks - data receiving is very unstable. When I run the script with hp-msa.pl HOSTNAME I getorCode:{ "data" : [] }Last error may be related with the small period of time between script launches, so I do not consider it as a problem. But the first error is really bothers me. I suggest, I should see an output, like in the file /var/tmp/zabbixSender*. Am I right? Can anyone with working configuration tell me, what the correct output is.Code:Authentication Unsuccessful at /etc/zabbix/externalscripts/hp-msa.pl line 126.
Thanks.Leave a comment:
-
given that there is no show controller statistics command on the G2 I am gonna say it doesn't work on the G2Leave a comment:
-
Hm, I think it's not the script problem.
I tried to send a file with the collected information (/var/tmp/zabbixSender*) to zabbix-server with zabbix_sender like this:
3Code:zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -i /var/tmp/zabbixSenderHPP2000_HostName_291
And I've got a response:
zabbix-server.log says:Code:info from server: "Processed 0 Failed 60 Total 60 Seconds spent 0.002145" sent: 60; skipped: 0; total: 60
I have no idias why Processed 0 Failed 60. Can anybody help please?Code:{ "host":"HOSTNAME", "key":"hp.p2000.stats[Volume,Backup_1,iops]", "value":"0"}, { "host":"HOSTNAME", "key":"hp.p2000.stats[Volume,Backup_1,bytes-per-second-numeric]", "value":"5120"}, { "host":"HOSTNAME", "key":"hp.p2000.stats[Volume,Backup_1,data-written-numeric]", "value":"82499759616"}]}] len 7896 3330:20120802:172313.391 In recv_agenthistory() 3330:20120802:172313.391 In process_hist_data() 3330:20120802:172313.392 In process_mass_data() 3330:20120802:172313.392 End of process_mass_data() 3330:20120802:172313.393 End of process_hist_data():SUCCEED 3330:20120802:172313.393 In zbx_send_response() 3330:20120802:172313.393 zbx_send_response() '{ "response":"success", "info":"Processed 0 Failed 60 Total 60 Seconds spent 0.001607"}' 3330:20120802:172313.393 End of zbx_send_response():SUCCEED 3330:20120802:172313.393 End of recv_agenthistory() 3354:20120802:172313.397 In collect_selfmon_stats() 3354:20120802:172313.397 End of collect_selfmon_stats() 3354:20120802:172313.397 sleeping for 1 seconds 3330:20120802:172313.956 Trapper got [] len 0 3351:20120802:172314.277 sleeping for 1 secLeave a comment:
Leave a comment: