Hello all:
I'm trying to configure a few perl monitoring scrtipt for ZEVENET Load Balancer. According to their GitHub page i need to download a few packages, but they are not working from my end
[root@nagios libexec]# perl -MCPAN -e 'install WWW::Curl'
CPAN: Storable loaded ok (v2.20)
CPAN: LWP::UserAgent loaded ok (v5.833)
CPAN: Time::HiRes loaded ok (v1.9721)
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp101022'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
Fetching with LWP:
http://www.perl.org/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.perl.org:80 (Bad hostname 'www.perl.org')]
Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
"http://www.perl.org/CPAN/authors/01mailrc.txt.gz"
curl: (6) Couldn't resolve host 'www.perl.org'
Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://www.perl.org/CPAN/authors/01mailrc.txt.gz" > /root/.cpan/sources/authors/01mailrc.txt.tmp101022")
returned status 6 (wstat 1536)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp101022] doesn't exist
Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/01mailrc.txt.tmp101022" to get
"http://www.perl.org/CPAN/authors/01mailrc.txt.gz"
--2018-01-16 17:40:04-- http://www.perl.org/CPAN/authors/01mailrc.txt.gz
Resolving www.perl.org... failed: No address associated with hostname.
wget: unable to resolve host address âwww.perl.orgâ
returned status 4 (wstat 1024)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp101022] doesn't exist
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp101022'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[LWP::Protocol::MyFTP: Bad hostname 'ftp.perl.org']
Fetching with Net::FTP:
ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
Could not connect to host 'ftp.perl.org' with Net::FTP
Fetching with Net::FTP
ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz.gz
Could not connect to host 'ftp.perl.org' with Net::FTP
Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
"ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz"
curl: (6) Couldn't resolve host 'ftp.perl.org'
Function system("/usr/bin/curl -L -f -s -S --netrc-optional "ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz" > /root/.cpan/sources/authors/01mailrc.txt.tmp101022")
returned status 6 (wstat 1536)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp101022] doesn't exist
Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/01mailrc.txt.tmp101022" to get
"ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz"
--2018-01-16 17:40:09-- ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
=> â/root/.cpan/sources/authors/01mailrc.txt.tmp101022â
esolving ftp.perl.org... failed: No address associated with hostname.
wget: unable to resolve host address âftp.perl.orgâ
returned status 4 (wstat 1024)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp101022] doesn't exist
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp101022'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
No external ftp command available
Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist
push ftp://myurl/'
Could not fetch authors/01mailrc.txt.gz
When i try to run the scrtip from CM i got the following error:
[root@nagios libexec]# perl check_zevenet_cpu.pl -H XXX.XXX.XXX.XXX -z 6DH2xE0yTiioiZrMyUpv -w 20 -c 10
Can't use an undefined value as filehandle reference at check_zevenet_cpu.pl line 179.
Also, what is your operating system? Did you get the latest version of this plugin from the Github? Does the plugin run OK without any arguments, or does it still fail with the same error?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Also, what is your operating system? Did you get the latest version of this plugin from the Github? Does the plugin run OK without any arguments, or does it still fail with the same error?
Thanks for the response. I have installed the VM provided by Nagios. (CentOS release 6.9 (Final) )
the only package missing was libcurl-devel.x86_64 and the OS cannot find libwww-curl-perl
Package perl-WWW-Curl-4.09-4.el6.x86_64 already installed and latest version
Nothing to do
[root@nagios libexec]# perl check_zevenet_swap.pl -H hostip -z 6DH2xE0yTiioiZrMyUpv0I2YP -c10 -w20
Can't use an undefined value as filehandle reference at check_zevenet_swap.pl line 178.
I see that you have been posting at the author of the plugins web site and they just posted a possible fix to the plugin.
Try implementing the fix and see if that solves the issue for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
according with the script owner, he cannot replicate the issue and from his side the script works fine. They are using a Debian Distro and i'm using the Centos VM provided by Nagios.
the curious thing is, running a curl -k i got response from the Balancer
[root@nagios libexec]# perl check_zevenet_cpu.pl -H HostIP -z Zapi Key -w 20 -c 10
Can't use an undefined value as filehandle reference at check_zevenet_cpu.pl line 179.
'
he pointed me to update the libraries but they seems to be up to date.