监控mysql server的性能,在cacti上内估计很多人都是用mysql-cacti-templates模板吧,但是它默认的配置只支持标准mysql 3306端口的监控。
其实它的脚本是已经支持多端口的,只是模板内的配置默认不支持而已。脚本的参数如下:
Usage: php ss_get_mysql_stats.php --host --items [OPTION]
--host Hostname to connect to; use host:port syntax to specify a port
Use :/path/to/socket if you want to connect via a UNIX socket
--items Comma-separated list of the items whose data you want
--user MySQL username; defaults to root if not given
--pass MySQL password; defaults to 5MebCCNrzdPYpx3L if not given
--heartbeat MySQL heartbeat table; defaults to '' (see mk-heartbeat)
--nocache Do not cache results in a file
--port MySQL port; defaults to 3306 if not given
--mysql_ssl Add the MYSQL_CLIENT_SSL flag to mysql_connect() call
阅读全文