/usr/share/doc/check-mk-doc/treasures/check_nagios_states is in check-mk-doc 1.2.2p3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #!/bin/bash
set $(echo -e "GET services
Separators: 10 32 32 32
Stats: state >= 0
Stats: has_been_checked = 0
Stats: state = 0
Stats: has_been_checked = 1
StatsAnd: 2
Stats: state = 1
Stats: state = 2
Stats: state = 3" | unixcat $OMD_ROOT/tmp/run/live)
TOTAL=$1
PENDING=$2
OK=$3
WARN=$4
CRIT=$5
UNKNOWN=$6
echo "$TOTAL Services: $OK OK, $WARN WARN, $CRIT CRIT, $UNKNOWN UNKNOWN, $PENDING PENDING|total=$TOTAL ok=$OK warn=$WARN crit=$CRIT unknown=$UNKNOWN pending=$PENDING"
|