Hello everyone, I want to use a plugin called check_printer_info, this is a perl plugin. I've downloaded it, copied the .pl file in my nagios plugins, correct rights to use this, and calling it in my definitions, but the result is the follow:
(No output on stdout) stderr: Can't locate Nagios/Plugin.pm in @INC (you may need to install the Nagios::Plugin module) (@INC contains: /usr/local/nagios/libexec/../perl/lib /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at /usr/local/nagios/libexec/check_printer_info.pl line 42.
I guess that something is missing in my Ubuntu related with PERL, but I'm lost.... This is my first Perl plugin in my Ngios Core, all other plugins are running fine.
This is my code:
define command{
command_name check_printer
command_line $USER1$/check_printer_info.pl -H $HOSTADDRESS$ -T hp
}
define service{
use generic-service
host_name printer1
check_command check_printer
}
Thank you!
Missing perl module using a perl plugin
Re: Missing perl module using a perl plugin
What happens if you run the command over command line?
Former Nagios Employee
Re: Missing perl module using a perl plugin
Exactly the same... 
The code of this plugin, says....
# Fins the Nagios::Plugin lib. Change this path if necessary
use FindBin
use lib "$FindBin::Bin/../perl/lib";
use Nagios::Plugin qw(%ERRORS);
If I use this command from command line "which perl", it returns "/usr/bin/perl"
The code of this plugin, says....
# Fins the Nagios::Plugin lib. Change this path if necessary
use FindBin
use lib "$FindBin::Bin/../perl/lib";
use Nagios::Plugin qw(%ERRORS);
If I use this command from command line "which perl", it returns "/usr/bin/perl"
Re: Missing perl module using a perl plugin
I am not 100% sure if this will fix the issue, but can you try the following?
Code: Select all
cd /tmp
yum install -y 'perl(Test::Simple)' 'perl(Class::Accessor)' perl-Params-Validate perl-Config-Tiny perl-Math-Calc-Units
wget https://cpan.metacpan.org/authors/id/N/NA/NAGIOS/Nagios-Monitoring-Plugin-0.51.tar.gz
perl Makefile.PL
make
make test
make installFormer Nagios Employee.
me.
me.
Re: Missing perl module using a perl plugin
Many thanks, by the moment I've been using another plugin called check_hpjd, it works for all we need.
Anyway, there is an alternative to "yum"?
Anyway, there is an alternative to "yum"?
Re: Missing perl module using a perl plugin
Technically, but yum is what is used in RHEL/CentOS by default and switching it is going to be pretty terrible. You could look into dnf, but switching your package manager is not trivial, and may break more than it fixes. What is your reason for wanting to not use yum?
Former Nagios Employee.
me.
me.
Re: Missing perl module using a perl plugin
I'm running Nagios Core in Ubuntu 14.04.
Re: Missing perl module using a perl plugin
In that case, use apt-get instead of yum.
Former Nagios Employee.
me.
me.