[-]
[+]
|
Changed |
nagios-plugins-oracle.changes
|
|
[-]
[+]
|
Changed |
nagios-plugins-oracle.spec
^
|
|
[-]
[+]
|
Changed |
check_oracle_health-1.7.3.tar.bz2/ChangeLog
^
|
@@ -2,6 +2,10 @@
# Changelog of the check_oracle_health plugin #
###############################################
+1.7.3 - 2011 09-29
+- mode sql now correctly handles dml sql errors like missing tables etc.
+- single ticks around the --name argument under Windows CMD will be removed automatically
+
1.7.2 - 2011-09-21
- add mode sga-library-cache-pinhit-ratio
- sga-library-cache-hit-ratio becomes sga-library-cache-gethit-ratio
|
[-]
[+]
|
Changed |
check_oracle_health-1.7.3.tar.bz2/configure
^
|
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for check_oracle_health 1.7.2.
+# Generated by GNU Autoconf 2.59 for check_oracle_health 1.7.3.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@@ -268,8 +268,8 @@
# Identity of this package.
PACKAGE_NAME='check_oracle_health'
PACKAGE_TARNAME='check_oracle_health'
-PACKAGE_VERSION='1.7.2'
-PACKAGE_STRING='check_oracle_health 1.7.2'
+PACKAGE_VERSION='1.7.3'
+PACKAGE_STRING='check_oracle_health 1.7.3'
PACKAGE_BUGREPORT=''
ac_default_prefix=/usr/local/nagios
@@ -722,7 +722,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures check_oracle_health 1.7.2 to adapt to many kinds of systems.
+\`configure' configures check_oracle_health 1.7.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -788,7 +788,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of check_oracle_health 1.7.2:";;
+ short | recursive ) echo "Configuration of check_oracle_health 1.7.3:";;
esac
cat <<\_ACEOF
@@ -897,7 +897,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-check_oracle_health configure 1.7.2
+check_oracle_health configure 1.7.3
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -911,7 +911,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by check_oracle_health $as_me 1.7.2, which was
+It was created by check_oracle_health $as_me 1.7.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1554,7 +1554,7 @@
# Define the identity of the package.
PACKAGE='check_oracle_health'
- VERSION='1.7.2'
+ VERSION='1.7.3'
cat >>confdefs.h <<_ACEOF
@@ -2725,7 +2725,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by check_oracle_health $as_me 1.7.2, which was
+This file was extended by check_oracle_health $as_me 1.7.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -2780,7 +2780,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-check_oracle_health config.status 1.7.2
+check_oracle_health config.status 1.7.3
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
[-]
[+]
|
Changed |
check_oracle_health-1.7.3.tar.bz2/configure.in
^
|
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_REVISION ($Revision: 1.150 $)
AC_PREREQ(2.58)
-AC_INIT(check_oracle_health,1.7.2)
+AC_INIT(check_oracle_health,1.7.3)
AM_INIT_AUTOMAKE([1.9 tar-pax])
AC_CANONICAL_HOST
|
[-]
[+]
|
Changed |
check_oracle_health-1.7.3.tar.bz2/plugins-scripts/Nagios/DBD/Oracle/Server.pm
^
|
@@ -119,7 +119,8 @@
$self->{handle}->fetchrow_array($params{selectname});
if (! defined $self->{genericsql}) {
$self->add_nagios_unknown(sprintf "got no valid response for %s",
- $params{selectname});
+ $params{selectname}.($self->{handle}->{errstr} ?
+ " - ".$self->{handle}->{errstr} : ""));
}
}
} else {
@@ -127,10 +128,12 @@
@{$self->{genericsql}} =
$self->{handle}->fetchrow_array($params{selectname});
if (! (defined $self->{genericsql} &&
+ scalar(@{$self->{genericsql}}) &&
(scalar(grep { /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/ } @{$self->{genericsql}})) ==
scalar(@{$self->{genericsql}}))) {
$self->add_nagios_unknown(sprintf "got no valid response for %s",
- $params{selectname});
+ $params{selectname}.($self->{handle}->{errstr} ?
+ " - ".$self->{handle}->{errstr} : ""));
} else {
# name2 in array
# units in array
@@ -1039,6 +1042,8 @@
};
if ($@) {
$self->debug(sprintf "bumm %s", $@);
+ $self->debug(sprintf "bumm %s", $self->{handle}->errstr());
+ $self->{errstr} = $self->{handle}->errstr();
}
$self->trace(sprintf "RESULT:\n%s\n",
Data::Dumper::Dumper(\@row));
@@ -1436,10 +1441,27 @@
# This so-called "best practice" leaves an open filehandle under windows
# my $output = do { local (@ARGV, $/) = $self->{sql_resultfile}; <> };
my $output = do { local (@ARGV, $/) = $self->{sql_resultfile}; my $x = <>; close ARGV; $x };
- @row = map { convert($_) }
- map { s/^\s+([\.\d]+)$/$1/g; $_ } # strip leading space from numbers
- map { s/\s+$//g; $_ } # strip trailing space
- split(/\|/, (split(/\n/, $output))[0]);
+ #
+ # SELECT count(*) FROM blah
+ # *
+ # ERROR at line 1:
+ # ORA-00942: table or view does not exist
+ # --> if there is a single * AND ERROR AND ORA then we surely have en error
+ if ($output =~ /^\s+\*[ \*]*$/m &&
+ $output =~ /^ERROR/m &&
+ $output =~/^ORA\-/m) {
+ my @oerrs = map {
+ /(ORA\-\d+:.*)/ ? $1 : ();
+ } split(/\n/, $output);
+ $self->{errstr} = join(" ", @oerrs);
+ } else {
+ if ($output) {
+ @row = map { convert($_) }
+ map { s/^\s+([\.\d]+)$/$1/g; $_ } # strip leading space from numbers
+ map { s/\s+$//g; $_ } # strip trailing space
+ split(/\|/, (split(/\n/, $output))[0]);
+ }
+ }
}
if ($@) {
$self->debug(sprintf "bumm %s", $@);
@@ -1695,6 +1717,9 @@
};
if ($@) {
$self->debug(sprintf "bumm %s", $@);
+ $self->debug(sprintf "bumm %s", $self->{handle}->errstr());
+ # this is useful for mode sql's output
+ $self->{errstr} = $self->{handle}->errstr();
}
$self->trace(sprintf "RESULT:\n%s\n",
Data::Dumper::Dumper(\@row));
|
[-]
[+]
|
Changed |
check_oracle_health-1.7.3.tar.bz2/plugins-scripts/check_oracle_health.pl
^
|
@@ -522,6 +522,11 @@
}
if (exists $commandline{name}) {
+ if ($^O =~ /MSWin/ && $commandline{name} =~ /^'(.*)'$/) {
+ # putting arguments in single ticks under Windows CMD leaves the ' intact
+ # we remove them
+ $commandline{name} = $1;
+ }
# objects can be encoded like an url
# with s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
if (($commandline{mode} ne "sql") ||
|