Workaround for Getopt errors
Posted: Sun Jun 10, 2012 8:47 pm
Just in case you had as much trouble finding a solution to this as I have....
The embedded Perl in Nagios sometimes passes in "undef" parameters when $ARGx$ strings are left empty in command definitions, and Getopt tries to do a regex match on them before checking for "undef". The workaround is to either make sure to never have undefined-but-referenced $ARGx$ strings, or to add this near the beginning of the Perl script:
Better yet, patch p1.pl to do this.
http://tracker.nagios.org/view.php?id=88
The embedded Perl in Nagios sometimes passes in "undef" parameters when $ARGx$ strings are left empty in command definitions, and Getopt tries to do a regex match on them before checking for "undef". The workaround is to either make sure to never have undefined-but-referenced $ARGx$ strings, or to add this near the beginning of the Perl script:
Code: Select all
# nagios: +epn
# Workaround for Getopt missing-parameter bug
@ARGV = grep defined, @ARGV;http://tracker.nagios.org/view.php?id=88