Home Directory Plugins Databases MySQL check_tablespace_mysql

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_tablespace_mysql

Rating
5 votes
Favoured:
1
Current Version
1.0
Last Release Date
2010-02-09
Compatible With
  • Nagios 3.x
  • Nagios 4.x
License
GPL
Hits
109214
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!
check_tablespace_mysql
This plugin checks the tablespace size of a specific MySQL Server database against WARN and CRIT thresholds. It returns the current tablespace size and the number of data files belonging to this database. The plugin can be called in 'reporting' mode, returning the space values withouth checking against a threshold. This is helpful if the tablespace only needs to be graphed as a trend over time.
The plugin requires the database to be set up for accepting network connections and being reachable through that network port from the Nagios server. The plugin uses the MySQL JDBC driver, this driver must be installed and found through the Java classpath on the server executing this plugin. For more information, please see the manual page for this plugin at:

http://nagios.fm4dd.com/plugins/manual/check_tablespace_mysql.htm

MySQL table space handling depends on the configured storage engine, default is MyISAM. For more information see http://www.fm4dd.com/howto/db-monitoring.htm
Reviews (4)
BUT i have a problem, our tablespace are big and i think i've hit the maximum. higher, i get a java error.

this is warning, or the number maximum allowed for a check 2147483647

java -classpath /usr/lib64/nagios/plugins/ check_tablespace_mysql localhost 3306 databasename "user id" "password" 2147483647 270000000

is ok but if i change the warning and add1 byte, 2147483648 produce error message

java -classpath /usr/lib64/nagios/plugins/ check_tablespace_mysql localhost 3306 databasename "user id" "password" 2147483648 270000000

Exception in thread "main" java.lang.NumberFormatException: For input string: "2147483648"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:499)
at java.lang.Integer.parseInt(Integer.java:527)
at check_tablespace_mysql.main(check_tablespace_mysql.java:74)

what can i change on the java code to make this working ?
byshashi_sid, December 9, 2014
0 of 1 people found this review helpful
First of all Thanks for this great tool.

/usr/bin/java -classpath /usr/local/nagios/libexec/ check_tablespace_mysql 3306 "Nagios" "Nagios@123" -d

Output - Tablespace OK: 18048 KBytes

I got the below error.

2014-12-10 03:20:27 [1974] [2] No pattern match in function _parse(: 546 datafiles. 18048 KB )
2014-12-10 03:20:27 [1974] [1] Invalid Perfdata detected



Is there some pnp4nagios template for this plugin as well?
byTontonitch, October 11, 2012
0 of 1 people found this review helpful
Hi,
Nice plugin, useful for db size tracking
A small fix for monitoring mysql 5.0 and 5.1:
change 'round (' to 'round(' (without the space) to avoid the "round function does not exist" message. (generally avoid the space when using functions)
An enhancement could also be to follow the plugin development guidelines for the performance data output.
Regards,
Yannick
byjpcozar, August 2, 2011
0 of 1 people found this review helpful
Exactly, it was what I was looking for. It works really as expected. Thank you so much!