uHOWTO: Force script recompilation in embedded Perl Nagios

nagiosI just implemented elwell’s notify_via_jabber and it did not work at first. I got the following message in nagios.log:

[1237223883] **ePN failed to compile /usr/local/bin/notify_via_jabber: "Can’t locate Net/XMPP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/sh
are/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at (eval 1) line 14,
BEGIN failed–compilatio" at /usr/lib/nagios2/p1.pl line 157.

I promptly apt-get installed libnet-xmpp-perl but the problem persisted — with the exact same error message. But Net::XMPP was now there!!
Well it happens that Embedded Perl Nagios (ePN) caches the compiled script and does not try to recompile it until its timestamp changes. So I touched(1) the script and this time the dependency was resolved correctly and the script was compiled sucessfully.

# touch /usr/local/bin/notify_via_jabber

This is probably documented somewhere, but I could not find any reference to this kind of problem with Nagios cached scripts so I tought I would share this simple recipe.

Posted in General