checkmk-plugins/check_mk-mysql_open_files/agents/plugins/mysql_open_files

17 lines
491 B
Plaintext
Raw Normal View History

2019-08-12 11:59:29 +03:00
#!/bin/bash
# SpearHead Systems george.mocanu@sphs.ro 2015
# Check_MK plugin for monitoring mysql open_files
# Get mysqld pid number
mysqlPid=`pidof mysqld`
# Count files currently opened by mysql
mysqlOpenFiles=`ls -las /proc/$mysqlPid/fd/ | wc -l`
# Get current open_files_limit value
mysqlOpenFilesLimit=`cat /proc/$mysqlPid/limits | grep 'Max\ open\ files' | awk '{print $4}'`
# Check output
echo '<<<mysql_open_files>>>'
echo 'open_files ' $mysqlOpenFilesLimit ' ' $mysqlOpenFiles