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.
22 lines
419 B
Bash
22 lines
419 B
Bash
#!/bin/bash
|
|
|
|
plugins=/usr/local/monitoring/nagios/libexec
|
|
port=9666
|
|
timeout=60
|
|
command=get_cpu
|
|
|
|
if [[ "$#" -lt "3" ]]; then echo "Usage: check_nrpe_wrapper_output_convert <hostname> <command> <pipe_to_command> [args]"; exit 3; fi
|
|
|
|
host="$1"
|
|
command="$2"
|
|
args="$3"
|
|
pipecmd="$4"
|
|
|
|
out=`${plugins}/check_nrpe -t $timeout -H $host -p $port -c $command $args 2>&1`
|
|
stat=$?
|
|
|
|
out=`echo "$out" | $pipecmd`
|
|
|
|
echo $out
|
|
exit $stat
|