Page 1 of 1

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

Posted: Wed Apr 08, 2020 10:10 am
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?

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

Posted: Thu Apr 09, 2020 2:19 am
by amitgupta19
Can anyone guide me here?

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

Posted: Fri Apr 10, 2020 2:27 pm
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.

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

Posted: Fri Apr 10, 2020 2:56 pm
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.

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

Posted: Fri Apr 10, 2020 4:49 pm
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.

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

Posted: Mon Apr 13, 2020 9:46 am
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.

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

Posted: Mon Apr 13, 2020 4:43 pm
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