Nagios::Monitoring::Plugin

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Nagios::Monitoring::Plugin

Postby Nitesh » Mon Apr 04, 2016 4:32 am

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

Re: Nagios::Monitoring::Plugin

Postby rkennedy » Mon Apr 04, 2016 9:46 am

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?
rkennedy
 
Posts: 6562
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios::Monitoring::Plugin

Postby Nitesh » Tue Apr 05, 2016 12:03 am

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

Re: Nagios::Monitoring::Plugin

Postby lmiltchev » Tue Apr 05, 2016 12:07 pm

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 476 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!
User avatar
lmiltchev
QA Manager
 
Posts: 9970
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios::Monitoring::Plugin

Postby zelda69 » Mon Mar 12, 2018 11:47 am

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
zelda69
 
Posts: 1
Joined: Mon Mar 12, 2018 11:35 am

Re: Nagios::Monitoring::Plugin

Postby tmcdonald » Mon Mar 12, 2018 11:54 am

Thank you for the input, but as this thread is nearly 2 years old at this point I will be locking it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Operations Engineer
 
Posts: 8918
Joined: Mon Sep 23, 2013 8:40 am


Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests