OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 20.7 Legacy Series »
  • dpinger not started on boot
« previous next »
  • Print
Pages: [1] 2

Author Topic: dpinger not started on boot  (Read 9214 times)

Maarten

  • Jr. Member
  • **
  • Posts: 67
  • Karma: 6
    • View Profile
dpinger not started on boot
« on: August 25, 2020, 02:04:35 pm »
Hi,

I'm running a multiwan setup and sometimes on a reboot the dpinger service is not started. This is obviously a pretty big problem, because the gateway is then not enabled.

1) Is there a way to see why this happened?
2) Should a service like this be monitored and started if it failed?
Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #1 on: August 25, 2020, 03:19:09 pm »
Dpinger does not enable the gateway, it merely monitors it. There is an option within the single gateway settings 'Disable Gateway Monitoring'. If that us ticked dpinger will not start on that gateway.
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

Maarten

  • Jr. Member
  • **
  • Posts: 67
  • Karma: 6
    • View Profile
Re: dpinger not started on boot
« Reply #2 on: August 25, 2020, 03:21:47 pm »
yes, but I have "Allow default gateway switching" enabled, so it needs to know if it's a usable gateway.
Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #3 on: August 25, 2020, 03:35:12 pm »
You should be able to look at the gateway log files to see what's happening,
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #4 on: August 25, 2020, 06:28:41 pm »
There is a way to monitor dpinger and restart it, but it's not a default function, it's something you need to add to Monit. Here's how I do mine, maybe not the best or only way, but it's never let me down. I only monitor my v6 dpinger as that is the only one that occasionally fails when something happens ISP wise.

Go to Services->Monit and click on the 'Service Test Settings' tab. Add a new Service test, give it a name, such as 'Dpinger not Running Restart', set the Condition to 'does not exist' and the action to 'Execute'. Put this in the Path box '/usr/local/etc/rc.d/dpinger_starter', Save that and that's the first part done.

Now click on the 'Service Settings' tab and add a new entry. Give the new entry a name, mine is 'dpinger_WAN_V6_Dpinger_Restart', set the Type to 'Process'. Now you need to find the pid file you want to monitor, look in /var/run/ you'll see them, they will be named dpinger_*_ pid, copy the filename and enter the path an file name into the PID File box, e.g. mine is '/var/run/dpinger_WAN_V6_Monitor.pid'. Now select from the 'Tests' dropdown the test you created first, thats it, click on save.

All that's needed now is to copy the attached file to the /usr/local/etc/rc.d/ directory and make it executable, set the permissions to 755.
Works for me, not sure it will work for you as I suspect there's more afoot than just dpinger not starting.
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

Maarten

  • Jr. Member
  • **
  • Posts: 67
  • Karma: 6
    • View Profile
Re: dpinger not started on boot
« Reply #5 on: August 26, 2020, 08:22:53 am »
@marjohn56 Thanks for your detailed reply, I'm gonna try this script when it happens again and see it that fixes it. Normally I'm a bit hesitant with placing scripts on the router, because after an update it's gone.

Best regards, Maarten
Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #6 on: August 26, 2020, 09:28:32 am »
Then you need one of my other scripts which uses rsync to back up my scripts and other specific files to my QNAP.  :)
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #7 on: October 15, 2020, 02:37:59 pm »
Almost eight weeks later I had a pppoe down event which usually results in dpinger failing to restart. There's an issue with my script, it could be that it's because of an update and somethings moved, but it's easy to fix, just add this extra require  in the script with the others.


require_once '/usr/local/etc/inc/system.inc';
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

packet loss

  • Full Member
  • ***
  • Posts: 134
  • Karma: 26
    • View Profile
Re: dpinger not started on boot
« Reply #8 on: October 15, 2020, 08:05:26 pm »
Is there a reason "Disable Gateway Monitoring" is disabled by default? In my particular case I'm refering to a single  WAN network. Also did Maarten find a bug with dpinger not restarting after a reboot?
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: dpinger not started on boot
« Reply #9 on: October 16, 2020, 07:37:14 am »
Quote from: packet loss on October 15, 2020, 08:05:26 pm
Is there a reason "Disable Gateway Monitoring" is disabled by default? In my particular case I'm refering to a single  WAN network. Also did Maarten find a bug with dpinger not restarting after a reboot?

Because 90% only use single WAN where it's not relevant?
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #10 on: October 16, 2020, 10:02:39 am »
Dpinger, on occasion, will not restart after a PPPoE loss, usually the ISP side. I run a Monit task which watches dpinger and will restart it if it's not running, it doesn't really matter what the cause is, the script and monit will restart it, that's what I was referring to. It was to help the OP with the original issue he posted.
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: dpinger not started on boot
« Reply #11 on: October 16, 2020, 11:37:28 am »
Quote from: marjohn56 on October 16, 2020, 10:02:39 am
Dpinger, on occasion, will not restart after a PPPoE loss, usually the ISP side. I run a Monit task which watches dpinger and will restart it if it's not running, it doesn't really matter what the cause is, the script and monit will restart it, that's what I was referring to. It was to help the OP with the original issue he posted.

Can you post screenshots? I'd like to add this to the examples .. (or you can add them yourself)
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #12 on: October 16, 2020, 11:41:48 am »
I can, but I have a vague memory of @Franco telling me there was an easier way than using a script.. whatever, I can't remember and this works so I stick with it.


What is it you want, images of the Monit setup etc?
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: dpinger not started on boot
« Reply #13 on: October 16, 2020, 04:03:56 pm »
Yes ... so I can just add a 4th example. monit is so powerful but noone knows how to work with it. It needs practical examples.
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

marjohn56

  • Hero Member
  • *****
  • Posts: 1701
  • Karma: 179
    • View Profile
Re: dpinger not started on boot
« Reply #14 on: October 17, 2020, 12:56:49 pm »
@mimugmail


Here you, go, note it monitors the wan v6 dpinger pid, but the script restarts all dpinger instances.
Logged
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

  • Print
Pages: [1] 2
« previous next »
  • OPNsense Forum »
  • Archive »
  • 20.7 Legacy Series »
  • dpinger not started on boot
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2