dpinger not started on boot

Started by Maarten, August 25, 2020, 02:04:35 PM

Previous topic - Next topic
Thx for the script and the parameter description.

dpinger got started after reboot, but unfortunately I have a message in my mailbox now every 20 minutes

DPinger_WAN_V6_Gateway_Restart at XXX.YYYYYYY.net failed (replaced real values with X and Y)

How can I avoid this? dpinger is alive all the time

Regrads
Torsten

Did you change the dpinger*.pid file that's monitored to match that of your system?
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Sorry I missed that... adjusted it to "/var/run/dpinger_WAN_DHCP6.pid"

For completeness, with @franco's input, I have implemented @marjohn56's solution except that, instead of his script, my Execute command in the Service Test Settings is:

/bin/sh -c '/usr/local/sbin/pluginctl -s dpinger restart WAN_DHCP6'

"WAN_DHCP6" is the name of my IPv6 gateway (as shown under System>Gateways>Single), which is the gateway on which dpinger can sometimes fail to restart when the gateway goes down and comes up again. It is the PID for this gateway that monit is monitoring.

This directly restarts dpinger on the named gateway. Seems to work well, based on brief testing.

January 20, 2021, 01:49:29 PM #19 Last Edit: February 20, 2021, 09:15:46 PM by Greelan
Update:

For whatever reason, a reboot just now resulted in the monit process not restarting dpinger on the IPv6 gateway.

So I made some tweaks to the monit config that seem to work more reliably.

First I changed the Service Tests Settings config so that the Action was not Execute, but just Restart.

Then in the Service Settings config, I added Start and Stop commands based on the previous Execute command.

Start:
/bin/sh -c '/usr/local/sbin/pluginctl -s dpinger start WAN_DHCP6'

Stop:
/bin/sh -c '/usr/local/sbin/pluginctl -s dpinger stop WAN_DHCP6'

My understanding is that these configs mean that when monit detects that the IPv6 dpinger process is not running, it will trigger a restart, meaning first a stop and then a start. In theory the previous setup should have had the same result, but for whatever reason it did not seem to after a reboot.

Edit: Because a picture is worth a thousand words, I have added screenshots. The Start and Stop commands in the Service Settings are cut off, see above for full contents.