https://metacpan.org/pod/release/RJBS/p ... arentheses
check_oracle_health works (doesn't fail), but throws this error:
Code: Select all
[Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 4162.
Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 6166.]Code: Select all
sub add_nagios {
my $self = shift;
my $level = shift;
my $message = shift;
push(@{$self->{nagios}->{messages}->{$level}}, $message);
# recalc current level
foreach my $llevel (qw(CRITICAL WARNING UNKNOWN OK)) {
if (scalar(@{$self->{nagios}->{messages}->{$ERRORS{$llevel}}})) {
$self->{nagios_level} = $ERRORS{$llevel};
}
}
}
Code: Select all
if (exists $commandline{runas}) {
# remove the runas parameter
# exec sudo $0 ... the remaining parameters
$needs_restart = 1;
# if the calling script has a path for shared libs and there is no --environment
# parameter then the called script surely needs the variable too.
foreach my $important_env (qw(LD_LIBRARY_PATH SHLIB_PATH
ORACLE_HOME TNS_ADMIN ORA_NLS ORA_NLS33 ORA_NLS10)) {
if ($ENV{$important_env} && ! scalar(grep { /^$important_env=/ }
keys %{$commandline{environment}})) {
$commandline{environment}->{$important_env} = $ENV{$important_env};
printf STDERR "add important --environment %s=%s\n",
$important_env, $ENV{$important_env} if $DBD::Oracle::Server::verbose;
}
}
}