check_log2.pl perl module

Terry L. Inzauro tinzauro at ha-solutions.net
Fri Mar 24 17:11:32 CET 2006


Marc Powell wrote:
> 
>> -----Original Message-----
>> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
>> admin at lists.sourceforge.net] On Behalf Of Terry L. Inzauro
>> Sent: Friday, March 24, 2006 8:43 AM
>> To: Terry L. Inzauro
>> Cc: nagios-users at lists.sourceforge.net
>> Subject: Re: [Nagios-users] check_log2.pl perl module
>>
>> Terry L. Inzauro wrote:
>>> folks,
>>>
>>> the check_log2.pl script is calling for the util.pm perl module.  i
> saw
>>> it in the contrib directory, but it isn't using it properly or can't
>>> find it.  is that the correct module to use, or is there a cpan
> module
>>> out there that i should grab.
>>>
>>> also, does the /path/to/contrib directory need to be in @INC?
>>>
>>>
>>> best regards,
>>>
>>>
>>> _Terry
>>>
> 
> 
>> so, i added  BEGIN{unshift @INC, "/usr/nagios/libexec"} to
> check_log2.pl
>> to append the location of utils.pm module to @INC and it works,
> however i
>> get
>> the following warnings.
> 
> Check_log2.pl is expecting to be in/run from the libexec directory with
> the other plugins. Move it there and you won't need this line.
>  
>> jenna contrib # ./check_log2.pl -l /var/log/messages -s /tmp/seekfile
> -p
>> error
>> Name "main::blocks" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::mode" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::uid" used only once: possible typo at ./check_log2.pl line
>> 115.
>> Name "main::dev" used only once: possible typo at ./check_log2.pl line
>> 115.
>> Name "main::atime" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::gid" used only once: possible typo at ./check_log2.pl line
>> 115.
>> Name "main::blksize" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::ctime" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::rdev" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::mtime" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::nlink" used only once: possible typo at ./check_log2.pl
> line
>> 115.
>> Name "main::ino" used only once: possible typo at ./check_log2.pl line
>> 115.
>> OK - No matches found.
>> jenna contrib #
>>
>>
>> i'm a novice perl coder and would love to troubleshoot, but my skillz
> are
>> not worthy ;)
>>
>> Thoughts?
> 
> 1) Always run your tests as the nagios user.
> 
> 2) They're harmless notices sent to STDERR, not STDOUT so nagios
> wouldn't ever seen them but you shouldn't be seeing them either with an
> unmodified plugin.
> 
> 3) What version of the plugins are you using? I don't see these with 1.4
> --
> 
> [nagios at noctools libexec]$ ./check_log2.pl -l /var/log/messages -s
> /tmp/seekfile -p Error
> OK - No matches found.
> 
> 4) Did you modify the shebang line in the script to turn on syntax
> checks (i.e. #!/usr/bin/perl -cw). I can reproduce your results if I do
> that --
> 
> [nagios at noctools libexec]$ head -1 ./check_log2.pl 
> #!/usr/bin/perl -cw
> 
> [nagios at noctools libexec]$ ./check_log2.pl -l /var/log/messages -s
> /tmp/seekfile -p Error
> Name "main::blocks" used only once: possible typo at ./check_log2.pl
> line 111.
> Name "main::mode" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::uid" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::dev" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::atime" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::gid" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::blksize" used only once: possible typo at ./check_log2.pl
> line 111.
> Name "main::ctime" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::rdev" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::mtime" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::nlink" used only once: possible typo at ./check_log2.pl line
> 111.
> Name "main::ino" used only once: possible typo at ./check_log2.pl line
> 111.
> ./check_log2.pl syntax OK
> 
> 
> --
> Marc
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null

ok, i modified the shebang and all works without warnings.  thanks a bunch.  but i still haven't fingered out why i need to alter @INC.  see the 
following output.  as you can see "." is in @INC.  you'd think i wouldn't have to explicitly add the full path to get it to work. in any event, i'm ok 
with the small tweak...for now;)


jenna contrib # cd /usr/nagios/libexec/contrib/
jenna contrib # perl -le 'print join("\n", at INC);'
/etc/perl
/usr/lib/perl5/site_perl/5.8.6/i386-linux
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.6/i386-linux
/usr/lib/perl5/5.8.6
/usr/local/lib/site_perl
.
jenna contrib # ./check_log2.pl
Can't locate utils.pm in @INC (@INC contains: . /etc/perl /usr/lib/perl5/site_perl/5.8.6/i386-linux /usr/lib/perl5/site_perl/5.8.6 
/usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i386-linux /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl 
/usr/lib/perl5/5.8.6/i386-linux /usr/lib/perl5/5.8.6 /usr/local/lib/site_perl) at ./check_log2.pl line 65.
BEGIN failed--compilation aborted at ./check_log2.pl line 65.


thank you for your assistance and have a good weekend.




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list