perl plugins with core4

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
m.saad
Posts: 3
Joined: Sun Feb 16, 2014 9:18 pm

perl plugins with core4

Post by m.saad »

im working with mysql_health_check now and it's working fine from command and when i've but when add it to config it does not
and shows error
Critical "Return code of 13 is out of bounds") is this related to enable_embedded_perl removal from core4

and i test this plugin with core3 and it's working fine with the same configuration
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: perl plugins with core4

Post by abrist »

Yes, the internal perl implementation was removed in core 4, and yes, it is most likely the cause of your issue. You will need to make sure perl is installed on the host in question, and you will need to add "/usr/bin/perl" to the beginning of the check's command line. For example:

Code: Select all

define command {
       command_name                             fancy_perl_plugin_check
       command_line                             /usr/bin/perl $USER1$/fancypants_plugin.pl
}
You can discover which path to perl to use with:

Code: Select all

which perl
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
m.saad
Posts: 3
Joined: Sun Feb 16, 2014 9:18 pm

Re: perl plugins with core4

Post by m.saad »

thanks but the problem still the same
Feb 17 13:22:00 Nagios nagios: Warning: Return code of 13 for check of service 'mysql uptime' on host 'server.XXX.com' was out of bounds.

and i've tested the plugin with core3 and it's working fine with the same command line configuration
and also i've tested it to run command throught nrpe and it's woring fine

but the problem still the same with core4
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: perl plugins with core4

Post by abrist »

It could also be a permissions issue. what are the permissions on the plugin? Can you run the check from the cli as user "nagios"?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
m.saad
Posts: 3
Joined: Sun Feb 16, 2014 9:18 pm

Re: perl plugins with core4

Post by m.saad »

it's ok when i run the command from the command line as nagios user

[nagios@Nagios libexec]$ /usr/bin/perl mysql_health_check.pl -H localhost -u XXXX -p XXXX -m varcomp --expression='Threads_connected/max_connections * 100' --comparison='>80'
mysql_varcomp OK - Comparison check passed: (Threads_connected/max_connections * 100) >80 = 0.66
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: perl plugins with core4

Post by abrist »

Can you post the full command and service check definitions?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked