How can I use monit to monitor ntpd

General support questions
Post Reply
edlentz
Posts: 75
Joined: 2013/06/11 20:20:25

How can I use monit to monitor ntpd

Post by edlentz » 2018/09/27 17:47:26

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

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: How can I use monit to monitor ntpd

Post by hunter86_bg » 2018/09/28 03:26:45

Check the systems service file:

Code: Select all

systemctl cat ntpd
Also, there is no need to use 3rd party software to monitor the ntpd.service.
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.

edlentz
Posts: 75
Joined: 2013/06/11 20:20:25

Re: How can I use monit to monitor ntpd

Post by edlentz » 2018/09/28 12:49:21

Sounds like a better idea. Thanks

Post Reply