tonydm / smokeping-opensshmikrotikrouterosping Goto Github PK
View Code? Open in Web Editor NEWSmokeping SSH Probe for Mikrotik RouterOS
License: GNU General Public License v3.0
Smokeping SSH Probe for Mikrotik RouterOS
License: GNU General Public License v3.0
In ubuntu 20.0.4 LTS when i add the probe:
+ OpenSSHMikrotikRouterOSPing
routerospass = pswd
routerosuser = smokeping
source = 192.168.5.39
I get the error in web page:
ERROR: /etc/smokeping/config.d/pathnames, line 5: Directory '/var/run/smokeping' does not exist
Dear tony.
Sorry ... its me again.
I will try to modify your pm module to accept a second optinal parameter.
I found very usefull to set the "routing-table" while ping.
This force router to send ping over not active default route.
For example to exec this:
ping 8.8.8.8 routing-table=uen_itx
so I will try:
line 86
my $rtable = $target->{vars}{rtable};
and line 122
if($psource && $rtable){
@output = $ssh->capture("ping $dest routing-table=$rtable count=$pings size=$bytes src-address=$psource");
}elsif ( $rtable ) {
@output = $ssh->capture("ping $dest routing-table=$rtable count=$pings size=$bytes");
}elsif ( $psource ) {
@output = $ssh->capture("ping $dest count=$pings size=$bytes src-address=$psource");
} else {
@output = $ssh->capture("ping $dest count=$pings size=$bytes");
}
This definition does not work:
+ ROUTE_TEST
menu = ROUTE_TEST
probe = OpenSSHMikrotikRouterOSPing
title = google_x_itx
ssh_port = 22000
host = 8.8.8.8
source = 10.20.20.4
rtable = uen_itx
it yelds: unknown variable 'rtable'".
Can you help me ?
Regards.
Leandro.
Hello,
Is there a way to configure this probe to allow a single probe to report on the results of multiple IPs? For instance, the probe connects to a MikroTik router, then runs and gets ping results from IPs x.x.x.x, x.x.x.y, x.x.x.z, and so forth?
Or can multiple probes be spawned to connect to the same router simultaneously to run these tests?
If either of these is possible, how would you format the SmokePing config file to accomplish this?
Thank you.
Let me show:
After running smokeping --debug comand I can see:
OpenSSHMikrotikRouterOSPing: 172.22.255.250: got 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 OpenSSHMikrotikRouterOSPing: 194.41.0.4: got
as you can see first host is ok but second is not.
I already tryed running manually the:
ping 198.41.0.4 count=20 size=56 src-address=190.94.186.XX
from router and from server
/usr/bin/ssh -S /tmp/.libnet-openssh-perl/1eaf789b53c5273c7d488469dded4e80 -l smokeping -p 22000 172.17.50.1 -- ping 198.41.0.4 count=20 size=56 src-address=190.94.186.XX
Both works ok , but smokeping plug in can not get usable output.
Dont know what else to check.
Sep 28 13:47:05 Smokeping smokeping[36093]: Use of uninitialized value $call[3] in exec at /usr/local/share/perl/5.28.1/Net/OpenSSH.pm line 1014.
Sep 28 13:47:05 Smokeping smokeping[36091]: OpenSSHMikrotikRouterOSPing: OpenSSHMikrotikRouterOSPing connecting 208.89.144.11: unable to establish master SSH connection: bad password or master process exited unexpectedly
I did verify that the OpenSSH client was installed.
In the Multiplexed SSH Connections section of the readme the setting is called multiplex_socket_file_path
Later in the example of the Probes file it is called multiplex_control_file_path
And finally, in the code, it is called multiplex_control_socket_path
The plugin debugging shows no packetloss, but Smokeping's UI is showing 50% packetloss.
My assumption (I'm no developer) is that the plugin is only sending 20 pings worth of data back to Smokeping. RouterOS paginates the results, so it seems like we're grabbing the first 20 results and moving on.
My use case is having a nearly constant stream of pings. With the FPing plugin, I have step and pings set to 60. I think I have gaps in the data, due to having the same value, so when I saw that this plugin had a max of 50, I went down to 40 pings with a step of 50. I still get an error about reaching 80% of the polling round, but I don't think I'm actually losing any data. I may have to drop that further to not fill my logs with warnings.
As a workaround, I could likely drop down to 20 pings with a step of 26 to both be under the 20 max and under the 80% warning level, but I assume that would increase the load on the poller. My intent is to end up having dozens or hundreds of tests being done concurrently, so that would end up being a consideration.
Seems multiplex_ssh collides if there a many same hosts and threads.
OpenSSHMikrotikRouterOSPing: OpenSSHMikrotikRouterOSPing connecting 10.0.101.38: unable to establish master SSH connection: bad ssh master at /var/lib/smokeping/.libnet-openssh-perl/[email protected] socket owned by pid 318032 (pid 317986 expected)
OpenSSHMikrotikRouterOSPing: OpenSSHMikrotikRouterOSPing connecting 10.0.101.38: unable to establish master SSH connection: bad ssh master at /var/lib/smokeping/.libnet-openssh-perl/[email protected] socket owned by pid 318032 (pid 317980 expected)
Hello dear Tony.
I would like to modify your module so we can reuse ssh connections (master mode).
After reading Net::OpenSSH documentation tryed to tweat OpenSSH objects parameters but can not get them reuse connections.
This is what I have so far:
my $ssh = Net::OpenSSH->new(
$source,
$login ? ( user => $login ) : (),
$password ? ( password => $password ) : (),
#external_master => 1,
port => $port,
timeout => 60,
strict_mode => 0,
kill_ssh_on_timeout => 1,
ctl_dir => "/tmp/.libnet-openssh-perl",
#ctl_path => "reusable_path",
master_opts => [-o => "StrictHostKeyChecking=no"],
ssh_cmd => $ssh_cmd
);
Im playing with ctl_path , master_opts and external_master values , but it is not working
Please take a look to following perlmonk node as well:
https://www.perlmonks.org/?node_id=11122369
I will try to make more tests today and let you know if have some improvement.
Leandro.
The graphs show that the Mikrotik rounds the ping times and so on the one hand it is very ugly and on the other hand not accurate enough that way. Couldn't somehow get the Mikrotik to ping more accurately?
I found in Mikrotik 6.44 changelog:
speedtest - added "/tool speed-test" for ping latency, jitter, loss and TCP and UDP download, upload speed measurements (CLI only);
This gives the following output:
[admin@mikrotik] > /tool speed-test 192.168.88.2 duration=5 without-paging
status: ping
time-remaining: 55s
loss: 100% (1/1)
status: ping
time-remaining: 54s
ping-min-avg-max: 860us / 1.09ms / 3.93ms
jitter-min-avg-max: 0s / 352us / 2.97ms
loss: 0% (0/21)
status: ping
time-remaining: 53s
ping-min-avg-max: 856us / 1.04ms / 3.93ms
jitter-min-avg-max: 0s / 257us / 2.97ms
loss: 0% (0/41)
status: ping
time-remaining: 52s
ping-min-avg-max: 852us / 1.01ms / 3.93ms
jitter-min-avg-max: 0s / 191us / 2.97ms
loss: 0% (0/61)
status: ping
time-remaining: 51s
ping-min-avg-max: 852us / 989us / 3.93ms
jitter-min-avg-max: 0s / 159us / 2.97ms
loss: 1.23% (1/81)
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.