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

check_sql_query

Rating
0 votes
Favoured:
0
Hits
126451
Files:
FileDescription
check_sql_query.txtcheck_sql_query nagios plugin

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

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