1
General Discussion / Re: Help on using monit to restart igmp-proxy when that service is down
« on: March 14, 2022, 06:24:51 pm »
Had a look into it this afternoon, but unfortunately the igmpproxy service does not use a PID file. Not in /var/run or anywhere else on the system.
But I have got this to work by using a custom Service monitor & a shell script checking if the 'igmpproxy' service is running. The Service Test is a duplicate of 'NonZeroStatus' but then adapted to do a restart when there is a non-zero exit instead of just an alert.
Script file (/root/igmpproxy-checker.sh):
I have attached pictures of the Monit custom Service & Service Test settings.
One odd thing that I found is that I had to use 'onestart' instead of just 'start' to get the igmpproxy restarted. Don't exactly know whay that is, but at least it works for me now.
Thanks again Greelan for giving me a nudge in the right direction.
But I have got this to work by using a custom Service monitor & a shell script checking if the 'igmpproxy' service is running. The Service Test is a duplicate of 'NonZeroStatus' but then adapted to do a restart when there is a non-zero exit instead of just an alert.
Script file (/root/igmpproxy-checker.sh):
Code: [Select]
#!/bin/sh
if pgrep igmpproxy > /dev/null
then
exit 0
else
exit 1
fi
I have attached pictures of the Monit custom Service & Service Test settings.
One odd thing that I found is that I had to use 'onestart' instead of just 'start' to get the igmpproxy restarted. Don't exactly know whay that is, but at least it works for me now.
Thanks again Greelan for giving me a nudge in the right direction.