Page 1 of 1
Nagios::Monitoring::Plugin
Posted: Mon Apr 04, 2016 4:32 am
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
Re: Nagios::Monitoring::Plugin
Posted: Mon Apr 04, 2016 9:46 am
by rkennedy
You will need to install the perl-Nagios-Plugin -
If that does not work, what is the result of
find / -name Plugin.pm?
Re: Nagios::Monitoring::Plugin
Posted: Tue Apr 05, 2016 12:03 am
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..???
Re: Nagios::Monitoring::Plugin
Posted: Tue Apr 05, 2016 12:07 pm
by lmiltchev
Try the following:
1. Download the file below and save it to your "/tmp/" directory.
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.
Re: Nagios::Monitoring::Plugin
Posted: Mon Mar 12, 2018 11:47 am
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
Re: Nagios::Monitoring::Plugin
Posted: Mon Mar 12, 2018 11:54 am
by tmcdonald
Thank you for the input, but as this thread is nearly 2 years old at this point I will be locking it.