check_log2.pl perl module
Marc Powell
marc at ena.com
Fri Mar 24 16:59:05 CET 2006
> -----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=lnk&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
More information about the Users
mailing list