You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Princeton/pu/libexec/check_nrpe_win_mem_wrapper

22 lines
497 B
Bash

#!/bin/bash
plugins=/usr/local/monitoring/nagios/libexec
port=9666
timeout=60
command=get_mem
if [[ "$#" -ne "4" ]]; then echo "Usage: check_nrpe_mem_wrapper <hostname> <serviceduration> <type> <warn_threshold,crit_threshold>"; exit 3; fi
host="$1"
duration="$2"
type="$3"
warncrit="$4"
out=`${plugins}/check_nrpe -t $timeout -H $host -p $port -c $command -a "$host" "$type" "$warncrit" 2>&1`
stat=$?
out=`echo "$out" | sed 's/^\(.*\)|\(.*\)/\1 for '"$duration"' |\2/'`
echo $out
exit $stat