OPNsense Forum

English Forums => Development and Code Review => Topic started by: marjohn56 on March 21, 2018, 08:34:33 am

Title: Implementing Dpinger
Post by: marjohn56 on March 21, 2018, 08:34:33 am
I decided yesterday to have a look at implementing Dpinger, and I now have it working nicely.

There remains one issue, and I am not sure which direction to take. With Apinger there is one instance, no matter how many monitors are running, with Dpinger, it's once instance per monitor.

This leads to an issue with services, as we cannot have one service as is the case for Apinger, thus the service control for each instance needs to be added dynamically to the services list. This is an area I am totally unfamiliar with and need some advice/help to get this over the finishing line.

All input gratefully received.

(https://i.imgur.com/1PTrkXB.png)
Title: Re: Implementing Dpinger
Post by: mimugmail on March 21, 2018, 08:43:18 am
Woooooot!! Hero alert!  8)
Can you give us a short guide how to transfer the service? I'd love to test this intensively ...

Had many problems with apinger in the beginning, to be honest, if you keep gateway monitoring to a min it's ok to use it, but it's really old fashioned.

Thanks for your work!
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 21, 2018, 08:51:31 am
There's a lot of code changes and it it still needs tidying up, otherwise Franco and Ad will have heart attacks! Plus I had to compile dpinger etc. At the moment it works, but the services is showing Apinger not running - obviously. I can clean  that up and remove Apinger from the services list. I am toying with adding start/stop/restart buttons to the gateway widgets rather than the adding to the services widget.

I'll try and tidy it up a bit today and I'll post a link to a PR on my Github repo for those who wish to play. Don't go looking there at the moment, I've not even created a branch for it yet. :)
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 21, 2018, 11:55:56 am
Got it...

There'll need to be some tweaks as we move down the road, but it's 95%, there is only one thing left but it it's ready for testing... I'll create a branch and post the info soon.

(https://i.imgur.com/774Yzyq.png)
Title: Re: Implementing Dpinger
Post by: elektroinside on March 21, 2018, 12:15:12 pm
Great work! I also had some issues with things related to the functionality of apinger, while testing different multiwan scenarios, with clean, default settings. So maybe dpinger will do a better job.

Thank you for you work!
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 21, 2018, 12:31:27 pm
Well, I was just about to issue a commit and I find there have been quite a few changes in the core code, so it'll have to wait until the next is release is out, a day or so I believe. So no patches for the moment, but something to look forward to at the weekend.  :)
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 21, 2018, 12:42:28 pm
We'll do it this way for those that want to play... On your own heads be it. This is for 18.1_4 ONLY!!!!

In the archive are all the files needed. Copy dpinger to /usr/bin, permissions 755.

Now the other files need to be copied to the correct directories, if you need to ask, you should not be doing, if you don't know, then don't ask as I'll not be telling you.

It goes without saying, but please back up  ( I usually just rename them ) the original files first!!

Let me know how you get on.

Remember this is a work in progress, it works but there may be some unknowns.
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 21, 2018, 01:21:43 pm
Forgot to add, you'll need to reboot to kick everything into play. Once that has been done, you'll need to delete the exsting *.quality.rrd files from /var/db/rrd/

Wait about 20 minutes and you should see data in the graphs, you'll need to select High Resolution as the data is starting from scratch.
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 22, 2018, 09:39:14 am
OK, had a look at 18.1_5 and the attached files work with it. I am not going to do a commit on this for 18.1 as there are several changes on the core master that would create too many variations, thus making it difficult to keep track of.

What I will do is create a commit to the master so it can be included, possibly at 18.7 and at the same time maintain this version for releases leading up to that. This should also allow for feedback that I can feed into the master as required.

Reminder: apart from the scripts, Dpinger itself needs to to go into /usr/bin and permissions set to 755

Latest version two messages down.
Title: Re: Implementing Dpinger
Post by: franco on March 22, 2018, 09:55:50 am
Very glad to see this move forward, thanks Martin!

I'm adding dpinger to our ports to ease testing in the future.


Cheers,
Franco
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 22, 2018, 10:51:33 am
Addition to the code..

Now included modified interfaces.inc
Title: Re: Implementing Dpinger
Post by: nivek1612 on March 26, 2018, 08:14:28 pm
At this rate I will run out of things for you to do for me Martin

Nice job. And works a charm


Now about France :-)
Title: Re: Implementing Dpinger
Post by: marjohn56 on March 26, 2018, 09:53:21 pm
At this rate I will run out of things for you to do for me Martin

Nice job. And works a charm


Now about France :-)

Speak to Franco.  8)
Title: Re: Implementing Dpinger
Post by: marjohn56 on May 04, 2018, 04:33:40 pm
18.1.7 is out so for those who want to keep running dpinger here's an updated installer. 18.1.7 is now very close to the dev path and  thus being able to just issue a patch ID, but not quite.

Do the following to install.

Copy the attached file to the root folder of Opnsense.

Once you have copied it across to the root of opnsense, open a shell and do the following. The rm -r backups is there only if you have a backups directory which was created by an earlier version of dpinger_install.

# cd /
# rm -r backups
#  unzip -o dpinger_18.1.7_install.zip
# ./dpinger_install

The system will reboot automatically and that should be it.

If you have not used an earlier dpinger install then you will need to go to System-Settings-Misc and select 'Prefer Dpinger'. Once that is done you should be up and running. Dpinger Alarms are working and should be visible in your system logs if they occur.

As usual, it's working well on my test and live systems. Let me know if there are any problems.
Title: Re: Implementing Dpinger
Post by: opnsenseuser on May 06, 2018, 08:58:49 am
Once again a great job. :-)
Title: Re: Implementing Dpinger
Post by: mimugmail on May 07, 2018, 02:25:09 pm
Switch to dpinger went flawless while monitoring 3 gateways. Great job guys  :-*
Title: Re: Implementing Dpinger
Post by: franco on May 07, 2018, 06:35:32 pm
Halfway through cleanups. Looks good so far. :D


Cheers,
Franco
Title: Re: Implementing Dpinger
Post by: marjohn56 on May 07, 2018, 08:21:06 pm
Excellent work from @franco on the cleanup.