nagios ¼ì²é mysql·þÎñ
http://blog.c1gstudio.com/archives/602
nagios_plugin°²×°Ê±ÕýÈ·¹ØÁªmysqlºó»áÔÚlibexecϲúÉúcheck_mysqlÎļþ
/usr/local/nagios/libexec/check_mysql -h
check_mysql v2034 (nagios-plugins 1.4.13)
Copyright (c) 1999-2007 Nagios Plugin Development Team
<nagiosplug-devel@lists.sourceforge.net>
This program tests connections to a mysql server
Usage: check_mysql [-d database] [-H host] [-P port] [-s socket]
[-u user] [-p password] [-S]
Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
-H, --hostname=ADDRESS
Host name, IP Address, or unix socket (must be an absolute path)
-P, --port=INTEGER
Port number (default: 3306)
-s, --socket=STRING
Use the specified socket (has no effect if -H is used)
-d, --database=STRING
Check database with indicated name
-u, --username=STRING
Connect using the indicated username
-p, --password=STRING
Use the indicated password to authenticate the connection
==> IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!! <==
Your clear-text password could be visible as a process table entry
-S, --check-slave
Check if the slave thread is running properly.
-w, --warning
Exit with WARNING status if slave server is more than INTEGER seconds
behind master
-c, --critical
Exit with CRITICAL status if slave server is more then INTEGER seconds
behind master
There are no required arguments. By default, the local database is checked
using the default unix socket. You can force TCP on localhost by using an
IP
Ïà¹ØÎĵµ£º
×î½üʹÓÃrootÓû§±àдÁ˼¸¸ö´æ´¢¹ý³Ì£¬µ«ÊÇʹÓÃÆÕͨÓû§Í¨¹ýJDBCÁ¬½ÓÖ´ÐÐÈ´±¨´í£º
java.lang.NullPointerException......
»ò
java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with " ......
integer »òÕß int
int »òÕß java.lang.Integer
INTEGER
4 ×Ö½Ú
long
long Long
BIGINT
8 ×Ö½Ú
short
short Short
SMALLINT
2 ×Ö½Ú
byte
byte Byte
TINYINT
1 ×Ö½Ú
float
float Float
FLOAT
4 ×Ö½Ú
double
double Double
DOUBLE
8 ×Ö½Ú
b ......
¡¡ÍøÉÏÓкܶàµÄÎÄÕ½ÌÔõôÅäÖÃMySQL·þÎñÆ÷£¬µ«¿¼Âǵ½·þÎñÆ÷Ó²¼þÅäÖõIJ»Í¬£¬¾ßÌåÓ¦ÓõIJî±ð£¬ÄÇЩÎÄÕµÄ×ö·¨Ö»ÄÜ×÷Ϊ³õ²½ÉèÖòο¼£¬ÎÒÃÇÐèÒª¸ù¾Ý×Ô¼ºµÄÇé¿ö½øÐÐÅäÖÃÓÅ»¯£¬ºÃµÄ×ö·¨ÊÇMySQL·þÎñÆ÷Îȶ¨ÔËÐÐÁËÒ»¶Îʱ¼äºóÔËÐУ¬¸ù¾Ý·þÎñÆ÷µÄ”״̬”½øÐÐÓÅ»¯¡£
mysql> show global status;
¡¡¡¡¿ÉÒÔÁгöMySQL·þÎ ......
ÔÚ֮ǰµÄÎÄÕÂÀÎÒÒѾÌá¹ýÈçºÎ½â¾öJSPÖÐÂÒÂëÎÊÌ⣨½â¾ötomcatÏÂÖÐÎÄÂÒÂëÎÊÌâ £©£¬ÆäÖÐÒ²Ïêϸ½â˵ÁËMYSQLÂÒÂëÎÊÌ⣬ÏàÐÅͨ¹ýÀïÃæµÄ°ì·¨£¬¿Ï¶¨¶¼ÒѾ½â¾öÁËJSPÀïµÄÂÒÂëÎÊÌ⣬²»¹ý»¹ÊÇÓÐЩÈ˵ÄMYSQLÂÒÂëÎÊÌâûÓеõ½½â¾ö£¬°üÀ¨ÎÒ×Ô¼º£¬ËùÒÔÓÖÕÒÁËһЩ×ÊÁÏ£¬Ï£ÍûÕâ´ÎÄÜÍêÈ«½â¾öMYSQLÊý¾Ý¿âµÄÂÒÂëÎÊÌâ¡£
......