Skip to content

Instantly share code, notes, and snippets.

@shokoe
Created May 16, 2018 12:45
Show Gist options
  • Save shokoe/ffeb5636e8c8f3af4026cd251037a70c to your computer and use it in GitHub Desktop.
Save shokoe/ffeb5636e8c8f3af4026cd251037a70c to your computer and use it in GitHub Desktop.
naemon status on liner
mklive_cmd='/usr/bin/naemon-unixcat /omd/sites/magisto/tmp/run/live'; while true; do O=$((echo "Host,Check,Status,Interval,Delay,Exec"; echo -e 'GET services\nColumns: host_name description last_state check_interval last_check execution_time' | $mklive_cmd | awk -F';' -v N=`date +%s` 'N-$5 > $4*60 {printf "%s,%s,%d,%d,%d,%.2f\n", $1, $2, $3, $4*60, N-$5, $6}') | column -s , -t); clear; date; echo; uptime; echo; free -m; echo; echo "$O"; echo " Count:`echo \"$O\" | wc -l`"; sleep 10; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment