I am trying to setup Monit to monitor ntpd on my Centos7 system I have the following config for the monit file:
#Process to monitor the Time Server
check process ntpd
with pidfile "/var/run/ntpd.pid"
start program = "/etc/init.d/ntpd start"
stop program = "/etc/init.d/ntpd stop"
if 3 restarts within 3 cycles then alert
The problem is that there is no ntpd.pid or ntp.pid file in the system. I have run a find / -name ntpd.pid and find / -name ntp.pid and had no results. When I run service status ntpd I do get a pid. So can someone help me out here?
Thanks
How can I use monit to monitor ntpd
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: How can I use monit to monitor ntpd
Check the systems service file:
Also, there is no need to use 3rd party software to monitor the ntpd.service.
Systemd can monitor and restart the service, if needed.
Code: Select all
systemctl cat ntpd
Systemd can monitor and restart the service, if needed.
Last edited by hunter86_bg on 2018/09/28 19:29:58, edited 2 times in total.
Re: How can I use monit to monitor ntpd
Sounds like a better idea. Thanks