I'm running the
check_mysql plugin using NRPE on a remote DB-server, and while I can get satisfactory data on whether or not the server process is working as needed, I see that the plugin outputs a lot more info:
user@server:/etc/nagios# /usr/lib/nagios/plugins/check_mysql -H localhost -P 3306 -u nagios -psnip Uptime: 112398 Threads: 5 Questions: 10921804 Slow queries: 0 Opens: 4408 Flush tables: 1 Open tables: 416 Queries per second avg: 97.170|Connections=137481c;;; Open_files=0;;; Open_tables=416;;; Qcache_free_memory=1031832;;; Qcache_hits=0c;;; Qcache_inserts=0c;;; Qcache_lowmem_prunes=0c;;; Qcache_not_cached=9427651c;;; Qcache_queries_in_cache=0;;; Queries=10921805c;;; Questions=10917613c;;; Table_locks_waited=0c;;; Threads_connected=5;;; Threads_running=1;;; Uptime=112398c;;;
Which makes me think that I can assert on things like the number of threads or slow queries to generate alert states.
The question is, how do I do that? The plugin's
-c parameters only deal with master-slave clock drift, but none of the other parameters.
Do I need to whip up some custom shell script to parse the output then return its own output? Or is there a built in facility in Nagios Core to do that sort of munging?