PERL Scripts are not working V2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

PERL Scripts are not working V2

Post 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
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: PERL Scripts are not working V2

Post by rkennedy »

Just to clarify - which machine is producing the error?
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: PERL Scripts are not working V2

Post by Box293 »

Try:

Code: Select all

yum install -y perl-gettext
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: PERL Scripts are not working V2

Post 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.]
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: PERL Scripts are not working V2

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: PERL Scripts are not working V2

Post by Box293 »

Try:

Code: Select all

yum -y install perl-Time-HiRes
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: PERL Scripts are not working V2

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: PERL Scripts are not working V2

Post by Box293 »

What about:

Code: Select all

yum -y install perl-DateTime perl-TimeDate
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: PERL Scripts are not working V2

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: PERL Scripts are not working V2

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked