how does nagios call service

Tao Yaoning yonienjcn at gmail.com
Thu Oct 13 14:11:23 CEST 2005


It works now, Thanks


> Is this your own Perl script?
> Does this perl script use warnings, and load the 'strict' module?
> ie:
>
> #!/usr/bin/perl *-w*
> *use strict;*
> ..rest of script..
>
> I suspect that you have not enabled Strict mode in your script, and have
> not given the -w (warning) flag to perl..
>
> What if you run 'perl -w -c <scriptname>' does it warn you about the same
> errors?
>
> You should be defining your variables with 'my' or 'our' functions at the
> beginning of your script.
>
> The embedded perl interpereter in Nagios probably is using the good coding
> practices of using warnings and strict code checking, which is why you are
> seeing these errors.
>
> Review your script, change the lines
>
> $script = "check_snmp_apcups";
> $script_version = "2.1.0";
>
> to
>
> *my *$script = "check_snmp_apcups";
> *my *$script_version = "2.1.0";
>
> And all subsequent variables, and you shouldn't receive any warnings. The
> warnings are telling you that you aren't defining your variables. Define the
> variables and there will be no warnings.
>
> Cheers
> rob
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051013/b2b1559c/attachment.html>


More information about the Users mailing list