dennypage / dpinger Goto Github PK
View Code? Open in Web Editor NEWPinger engine for monitoring latency and loss
License: BSD 2-Clause "Simplified" License
Pinger engine for monitoring latency and loss
License: BSD 2-Clause "Simplified" License
Hi Denny
Could you possibly review https://redmine.pfsense.org/issues/4354 and let us know your thoughts? I am more than happy to donate financially to the cause if that helps. I had a bad outage yesterday on a pfSense 2.3.2_p1 system that was due to a false positive on dpinger. This caused a gateway to get marked "down" when it wasn't really an ISP issue. We believe it was just an 8.8.8.8 problem.
It has been suggested by myself and others that allowing additional targets would really help reduce these edge cases and improve reliability.
For reference: https://redmine.pfsense.org/issues/5696
dpinger doesn't check the pidfile when it's specified. This can lead problems that you've multiple dpinger daemons running that all write the same pidfile and likely will even have problems when they all try to use the same socketfilename.
IMO: During starting dpinger should check if a pidfile already exists and check it's content (ping process to detect orphaned pidfiles.
SOCK_CLOEXEC was added in FreeBSD 10.0 [1], it's better if fcntl() is used instead
[1] https://wiki.freebsd.org/AtomicCloseOnExec
Warning: Object directory not changed from original /wrkdirs/usr/ports/net/dpinger/work/dpinger-1.1
cc -O2 -pipe -fno-strict-aliasing -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c dpinger.c
dpinger.c: In function 'main':
dpinger.c:1120: error: 'SOCK_CLOEXEC' undeclared (first use in this function)
dpinger.c:1120: error: (Each undeclared identifier is reported only once
dpinger.c:1120: error: for each function it appears in.)
*** [dpinger.o] Error code 1
Stop in /wrkdirs/usr/ports/net/dpinger/work/dpinger-1.1.
*** [do-build] Error code 1
Stop in /usr/ports/net/dpinger.
For reference: https://redmine.pfsense.org/issues/5695
stumbled upon this through freebsd ports... it's kind of unclear what this does or what advantages it has over regular ping or liboping...
can this be clarified somewhat?
thanks!
Background:
*https://redmine.pfsense.org/issues/4354
*https://redmine.pfsense.org/issues/1189
There is even this now: https://forum.pfsense.org/index.php?topic=123741.0
$2500 bounty.
Feature request: Multiple Targets To Ping
So the most basic feature to ask for in relation to multiple targets in dpinger I would think is: that if all ips are down then pfsense (dpinger) could mark the connection as down. I have a few devices out in the field and sometimes pings just stop to a target until they are restarted/re routed.
I think also that this should be a feature because of the way broadband ISP's seem to handle pings anymore. Even on a few 'business' connections I will see dropped pings to an ISP gateway, like they just kill the pings or routes that have to do with icmp.
I have had anycast IP's stop pinging too, when a connection is just fine. I think it stems from just crap routing and traffic management setups, where ISP's just do not care about this type of traffic anymore.
I have quite a few dedis and VPS's in the wild but I cannot guarantee 100% uptime on all at the same time, but I can guarantee that at least 8 out of 10 will be up, or 5 out of 10.
I really do think that this is a valid request for a piece of software like this anymore as it is more and more common for small business level internet to have issues with pings. I have had routers in at least 10 different locations across 10 different states, with 10 different ISP's all have issues like this. Time Warner, Spectrum, ATT, Verizon DSL, Verizon 4G, Comcast, FIOS, Brighthouse, Misc WISP, etc etc.
This issue @ pfsense has been open for 6 years now and I know it might not be as glamorous as fast kernel space packet routing but anymore this is a huge problem. I have clients dumping money into the pfsense project via hardware and support purchases only to have unreliable broadband because of this.
I am not 100% in tune to the relationship between dpinger and pfsense but it was suggested by Mr Thompson to come here and ask for something like this. Please help.
Would be nice to also have:
combine loss/latency so it stays on alert until both latency and loss < threshold.
Even better, not only execute command if > threshold, but also another command (or script) if back to < threshold. Also with optional function like above.
Thanks anyway, this is great small tool for various things.
Hello,
I use dpinger through OPNsense since years, and would love to see dpinger being able to make tcp pings.
On a lot of occasions, ISPs tend to priorize ICMP traffic over TCP.
On other occasions, ICMP works but TCP doesn't.
I myself maintaing tcpping in order to monitor such issues via ICMP/TCP or UDP.
Being able to diagnose such issues would help in OPNSense to take actions on multi wan gateway switching.
Is there any chance dpinger can get TCP ping support ?
Hello,
I would be great if we could define interface name instead of source ip address.
thanks
Hi,
I have read #22 and #24, but I believe that multiple targets support (without decision making) is still makes sense.
The problem is that dpinger creates 4 threads for single host (+ main thread), and I believe that this is a waste of resources and context switches if one has to monitor (say) 100 targets, and even for 10 targets this is a little bit too much, IMHO, especially on embedded systems (async I/O based on libev, for instance, would be more appropriate, but this is another story).
The idea is just to allow multiple targets to be processed by single instance of dpinger, and every report has to be prefixed with target ip/name.
So, the question is - do you have any interest to implement this feature?
From the code:
// After December 31st, 2016, review use of fcntl() for setting non blocking
// and close on exec. It would be preferable to use accept4(), SOCK_CLOEXEC
// and SOCK_NONBLOCK. These are currently avoided to allow use on older
// systems such as FreeBSD 9.3, Linux 2.6.26.
It's 2017
Hi,
I run the following:
dpinger -r 0 -S -D 100m -L 2 -C /usr/sbin/reboot -f 192.168.1.1
On failure nothing happens. Am I misunderstanding or missing something?
Prior accept() behavior use can be restored by defining DISABLE_ACCEPT4. If you have a platform where this is necessary, please add a comment to this issue explaining the circumstance. If no one comments, the conditional will be removed in a future release.
Good morning,
In your readme you state dpinger can provide information to "Cacti, Nagios, Zabbix, etc."
How would you go about getting the dpinger stats to a monitoring tool? I would like to run dpinger on a mips linux based router. Compiling dpinger with static binary is no problem and everything seems to work. However I am not sure what the best way to get data to one of the monitoring tools.
Thanks!
Josh
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.