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_cpu_wrapper

23 lines
511 B
Bash

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