I've published it with fixes to Zabbix Share:
Ad Widget
Collapse
Template for HP MSA 2040 (external check)
Collapse
X
-
Hi, I met below issue while I run hp-msa.pl, would you please help me to confirm what happened? Thanks.
[root@ externalscripts]# perl /usr/local/zabbix/share/zabbix/externalscripts/hp-msa.pl [IP address] data enclosure 2 health
mismatched tag at line 9, column 2, byte 186 at /usr/lib64/perl5/XML/Parser.pm line 187Comment
-
with latest version i have some errors.
1)but !manage - is default password. i cant use this script without changing password.Code:# /usr/lib/zabbix/externalscripts/hp-msa.pl msa2000-1 manage !manage lld [B]bash: !manage: event not found[/B]
when i changed password it works:
2) but in msa2040 does't workCode:# /usr/lib/zabbix/externalscripts/hp-msa.pl msa2000-1 manage Manage123 lld controller { "data" : [ { "{#KEY}" : "A", "{#CLASS}" : "Controller" }, { "{#KEY}" : "B", "{#CLASS}" : "Controller" } ] }
# /usr/lib/zabbix/externalscripts/hp-msa.pl msa2400-1 manage Manage123 lld controller
Unsuccessful stat on filename containing newline at /usr/local/share/perl5/XML/Simple.pm line 950.
Unsuccessful stat on filename containing newline at /usr/local/share/perl5/XML/Simple.pm line 963.
File does not exist: Can't connect to msa2400-1:443
Name or service not known at /usr/share/perl5/LWP/Protocol/http.pm line 51.
at /usr/lib/zabbix/externalscripts/hp-msa.pl line 109.
3) old version create very usefull graphs but this version doesn't.
Template_HP_P2000_G3: {#HP_P2000_TYPE} {#HP_P2000_ID} IOPS
Template_HP_P2000_G3: {#HP_P2000_TYPE} {#HP_P2000_ID} Transfer RateComment
-
hi, thanks for the script, i've changing it to /sbin/perl and getting following error when running it manually:
root@VM-Zabbix:/usr/lib/zabbix/externalscripts# ./hp-msa.pl 10.10.10.10 zabbix zabbixpass
Use of uninitialized value $ARGV[4] in string eq at ./hp-msa.pl line 120.
Use of uninitialized value $ARGV[4] in string eq at ./hp-msa.pl line 123.
Use of uninitialized value $ARGV[4] in string eq at ./hp-msa.pl line 126.
Use of uninitialized value $ARGV[4] in string eq at ./hp-msa.pl line 129.
Use of uninitialized value $ARGV[4] in string eq at ./hp-msa.pl line 132.
{
"data" : []
}
do i really need to install speedycgi for ubuntu 14.04 to run it withour errors?Comment
-
correct. this is using bash for command execution and "!" is reserved for some "Special commands" this Symbol can not be used.Comment
-
Problem with script
Hi,
I have install Zabbix Server 3.0.1, and perl to run scripts hp-msa.pl
Install packages:
yum install perl
yum install perl-CGI-SpeedyCGI-2.22-16.el7.1.x86_64.rpm
yum install perl-libwww-perl-6.05-2.el7.noarch.rpm
yum install perl-CPAN
add ./bashrc
export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/root/perl5";
export PERL_MB_OPT="--install_base /root/perl5";
export PERL_MM_OPT="INSTALL_BASE=/root/perl5";
export PERL5LIB="/root/perl5/lib/perl5:$PERL5LIB";
export PATH="/root/perl5/bin:$PATH";
perl -MCPAN -e 'install LWP::Protocol::https'
yum install perl-XML-Simple
yum install perl-JSON
Zabbix Server LOGS : DEBUG 5
21381:20160330:171526.168 query [txnlev:1] [update items set error='Received value [Can\'t locate LWP/Protocol/https.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.BEGIN failed--compilation aborted at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.speedy_backend[25065]: perl_parse errorspeedy[25054]: Cannot spawn backend process] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]' where itemid=28522;
21211:20160330:171526.247 In substitute_key_macros() data:'hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA06, "health"]'
21211:20160330:171526.254 End of substitute_key_macros():SUCCEED data:'hp-msa.pl[10.0.149.102,monitor,Monitorbtuu1,"data", "vdisk", dgA06, "health"]'
21211:20160330:171526.254 In get_value() key:'hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA06, "health"]'
21211:20160330:171526.255 In get_value_external() key:'hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA06, "health"]'
21211:20160330:171526.255 In zbx_popen() command:'/etc/zabbix/scripts/externalscripts/hp-msa.pl "10.0.149.102" "monitor" "Monitorbtuu1" "data" "vdisk" "dgA06" "health"'
21253:20160330:171527.429 In substitute_key_macros() data:'hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB05, "health"]'
21253:20160330:171527.430 End of substitute_key_macros():SUCCEED data:'hp-msa.pl[10.0.149.102,monitor,Monitorbtuu1,"data", "vdisk", dgB05, "health"]'
21253:20160330:171527.430 In get_value() key:'hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB05, "health"]'
21253:20160330:171527.430 In get_value_external() key:'hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB05, "health"]'
21253:20160330:171527.430 In zbx_popen() command:'/etc/zabbix/scripts/externalscripts/hp-msa.pl "10.0.149.102" "monitor" "Monitorbtuu1" "data" "vdisk" "dgB05" "health"'
21250:20160330:171527.730 Item [HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA04, "freespace-numeric"]] error: Received value [Can't locate LWP/Protocol/https.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.BEGIN failed--compilation aborted at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.speedy_backend[25068]: perl_parse errorspeedy[25057]: Cannot spawn backend process] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
21385:20160330:171528.173 error reason for "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA04, "freespace-numeric"]" changed: Received value [Can't locate LWP/Protocol/https.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.BEGIN failed--compilation aborted at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.speedy_backend[25068]: perl_parse errorspeedy[25057]: Cannot spawn backend process] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
21385:20160330:171528.173 query [txnlev:1] [update items set error='Received value [Can\'t locate LWP/Protocol/https.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.BEGIN failed--compilation aborted at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.speedy_backend[25068]: perl_parse errorspeedy[25057]: Cannot spawn backend process] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]' where itemid=28523;
21179:20160330:171528.863 In substitute_key_macros() data:'hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA03, "health"]'
....................................
Can\'t locate LWP/Protocol/https.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.BEGIN failed--compilation aborted at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 6.speedy_backend[25068]: perl_parse errorspeedy[25057]: Cannot spawn backend process] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]' where itemid=28523;
.......................................
Please help solve the problem.
Regards
PeterComment
-
i am not that familiar with the https Change.
But the first issue seems to be the https for perl:
I think this one Needs to be solved first.Code:Can\'t locate LWP/Protocol/https.pm in
Can you execute the the hp-msa.pl script on commandline first?
please come back with the resultCode:./hp-msa.pl <ip>lld Controller
Comment
-
solved problem with perl env https
Thanks
when I installed the package the problem was solved, but I have another problem:
in server logs there are many time limits when script is executed.
I set value Timeout=30 in zabbix_server.confLast edited by pasik007; 01-04-2016, 08:51.Comment
-
-
Server logs:
3171:20160401:084719.218 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "enclosure", 1, "status"]" became not supported: Timeout while executing a shell script.
3171:20160401:084719.218 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.16, "status"]" became not supported: Timeout while executing a shell script.
3171:20160401:084719.325 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB05, "freespace-numeric"]" became not supported: Received value [File does not exist: Can't connect to 10.0.149.102:443Connection refused at /usr/share/perl5/LWP/Protocol/http.pm line 51. at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 56] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
3171:20160401:084720.784 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_01.12, "health"]" became not supported: Timeout while executing a shell script.
3171:20160401:084720.784 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB02, "freespace-numeric"]" became not supported: Received value [File does not exist: Can't connect to 10.0.149.102:443Connection refused at /usr/share/perl5/LWP/Protocol/http.pm line 51. at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 109] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
3174:20160401:084723.880 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.14, "health"]" became not supported: Timeout while executing a shell script.
3174:20160401:084724.892 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.07, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084725.912 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA06, "freespace-numeric"]" became not supported: Received value [File does not exist: Can't connect to 10.0.149.102:443Connection refused at /usr/share/perl5/LWP/Protocol/http.pm line 51. at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 56] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
3174:20160401:084725.912 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "volume", ASM_PROD_DATA_01, "health"]" became not supported: Timeout while executing a shell script.
3174:20160401:084726.925 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA05, "health"]" became not supported: Timeout while executing a shell script.
3174:20160401:084726.925 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.10, "health"]" became not supported: Timeout while executing a shell script.
3174:20160401:084729.947 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_01.22, "status"]" became not supported: Timeout while executing a shell script.
3172:20160401:084730.961 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA02, "freespace-numeric"]" became not supported: Received value [File does not exist: Can't connect to 10.0.149.102:443Connection reset by peer at /usr/share/perl5/LWP/Protocol/http.pm line 51. at /etc/zabbix/scripts/externalscripts/hp-msa.pl line 109] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
3174:20160401:084731.963 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_01.05, "health"]" became not supported: Timeout while executing a shell script.
3174:20160401:084731.964 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB03, "freespace-numeric"]" became not supported: Timeout while executing a shell script.
3171:20160401:084732.075 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "volume", Backup_MYSQL_ZABBIX_01, "health"]" became not supported: Timeout while executing a shell script.
3173:20160401:084734.074 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.08, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084734.993 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "volume", ASM_TEST_ARCH_01, "health"]" became not supported: Timeout while executing a shell script.
3172:20160401:084735.999 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_01.21, "status"]" became not supported: Timeout while executing a shell script.
3172:20160401:084735.999 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.15, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084737.014 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB04, "freespace-numeric"]" became not supported: Timeout while executing a shell script.
3172:20160401:084739.025 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA06, "health"]" became supported
3172:20160401:084740.037 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA06, "status"]" became not supported: Timeout while executing a shell script.
3172:20160401:084740.037 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_01.02, "status"]" became not supported: Timeout while executing a shell script.
3172:20160401:084741.050 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA01, "health"]" became supported
3172:20160401:084741.050 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_01.12, "status"]" became not supported: Timeout while executing a shell script.
3173:20160401:084743.098 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB02, "health"]" became supported
3172:20160401:084744.103 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.20, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084745.115 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB02, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084745.115 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA01, "status"]" became not supported: Timeout while executing a shell script.
3172:20160401:084746.126 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA06, "status"]" became supported
3173:20160401:084747.126 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA04, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084748.130 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB04, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084748.130 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA03, "status"]" became supported
3171:20160401:084750.145 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB03, "status"]" became supported
3173:20160401:084752.154 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_01.10, "status"]" became not supported: Timeout while executing a shell script.
3173:20160401:084752.154 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgB04, "status"]" became supported
3174:20160401:084754.164 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "volume", Zabbix_DBData_01, "health"]" became not supported: Timeout while executing a shell script.
3174:20160401:084754.164 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.11, "status"]" became not supported: Timeout while executing a shell script.
3171:20160401:084755.175 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "vdisk", dgA05, "status"]" became supported
3173:20160401:084756.282 item "HP MSA 2040 W:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "disk", disk_02.18, "status"]" became not supported: Timeout while executing a shell script.
3174:20160401:084758.191 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "enclosure", 1, "enclosure-power"]" became supported
3173:20160401:084758.347 item "HP MSA 2040 B:hp-msa.pl[{$MSA1},{$USER},{$PASSWORD},"data", "enclosure", 2, "health"]" became supported
OK, how can I solve this problem?Last edited by pasik007; 01-04-2016, 11:23.Comment
Comment