Your IP : 3.15.144.162


Current Path : /lib64/nagios/plugins/nccustom/
Upload File :
Current File : //lib64/nagios/plugins/nccustom/check_mysqld_msize.sh

#!/bin/bash
#####################################
# 2014/10/17, Eduard N.             #
#####################################

debug=0
max_size=16 #in GB

result=$(/bin/ps -C mysqld -o rss --no-header)
if [ -z "$result" ]
    then
        result=$(/bin/ps -C mariadbd -o rss --no-header)
        if [ -z "$result" ]
            then
            echo "Warning! Zero result"
            exit 3;
        fi
fi
if [ $debug = 1 ]
    then
        echo $result, $(($result/1048576)), $max_size
fi
if [ $(($result/1048576)) -lt $max_size ]
    then
        echo "Ok. $result KB";
        exit 0;
    else echo "Critical. RSS memory size: $result KB"
        exit 2;
    fi

?>