Home Directory Plugins Databases check_mysql_query.pl (Advanced Nagios Plugins Collection)

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_mysql_query.pl (Advanced Nagios Plugins Collection) Popular

Rating
1 vote
Favoured:
0
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
Hits
788707
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!
Checks MySQL arbitrary queries against regex matches or numerical ranges, with perfdata support. Obsoleted so many of my custom MySQL related checks, one of my all time favourite plugins!
Part of the Advanced Nagios Plugins Collection, download it here:

https://github.com/harisekhon/nagios-plugins

./check_mysql_query.pl --help

Nagios Plugin to check MySQL arbitrary queries against regex matches or numerical ranges, with perfdata support

usage: check_mysql_query.pl [ options ]

-H --host MySQL Host
-P --port MySQL Port
-u --user MySQL user
-p --password MySQL password
-d --database MySQL database
-q --query MySQL query to execute
-f --field Field number/name to check the results of (defaults to '1')
-e --epoch Subtract result from current time in epoch format from result (useful for timestamp based comparisons)
-m --message Message to output after result. Can take a printf string with a single substitution (defaults to 'query returned')
-n --message-prepend Display message before rather than after result (prepend)
-o --output Exact output to expect
-r --regex Regex to match the result against
-w --warning Warning threshold or ran:ge (inclusive)
-c --critical Critical threshold or ran:ge (inclusive)
-g --graph Perfdata output for graphing
-l --label Perfdata label. If not specified uses field name or Undefined if field name doesn't match a known regex of chars
-U --units Units of measurement for graphing output (%/s/ms/us/B/KB/MB/TB/c)
-s --short Shorten output, do not output message just result
--no-querytime Do not output the mysql query time
-h --help Print description and usage options
-t --timeout Timeout in secs (default: 10)
-v --verbose Verbose mode
-V --version Print version and exit
Reviews (1)
Support for the --extra-opts argument, such as the following would mean that credentials could be easily hidden from the nrpe processes.

--extra-opts=mysql@/home/nrpe/.plugins.ini