Can’t locate Perl module File/Slurp.pm in Opsview 5.2.1.163061249

I’ve been seeing these errors in our Opsview 5.2.1.163061249 installation:

Can't locate File/Slurp.pm in @INC (@INC contains: /usr/local/nagios/bin/../lib /usr/local/nagios/bin/../etc /usr/local/nagios/bin/../perl/lib /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/nagios/bin/../lib/Opsview/Run.pm line 23.

These errors were generated by one particular crontab job:

/usr/local/nagios/bin/exec_and_log

I was able to install File::Slurp module through yum…

yum install -y perl-File-Slurp.noarch

Then, it’s asking for another module… “IPC::Run”

yum install -y perl-IPC-Run.noarch

Then, it’s asking for another module… “IPC::Run::SafeHandles”. But since there are no RPM packages for this, I am forced to do this the perl way… CPAN.

yum install -y perl-CPAN.x86_64

And then installed cpanm right after (as recommended here)

cpan App::cpanminus

Retrying the installation of “IPC::Run::SafeHandles”

cpanm IPC::Run::SafeHandles

Then, I’m stuck… The module IPC::Run::SafeHandles won’t install because it requires “List::MoreUtils::XS”. Which I cannot install because of an error with this unhelpful message:
Screen Shot 2017-08-23 at 1.41.54 PM

I did a few a google search about the module and I stumbled on this exciting discussion.

Hmmmm…. PUREPERL… maybe I need to invoke this via cpanm. Browsing through cpanm’s manual, it has a a –pp option for pure Perl.

cpanm --pp IPC::Run::SafeHandles

It installed without a hitch! 🙂

But as for the Opsview script, it still required 2 more modules:

yum install perl-Proc-Simple
yum install perl-Log-Log4perl

Now I have to find out what caused these Perl modules to be gone missing in the first place…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s