ansible-pilote/files/nagios/check_timesyncd
Julien Riou 096a3e0540
Initial commit
Signed-off-by: Julien Riou <julien@riou.xyz>
2024-04-27 15:21:55 +02:00

15 lines
323 B
Bash
Executable file

#!/bin/bash
/usr/bin/timedatectl status | grep -q "NTP service: active"
if [ $? -ne 0 ] ; then
echo "NTP service not active"
exit 1
fi
/usr/bin/timedatectl status | grep -q "System clock synchronized: yes"
if [ $? -ne 0 ] ; then
echo "System clock not synchronized"
exit 1
fi
echo "NTP is healthy"
exit 0