Mount Point Monitoring --Base class package "Class::Accessor

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
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Mount Point Monitoring --Base class package "Class::Accessor

Post by amitgupta19 »

I have downloaded the Script check_mountpoint.pl

But when i run the command:
sudo ./check_mountpoint.pl -m /test-mount

It is giving the following error:
==================================================================================
Base class package "Class::Accessor" 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/share/perl5/Nagios/Plugin/Getopt.pm line 13.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Nagios/Plugin/Getopt.pm line 13.
Compilation failed in require at ./check_mountpoint.pl line 15.
BEGIN failed--compilation aborted at ./check_mountpoint.pl line 15.
====================================================================================

Can anyone guide me here how to remove the above error?
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Mount Point Monitoring --Base class package "Class::Acce

Post by amitgupta19 »

Can anyone guide me here?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Mount Point Monitoring --Base class package "Class::Acce

Post by tgriep »

There are a couple of different versions of that plugin but it looks like the required perl modules are not installed on your system.

Run the following as root to install them.

Code: Select all

cpan -i Nagios::Plugin::Getopt
cpan -i Nagios::Plugin
If the plugin still fails, post it here so we can view it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Mount Point Monitoring --Base class package "Class::Acce

Post by gormank »

It might be better to avoid CPAN if possible and use rpm, yum (or apt-get if I recall in Debian). Perl packages that are available are often preceded w/ prl- like so:

yum install perl-nagios-plugin-getopt

or similar would replace the following if it exists.

cpan -i Nagios::Plugin::Getopt

It may require some searching to find packages.

yum list | grep -i perl | grep -i getopt

for example...

CPAN has no remove or some other features of yum/rpm.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Mount Point Monitoring --Base class package "Class::Acce

Post by ssax »

I don't think the Nagios Plugin Getopt package isn't out there in the main repos but perl-Nagios-Plugin should be.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Mount Point Monitoring --Base class package "Class::Acce

Post by amitgupta19 »

I resolved it there were lot of packages were missing.

One After Another, i had to install the multiple packages.

Is there a way to avoid such situations, so that i do not get into such situations again.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Mount Point Monitoring --Base class package "Class::Acce

Post by ssax »

Is there a way to avoid such situations, so that i do not get into such situations again.
Unfortunately not, we didn't write the plugin and each plugin has its own requirements that we/you won't know unless you read the plugins documentation (if they list it)/looking at plugin source code OR by doing what you did (which is the same way I do it).

Thank you
Locked