Time Monitor - Custom script to monitor time drift on servers.
- Login as user (ie. ubuntu) to target server
- copy files/timemon.sh and files/monitor.properties to /opt/monscript folder
- The timemon.sh and monitor.properties should be owned by root:root
- The monitor.properties should have 755 file properties (i.e. chmod 755 monitor.properties)
- The timemon.sh should have 555 file properties
- Create the log directory defined in monitor.properties and owned by ubuntu:ubuntu (ie. chown ubuntu:ubuntu logs)
- Allow ubuntu user to read/write to it (ie. chmod 744 /opt/logs/timemon)
- install nptdate on ubuntu (sudo apt install ntpdate)
- Remove /etc/cron.allow (or configure if needed)
- crontab –e and add the following line: * * * * * /opt/monscript/timemon.sh (runs every minute)
- Make sure you have one empty newline at the end of the timemon.sh entry (or cron won’t run)
- Remove assumption that nptdate is in /usr/sbin