Nagios::Monitoring::Plugin

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
Nitesh
Posts: 2
Joined: Mon Apr 04, 2016 4:23 am

Nagios::Monitoring::Plugin

Post by Nitesh »

Dear Team,

I am referring to one of the Nagios world conference(i.e. Writing custom Nagios Plugins - Nathan Vonnahme).
In the same, i have downloaded check_stuff.pl plugin.
That plugin is giving me error of Nagios::Monitoring::Plugin as below

[root@rhel56 libexec]# perl check_stuff.pl
Can't locate Nagios/Monitoring/Plugin.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 check_stuff.pl line 19.
BEGIN failed--compilation aborted at check_stuff.pl line 19.

I am using strawberry perl.
Please help in error troubleshooting.

Regards,
Nitesh kumar
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios::Monitoring::Plugin

Post by rkennedy »

You will need to install the perl-Nagios-Plugin -

Code: Select all

yum install perl-Nagios_plugin
If that does not work, what is the result of find / -name Plugin.pm?
Former Nagios Employee
Nitesh
Posts: 2
Joined: Mon Apr 04, 2016 4:23 am

Re: Nagios::Monitoring::Plugin

Post by Nitesh »

I have already installed the same.
Nagios::Plugin is running without any issue.

PFB the output of your suggestions :-


[root@rhel56 t]# yum install perl-Nagios_plugin
Loaded plugins: refresh-packagekit
Setting up Install Process
No package perl-Nagios_plugin available.
Error: Nothing to do


[root@rhel56 t]# find / -name Plugin.pm
/root/Nagios-Monitoring-Plugin-0.51/lib/Nagios/Monitoring/Plugin.pm
/usr/lib64/perl5/vendor_perl/Plugin.pm
/usr/local/lib64/perl5/Nagios/Monitoring/Plugin.pm
/usr/local/lib64/perl5/Plugin.pm
/usr/local/nagios/Nagios-Monitoring-Plugin-0.51/lib/Nagios/Monitoring/Plugin.pm
/var/tmp/Nagios-Monitoring-Plugin-0.51/lib/Nagios/Monitoring/Plugin.pm

I am using /usr/local/lib64/perl5/ and have downloaded Validate.pm, Tiny.pm etc in the same.
But it is asking for other dependencies again and again.

Below is the latest error log :-

[root@rhel56 t]# perl check_stuff.pl
Base class package "Config::Tiny" is empty.
(Perhaps you need to 'use' the module which defines that package first,
or make that module available 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/lib64/perl5/Nagios/Monitoring/Plugin/Config.pm line 6
BEGIN failed--compilation aborted at /usr/local/lib64/perl5/Nagios/Monitoring/Plugin/Config.pm line 6.
Compilation failed in require at /usr/local/lib64/perl5/Nagios/Monitoring/Plugin/Getopt.pm line 16.
BEGIN failed--compilation aborted at /usr/local/lib64/perl5/Nagios/Monitoring/Plugin/Getopt.pm line 16.
Compilation failed in require at /usr/local/lib64/perl5/Nagios/Monitoring/Plugin.pm line 64.

What am i doing wrong..???
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios::Monitoring::Plugin

Post by lmiltchev »

Try the following:

1. Download the file below and save it to your "/tmp/" directory.
Nagios-Monitoring-Plugin-0.51.tar.gz
(45.05 KiB) Downloaded 2677 times
2. Run the following commands:

Code: Select all

cd /tmp
tar xzf Nagios-Monitoring-Plugin-0.51.tar.gz
cd Nagios-Monitoring-Plugin-0.51
perl Makefile.PL
make
make test
make install
Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
zelda69
Posts: 1
Joined: Mon Mar 12, 2018 11:35 am

Re: Nagios::Monitoring::Plugin

Post by zelda69 »

Hey hey buddies,

I had the same error however, even though I was installing the plugin and the necessary packages (CPAN), I did not create the folder or the plugins in the path / usr / local / share / perl5 / Monitoring / Plugin; what you do is in another Nagios Server without problem I believe it and the only thing I did was create the 'Monitoring' folder with its 'Plugin' subdirectory and copy the 'Plugin' files (Config.pm ExitResult.pm Functions.pm Getopt.pm Performance.pm Range.pm Threshold.pm) change the corresponding permissions (they use read only - chmod 444 File. *) And ready work. Your tip helped me perform the 'find' command.

Thanks and regards
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios::Monitoring::Plugin

Post by tmcdonald »

Thank you for the input, but as this thread is nearly 2 years old at this point I will be locking it.
Former Nagios employee
Locked