[-]
[+]
|
Added |
nagios-plugins-oracle.changes
|
|
[-]
[+]
|
Changed |
nagios-plugins-oracle.spec
^
|
|
[-]
[+]
|
Changed |
check_oracle_health-1.6.9.tar.bz2/ChangeLog
^
|
@@ -2,6 +2,11 @@
# Changelog of the check_oracle_health plugin #
###############################################
+1.6.9 - 2011-06-16
+- sites in an OMD (http://omdistro.org) environment have now private statefile directories
+- add mode session-usage, process-usage, rman-backup-problems, corrupted-blocks (Thanks Ovidiu Marcu)
+-add mode datafiles-created (Thanks Ovidiu Marcu)
+
1.6.8.1 - 2011-01-08
- Workaround for the windows version which cleans up leftover spool files which cannot be deleted.
|
[-]
[+]
|
Changed |
check_oracle_health-1.6.9.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.6.8.1.
+# Generated by GNU Autoconf 2.59 for check_oracle_health 1.6.9.
#
# 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.6.8.1'
-PACKAGE_STRING='check_oracle_health 1.6.8.1'
+PACKAGE_VERSION='1.6.9'
+PACKAGE_STRING='check_oracle_health 1.6.9'
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.6.8.1 to adapt to many kinds of systems.
+\`configure' configures check_oracle_health 1.6.9 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.6.8.1:";;
+ short | recursive ) echo "Configuration of check_oracle_health 1.6.9:";;
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.6.8.1
+check_oracle_health configure 1.6.9
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.6.8.1, which was
+It was created by check_oracle_health $as_me 1.6.9, 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.6.8.1'
+ VERSION='1.6.9'
cat >>confdefs.h <<_ACEOF
@@ -2725,7 +2725,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by check_oracle_health $as_me 1.6.8.1, which was
+This file was extended by check_oracle_health $as_me 1.6.9, 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.6.8.1
+check_oracle_health config.status 1.6.9
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
[-]
[+]
|
Changed |
check_oracle_health-1.6.9.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.6.8.1)
+AC_INIT(check_oracle_health,1.6.9)
AM_INIT_AUTOMAKE([1.9 tar-pax])
AC_CANONICAL_HOST
|
[-]
[+]
|
Changed |
check_oracle_health-1.6.9.tar.bz2/plugins-scripts/Nagios/DBD/Oracle/Server.pm
^
|
@@ -537,6 +537,9 @@
$self->add_nagios($ERRORS{CRITICAL},
sprintf "connection could not be established within %d seconds",
$self->{timeout});
+ } elsif ($self->{handle}->{errstr} =~ /specify/) {
+ $self->add_nagios($ERRORS{CRITICAL}, $self->{handle}->{errstr});
+ $retval = undef;
} else {
if ($self->{connect} =~ /^(.*?)\/(.*)@(.*)$/) {
$self->{connect} = sprintf "%s/***@%s", $1, $3;
@@ -610,7 +613,18 @@
$mode =~ s/::/_/g;
$params{statefilesdir} = $self->system_vartmpdir();
}
- mkdir $params{statefilesdir} unless -d $params{statefilesdir};
+ if (! -d $params{statefilesdir}) {
+ eval {
+ use File::Path;
+ mkpath $params{statefilesdir};
+ };
+ }
+ if ($@ || ! -w $params{statefilesdir}) {
+ $self->add_nagios($ERRORS{CRITICAL},
+ sprintf "statefilesdir %s does not exist or is not writable\n",
+ $params{statefilesdir});
+ return;
+ }
my $statefile = sprintf "%s/%s_%s",
$params{statefilesdir}, $params{connect}, $mode;
$extension .= $params{differenciator} ? "_".$params{differenciator} : "";
|
[-]
[+]
|
Changed |
check_oracle_health-1.6.9.tar.bz2/plugins-scripts/Nagios/DBD/Oracle/Server/Database.pm
^
|
@@ -21,7 +21,10 @@
invalid_registry_components => undef,
},
staleobjects => undef,
+ corruptedblocks => undef,
tablespaces => [],
+ num_datafiles => undef,
+ num_datafiles_max => undef,
};
bless $self, $class;
$self->init(%params);
@@ -52,6 +55,19 @@
$self->init_invalid_objects(%params);
} elsif ($params{mode} =~ /server::database::stalestats/) {
$self->init_stale_objects(%params);
+ } elsif ($params{mode} =~ /server::database::blockcorruption/) {
+ $self->init_corrupted_blocks(%params);
+ } elsif ($params{mode} =~ /server::database::datafilesexisting/) {
+ $self->{num_datafiles_max} = $self->{handle}->fetchrow_array(q{
+ SELECT value FROM v$system_parameter WHERE name = 'db_files'
+ });
+ $self->{num_datafiles} = $self->{handle}->fetchrow_array(q{
+ SELECT COUNT(*) FROM sys.dba_data_files
+ });
+ if (! defined $self->{num_datafiles_max} ||
+ ! defined $self->{num_datafiles}) {
+ $self->add_nagios_critical("unable to get number of datafiles");
+ }
}
}
@@ -132,6 +148,18 @@
}
}
+sub init_corrupted_blocks {
+ my $self = shift;
+ my %params = @_;
+ $self->{corruptedblocks} = $self->{handle}->fetchrow_array(q{
+ SELECT COUNT(*) FROM v$database_block_corruption
+ });
+ if (! defined $self->{corruptedblocks}) {
+ $self->add_nagios_critical("unable to get corrupted blocks");
+ return undef;
+ }
+}
+
sub nagios {
my $self = shift;
my %params = @_;
@@ -192,6 +220,28 @@
$self->add_perfdata(sprintf "stale_stats_objects=%d;%s;%s",
$self->{staleobjects},
$self->{warningrange}, $self->{criticalrange});
+ } elsif ($params{mode} =~ /server::database::blockcorruption/) {
+ $self->add_nagios(
+ $self->check_thresholds($self->{corruptedblocks}, "1", "10"),
+ sprintf "%d database blocks are corrupted", $self->{corruptedblocks});
+ $self->add_perfdata(sprintf "corrupted_blocks=%d;%s;%s",
+ $self->{corruptedblocks},
+ $self->{warningrange}, $self->{criticalrange});
+ } elsif ($params{mode} =~ /server::database::datafilesexisting/) {
+ my $datafile_usage = $self->{num_datafiles} /
+ $self->{num_datafiles_max} * 100;
+ $self->add_nagios(
+ $self->check_thresholds($datafile_usage, "80", "90"),
+ sprintf "you have %.2f%% of max possible datafiles (%d of %d max)",
+ $datafile_usage, $self->{num_datafiles}, $self->{num_datafiles_max});
+ $self->add_perfdata(sprintf "datafiles_pct=%.2f%%;%s;%s",
+ $datafile_usage,
+ $self->{warningrange}, $self->{criticalrange});
+ $self->add_perfdata(sprintf "datafiles_num=%d;%s;%s;0;%d",
+ $self->{num_datafiles},
+ $self->{num_datafiles_max} / 100 * $self->{warningrange},
+ $self->{num_datafiles_max} / 100 * $self->{criticalrange},
+ $self->{num_datafiles_max});
}
}
}
|
[-]
[+]
|
Changed |
check_oracle_health-1.6.9.tar.bz2/plugins-scripts/Nagios/DBD/Oracle/Server/Instance.pm
^
|
@@ -60,6 +60,23 @@
$self->{connected_users} = $self->{handle}->fetchrow_array(q{
SELECT COUNT(*) FROM v$session WHERE type = 'USER'
});
+ } elsif ($params{mode} =~ /server::instance::rman::backup::problems/) {
+ $self->{rman_backup_problems} = $self->{handle}->fetchrow_array(q{
+ SELECT COUNT(*) FROM v$rman_status WHERE status != 'COMPLETED'
+ AND
+ status != 'RUNNING'
+ AND start_time > sysdate-3
+ });
+ } elsif ($params{mode} =~ /server::instance::sessionusage/) {
+ $self->{session_usage} = $self->{handle}->fetchrow_array(q{
+ SELECT current_utilization/limit_value*100
+ FROM v$resource_limit WHERE resource_name LIKE '%sessions%'
+ });
+ } elsif ($params{mode} =~ /server::instance::processusage/) {
+ $self->{process_usage} = $self->{handle}->fetchrow_array(q{
+ SELECT current_utilization/limit_value*100
+ FROM v$resource_limit WHERE resource_name LIKE '%processes%'
+ });
}
}
@@ -119,6 +136,30 @@
$self->add_perfdata(sprintf "connected_users=%d;%d;%d",
$self->{connected_users},
$self->{warningrange}, $self->{criticalrange});
+ } elsif ($params{mode} =~ /server::instance::rman::backup::problems/) {
+ $self->add_nagios(
+ $self->check_thresholds($self->{rman_backup_problems}, 1, 2),
+ sprintf "rman had %d problems during the last 3 days",
+ $self->{rman_backup_problems});
+ $self->add_perfdata(sprintf "rman_backup_problems=%d;%d;%d",
+ $self->{rman_backup_problems},
+ $self->{warningrange}, $self->{criticalrange});
+ } elsif ($params{mode} =~ /server::instance::sessionusage/) {
+ $self->add_nagios(
+ $self->check_thresholds($self->{session_usage}, 80, 100),
+ sprintf "%.2f%% of session resources used",
+ $self->{session_usage});
+ $self->add_perfdata(sprintf "session_usage=%.2f%%;%d;%d",
+ $self->{session_usage},
+ $self->{warningrange}, $self->{criticalrange});
+ } elsif ($params{mode} =~ /server::instance::processusage/) {
+ $self->add_nagios(
+ $self->check_thresholds($self->{process_usage}, 80, 100),
+ sprintf "%.2f%% of process resources used",
+ $self->{process_usage});
+ $self->add_perfdata(sprintf "process_usage=%.2f%%;%d;%d",
+ $self->{process_usage},
+ $self->{warningrange}, $self->{criticalrange});
}
}
|
[-]
[+]
|
Changed |
check_oracle_health-1.6.9.tar.bz2/plugins-scripts/check_oracle_health.pl
^
|
@@ -39,6 +39,15 @@
['server::instance::connectedusers',
'connected-users', undef,
'Number of currently connected users' ],
+ ['server::instance::sessionusage',
+ 'session-usage', undef,
+ 'Percentage of sessions used' ],
+ ['server::instance::processusage',
+ 'process-usage', undef,
+ 'Percentage of processes used' ],
+ ['server::instance::rman::backup::problems',
+ 'rman-backup-problems', undef,
+ 'Number of rman backup errors during the last 3 days' ],
['server::instance::sga::databuffer::hitratio',
'sga-data-buffer-hit-ratio', undef,
'Data Buffer Cache Hit Ratio' ],
@@ -66,6 +75,9 @@
['server::database::stalestats',
'stale-statistics', undef,
'Find objects with stale optimizer statistics' ],
+ ['server::database::blockcorruption',
+ 'corrupted-blocks', undef,
+ 'Number of corrupted blocks in database' ],
['server::database::tablespace::usage',
'tablespace-usage', undef,
'Used space in tablespaces' ],
@@ -87,6 +99,9 @@
['server::database::tablespace::datafile::iotraffic',
'datafile-io-traffic', undef,
'io operations/per sec of a datafile' ],
+ ['server::database::datafilesexisting',
+ 'datafiles-existing', undef,
+ 'Percentage of the maximum possible number of datafiles' ],
['server::instance::sga::sharedpool::softparse',
'soft-parse-ratio', undef,
'Percentage of soft parses' ],
@@ -328,6 +343,7 @@
"units=s",
"ident",
"3",
+ "statefilesdir=s",
"with-mymodules-dyn-dir=s",
"report=s",
"extra-opts:s");
@@ -482,6 +498,14 @@
system("/bin/sh");
}
+if (! exists $commandline{statefilesdir}) {
+ if (exists $ENV{OMD_ROOT}) {
+ $commandline{statefilesdir} = $ENV{OMD_ROOT}."/var/tmp/check_oracle_health";
+ } else {
+ $commandline{statefilesdir} = $STATEFILESDIR;
+ }
+}
+
if (exists $commandline{name}) {
# objects can be encoded like an url
# with s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
@@ -559,7 +583,7 @@
name2 => $commandline{name2} || $commandline{name},
units => $commandline{units},
eyecandy => $commandline{eyecandy},
- statefilesdir => $STATEFILESDIR,
+ statefilesdir => $commandline{statefilesdir},
ident => $commandline{ident},
verbose => $commandline{verbose},
report => $commandline{report},
|