perl plugins fail - can't proper install perl-nagios-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
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

perl plugins fail - can't proper install perl-nagios-plugin

Post by gmills »

Hello,
I want to use the mysql_health_check.pl
however, it fails because it cannot locate

./mysql_health_check.pl
Can't locate Nagios/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 ./mysql_health_check.pl line 37.
BEGIN failed--compilation aborted at ./mysql_health_check.pl line 37.


the plugin doesn't seem to be able to install properly due to missing dependencies
yum -y install perl-Nagios-Plugin
Loaded plugins: changelog, fastestmirror, fs-snapshot, security, ulninfo, verify
Setting up Install Process
Loading mirror speeds from cached hostfile
* epel: fedora-epel.mirror.lstn.net
* epel_6_x86_64: tnlp010001.tsg.ge.com
* ol6_x86_64_UEKR3_latest: tnlp010001.tsg.ge.com
* ol6_x86_64_UEKR4: tnlp010001.tsg.ge.com
* ol6_x86_64_UEK_latest: tnlp010001.tsg.ge.com
* ol6_x86_64_addons: tnlp010001.tsg.ge.com
* ol6_x86_64_latest: tnlp010001.tsg.ge.com
Resolving Dependencies
--> Running transaction check
---> Package perl-Nagios-Plugin.noarch 0:0.36-7.el7 will be installed
--> Processing Dependency: perl(:MODULE_COMPAT_5.16.3) for package: perl-Nagios-Plugin-0.36-7.el7.noarch
--> Processing Dependency: perl(Class::Accessor) for package: perl-Nagios-Plugin-0.36-7.el7.noarch
--> Processing Dependency: perl(Class::Accessor::Fast) for package: perl-Nagios-Plugin-0.36-7.el7.noarch
--> Processing Dependency: perl(Config::Tiny) for package: perl-Nagios-Plugin-0.36-7.el7.noarch
--> Processing Dependency: perl(Math::Calc::Units) for package: perl-Nagios-Plugin-0.36-7.el7.noarch
--> Processing Dependency: perl(Params::Validate) for package: perl-Nagios-Plugin-0.36-7.el7.noarch
--> Running transaction check
---> Package perl-Class-Accessor.noarch 0:0.34-12.el7 will be installed
--> Processing Dependency: perl(:MODULE_COMPAT_5.16.3) for package: perl-Class-Accessor-0.34-12.el7.noarch
---> Package perl-Config-Tiny.noarch 0:2.12-7.1.el6 will be installed
---> Package perl-Math-Calc-Units.noarch 0:1.07-9.el7 will be installed
--> Processing Dependency: perl(:MODULE_COMPAT_5.16.3) for package: perl-Math-Calc-Units-1.07-9.el7.noarch
---> Package perl-Nagios-Plugin.noarch 0:0.36-7.el7 will be installed
--> Processing Dependency: perl(:MODULE_COMPAT_5.16.3) for package: perl-Nagios-Plugin-0.36-7.el7.noarch
---> Package perl-Params-Validate.x86_64 0:0.92-3.el6 will be installed
--> Finished Dependency Resolution
Error: Package: perl-Class-Accessor-0.34-12.el7.noarch (epel)
Requires: perl(:MODULE_COMPAT_5.16.3)
Error: Package: perl-Nagios-Plugin-0.36-7.el7.noarch (epel)
Requires: perl(:MODULE_COMPAT_5.16.3)
Error: Package: perl-Math-Calc-Units-1.07-9.el7.noarch (epel)
Requires: perl(:MODULE_COMPAT_5.16.3)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest


It appears that using CPAN I was able to install the Nagios plugin but not the perl-Nagios-Plugin but the
cpan Nagios::Monitoring::Plugin
cpan Nagios::Monitoring::Plugin
Reading '/root/.cpan/Metadata'
Database was generated on Tue, 18 Jun 2019 17:17:03 GMT
Nagios::Monitoring::Plugin is up to date (0.51).


then running
./mysql_health_check.pl
Can't locate Nagios/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 ./mysql_health_check.pl line 37.
BEGIN failed--compilation aborted at ./mysql_health_check.pl line 37.

When I try to find it on the system
find / -name Plugins.pm

nothing is found ???
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: perl plugins fail - can't proper install perl-nagios-plu

Post by scottwilkerson »

You need to modify the plugin by running the following

Code: Select all

sed -i 's/Nagios::Plugin/Nagios::Monitoring::Plugin/g' mysql_health_check.pl
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: perl plugins fail - can't proper install perl-nagios-plu

Post by gmills »

thank you!!!

geese, yeah, boy, I should have caught that. thank you so much!

This worked! Please close this ticket as RESOLVED

kind regards,
Gary Mills
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: perl plugins fail - can't proper install perl-nagios-plu

Post by scottwilkerson »

gmills wrote:thank you!!!

geese, yeah, boy, I should have caught that. thank you so much!

This worked! Please close this ticket as RESOLVED

kind regards,
Gary Mills
Great!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked