Page 1 of 2

PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 8:30 pm
by absarcompass
Hi Guys,
In previous thread I was able to communicate with databases using ODBC.ini
but I am still getting issues with perl

NagiosCore 3.5.1 is on gentoo
less /proc/version
Linux version 4.1.12-gentoo (gcc version 4.9.3 (Gentoo 4.9.3 p1.4, pie-0.6.4) )
Command is /usr/bin/perl /usr/lib/nagios/plugins/check_haproxy.pl -u 'http://xxx.xxx.xx.xx.csv' -U aaaaaaa -P xxxxxxxxx

NagiosXI is on CentOS
less /proc/version
Linux version 2.6.32-358.2.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) )
Command is /usr/bin/perl /usr/local/nagios/libexec/check_haproxy.pl -u 'http://xxx.xxx.xx.xx.csv' -U aaaaaaa -P xxxxxxxxx
Error:
Can't locate Locale/gettext.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 /usr/local/nagios/libexec/check_haproxy.pl line 26.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_haproxy.pl line 26

I tried to install gettext from yum it says it is installed
Package gettext-0.17-18.el6.x86_64 already installed and latest version
Nothing to do
Line 26 of script, that is shown Erroneous output, contains use Locale::gettext;

can any one guide me through what needs to be installed or copied from older nagios in order to make this service working on new one. (This is working on the older nagios)

Thanks in advance

The plugin is 'check_haproxy.pl'
check_haproxy.pl

Re: PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 8:34 pm
by rkennedy
Just to clarify - which machine is producing the error?

Re: PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 8:36 pm
by Box293
Try:

Code: Select all

yum install -y perl-gettext

Re: PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 8:52 pm
by absarcompass
Hi rkennedy and Box293
thanks for the reply
NagiosXI that is on CentOS is giving error

this is another error on nagiosXI
./plugin_capture.pl /usr/local/nagios/libexec/check_database_table_locking.pl DATABASE

Can't locate Time/ParseDate.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 /usr/local/nagios/libexec/check_database_table_locking.pl line 6.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_database_table_locking.pl line 6.]

Re: PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 8:58 pm
by absarcompass
Hi Box293,
Just installed that :) looks like older error is kind of gone. i'll update on it.
/usr/bin/perl /usr/local/nagios/libexec/check_haproxy.pl -u 'csv' -U -P

HAPROXY UNKNOWN - Can't find csv header ! | t=0.085069s;2;10;0;
Transaction Test Succeeded
Running Transaction
Installing : perl-gettext-1.05-16.el6.x86_64 1/1
Verifying : perl-gettext-1.05-16.el6.x86_64 1/1

Installed:
perl-gettext.x86_64 0:1.05-16.el6
but this new error is still there.
[root@nagiosxi]# ./plugin_capture.pl /usr/local/nagios/libexec/check_database_table_locking.pl DATABASE

Can't locate Time/ParseDate.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 /usr/local/nagios/libexec/check_database_table_locking.pl line 6.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_database_table_locking.pl line 6.
Thanks in advance mate

Re: PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 9:16 pm
by Box293
Try:

Code: Select all

yum -y install perl-Time-HiRes

Re: PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 10:03 pm
by absarcompass
It says nothing to do
[root@nagiosxi]# yum -y install perl-Time-HiRes
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.xnet.co.nz
* epel: mirror.xnet.co.nz
* extras: mirror.xnet.co.nz
* rpmforge: apt.sw.be
* updates: mirror.xnet.co.nz
Setting up Install Process
Package 4:perl-Time-HiRes-1.9721-141.el6_7.1.x86_64 already installed and latest version
Nothing to do

Re: PERL Scripts are not working V2

Posted: Mon Apr 25, 2016 10:13 pm
by Box293
What about:

Code: Select all

yum -y install perl-DateTime perl-TimeDate

Re: PERL Scripts are not working V2

Posted: Tue Apr 26, 2016 5:32 pm
by absarcompass
unfortunately nothing to do, no luck
Setting up Install Process
Package 1:perl-DateTime-0.5300-2.el6.x86_64 already installed and latest version
Package 1:perl-TimeDate-1.16-13.el6.noarch already installed and latest version
Nothing to do

Re: PERL Scripts are not working V2

Posted: Tue Apr 26, 2016 5:36 pm
by Box293
absarcompass wrote:but this new error is still there.
[root@nagiosxi]# ./plugin_capture.pl /usr/local/nagios/libexec/check_database_table_locking.pl DATABASE

Can't locate Time/ParseDate.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 /usr/local/nagios/libexec/check_database_table_locking.pl line 6.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_database_table_locking.pl line 6.
Thanks in advance mate
I did not notice you moved onto a different plugin, I was still looking at the code from check_haproxy.pl.

Please upload plugin_capture.pl and check_database_table_locking.pl