Home Directory Plugins Databases Oracle check_db_record_count

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_db_record_count

Rating
1 vote
Favoured:
0
Hits
98961
Files:
FileDescription
check_db_record_count.txtcheck_db_record_count 2.1 nagios plugin
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
nagios plugin to check if a query returns a specific count based on a sql query within a specific timeframe (ksh script)
nagios plugin to check if a query returns a specific count based on a sql query within a specific timeframe
author: Sergei Haramundanis 24-Oct-2006

usage: check_db_record_count access_file check_from_time check_to_time query_file max_count

Description:

This plugin will check if a query exceeds a specific count (max_count) at a specific timeframe specified by check_from_time and check_to_time
(in HHMM format) by executing the specified sql query in the query_file

This plugin requires oracle sqlplus (see definition of ORACLE_HOME, PATH and LD_LIBRARY_PATH further on in this script, you may need to
change them)

all fields are required

contents of access_file must contain database connection information in the following format:

USERNAME username
PASSWORD password
CONNECTION_STRING connection_string

contents of query_file must contain sql query information in the following format:

SQL_QUERY specific_sql_query

these are to be used by sqlplus to login to the database and execute the appropriate sql query

Output:

During any run of the plugin, the value returned will be as follows:

if the current time is within the specified timeframe, it will execute the specific sql query

if max_count is exceeded it will return a CRITICAL state with the message:

[CRITICAL] detected n records (max_count # exceeded)

if max_count is not exceeded it will return an OK state with the message:

[OK] detected n record(s) (max_count # not exceeded)

if the current time is outside the specified timeframe it will return an OK state with the message:

[OK] current time outside of monitoring timeframe check_from_time and check_to_time

24-Apr-2007 version 2.1 update includes:
1. support for reporting remedial action
2. exclude running on weekends and holidays
Reviews (1)
byMajed, July 22, 2011
[root@orcl tmp]# ./check_db_record_count.txt
./check_db_record_count.txt[63]: .: ./utils.sh: cannot open [No such file or directory]