In the process of installing Monarch, which is a Nagios file manager, earlier I ran into a couple errors for modules I thought I had already installed. Then I realized the issue must be because during the process of installing modules Perl wanted to upgrade from 5.8 to 5.10 on CentOS. I went ahead and upgraded Perl however I left 5.8.8 intact since CentOS seems to rely on Perl 5.8.8 in many ways. Anyhow the full error I received is below as noted from the Apache error logs. You can easily resolve the below error by following the directions below.
Apache Error Logs Displaying Perl URI Module Error:
- [Wed Jan 27 22:01:58 2010] [error] [client 192.168.2.35] Can't locate URI/Escape.pm in @INC (@INC contains: /usr/share/nagios/monarch/lib /usr/local/lib/perl5/5.10.1/i686-linux /usr/local/lib/perl5/5.10.1 /usr/local/lib/perl5/site_perl/5.10.1/i686-linux /usr/local/lib/perl5/site_perl/5.10.1 .) at /usr/share/nagios/monarch/lib/MonarchForms.pm line 2159.
- [Wed Jan 27 22:01:58 2010] [error] [client 192.168.2.35] BEGIN failed--compilation aborted at /usr/share/nagios/monarch/lib/MonarchForms.pm line 2159.
- [Wed Jan 27 22:01:58 2010] [error] [client 192.168.2.35] Compilation failed in require at /usr/share/nagios/cgi-bin/monarch.cgi line 31.
- [Wed Jan 27 22:01:58 2010] [error] [client 192.168.2.35] BEGIN failed--compilation aborted at /usr/share/nagios/cgi-bin/monarch.cgi line 31.
- [Wed Jan 27 22:01:58 2010] [error] [client 192.168.2.35] Premature end of script headers: monarch.cgi
To resolve this issue launch Perl’s CPAN using the syntax below.
Launch Perl CPAN:
- [root@server ~]# perl -MCPAN -e shell
Once CPAN launches issue the below command from the CPAN shell to install the URI/Escape Perl module.
Install Perl URI/Escape Module:
- cpan> install URI::Escape
Once the module is installed you will no longer receive the error above in the Apache logs.