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_sql_query

Rating
0 votes
Favoured:
0
Hits
136242
Files:
FileDescription
check_sql_query.txtcheck_sql_query nagios plugin
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
nagios plugin to execute a specific sql query (ksh script)
nagios plugin to execute a specific sql query
author: Sergei Haramundanis 08-Aug-2006

usage: check_sql_query access_file query_file

Description:

This plugin will execute a sql query and report the elapsed time it took for the values to return

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)

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, it will execute the sql query

if the query was successful it will return on OK state with the message:

[OK] successful sql query execution | elapsedTime=##secs

if the query was not successful it will return a CRITICAL state with the message:

[CRITICAL] sql query execution failed db_result | elapsedTime=##secs

query execution failure is determined if any ORA- error is received or if the query returned 0 rows