icinga2/test/jenkins/livestatus_socket.test

20 lines
428 B
Bash
Executable File

#!/bin/sh
livestatus_path="/var/run/icinga2/cmd/livestatus"
if [ ! -e $livestatus_path ];
then
sudo icinga2 feature enable livestatus 1> /dev/null
sudo service icinga2 restart 1> /dev/null
sleep 1
if [ ! -e $livestatus_path ];
then
echo "[FAIL] Icinga2 Livestatus socket not found ($livestatus_path)"
exit 1
fi
fi
echo "[OK] Icinga2 Livestatus socket found ($livestatus_path)"
exit 0