mirror of https://github.com/Icinga/icinga2.git
24 lines
513 B
Bash
Executable File
24 lines
513 B
Bash
Executable File
#!/bin/bash
|
|
|
|
NC=`which nc`
|
|
LIVESTATUSSOCKET="/var/run/icinga2/cmd/livestatus"
|
|
LIVESTATUSHOST="127.0.0.1"
|
|
LIVESTATUSPORT="6558"
|
|
LIVESTATUSQUERIES="./queries"
|
|
|
|
LIVESTATUSTABLE=$1
|
|
|
|
if [ -n "$LIVESTATUSTABLE" ]; then
|
|
cat "$LIVESTATUSTABLE"
|
|
(cat "$LIVESTATUSTABLE"; sleep 1) | $NC -U $LIVESTATUSSOCKET
|
|
else
|
|
|
|
echo -e "Looking into $LIVESTATUSQUERIES\n"
|
|
for q in $(find $LIVESTATUSQUERIES -type f)
|
|
do
|
|
cat $q
|
|
(cat $q; sleep 1) | $NC -U $LIVESTATUSSOCKET
|
|
echo -e "================================\n\n"
|
|
done
|
|
fi
|