carbolymer / mtr-monitor Goto Github PK
View Code? Open in Web Editor NEWSimple MTR runner with grafana and influxdb on board
Simple MTR runner with grafana and influxdb on board
Hello, I have already docker running with: Telegraf, Grafana, Influxdb, how can I load mtr-monitor to be part of the docker container? thanks
Hey, I want to run mtr on my Raspberry Pi 4, but use an external instance of InfluxDB running on my server.
I'm not sure where to specify a bucket and credentials for such an external InfluxDB
I'm also curious, if mtr-monitor is compatible with the newer influxdb 2.0, or if I need a seconds instance running 1.7-alpine.
Beautiful piece of software tho
I set mine up without any docker dependencies.
In my use case:
Python 3.9.2
MTR 0.94
InfluxDB 1.8.10
Grafana v10.1.1
Had to modify save_data.py line 45-48 thus:
if hub['count'] < 10:
hop = "0" + str(hub['count']) + "-" + hub['host']
else:
hop = str(hub['count']) + "-" + hub['host']
Python3 was unable to do a string conversion from int with string concatenation. Explicitly changed int to str.
Hope this helps someone out!
I slightly adjusted the mtr-monitor.sh to not create Docker containers because I have an existing InfluxDB in my environment. But the python script returns the following error:
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "./save_data.py", line 65, in <module>
main()
File "./save_data.py", line 61, in main
HubEntry.commit()
File "/usr/lib/python2.7/dist-packages/influxdb/helper.py", line 127, in commit
rtn = client.write_points(cls._json_body_())
File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 391, in write_points
tags=tags)
File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 436, in _write_points
expected_response_code=204
File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 278, in write
headers=headers
File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 248, in request
raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"unable to parse '8.8.8.8,destination=8.8.8.8,hop=01-10.166.102.3 avg=3.56,best=0.38,last=6.53,loss=0.0,snt=30i,stdev=8.67,time=2018-12-12 11:16:06.119893,wrst=47.22': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=02-10.255.254.97 avg=0.79,best=0.45,last=0.86,loss=0.0,snt=30i,stdev=0.12,time=2018-12-12 11:16:06.119893,wrst=1.04': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=03-172.30.8.11 avg=0.59,best=0.39,last=0.67,loss=0.0,snt=30i,stdev=0.17,time=2018-12-12 11:16:06.119893,wrst=1.02': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=04-172.30.5.11 avg=0.79,best=0.54,last=0.77,loss=0.0,snt=30i,stdev=0.23,time=2018-12-12 11:16:06.119893,wrst=1.57': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=05-194.40.224.196 avg=1.53,best=1.29,last=1.65,loss=0.0,snt=30i,stdev=0.15,time=2018-12-12 11:16:06.119893,wrst=1.91': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=06-i79zhh-001-ten0-3-0-11.bb.ip-plus.net avg=2.12,best=1.8,last=2.12,loss=0.0,snt=30i,stdev=0.2,time=2018-12-12 11:16:06.119893,wrst=2.62': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=07-i79zhh-015-ae5.bb.ip-plus.net avg=4.62,best=1.7,last=1.92,loss=0.0,snt=30i,stdev=6.69,time=2018-12-12 11:16:06.119893,wrst=30.79': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=08-72.14.223.0 avg=3.03,best=2.69,last=3.03,loss=0.0,snt=30i,stdev=0.24,time=2018-12-12 11:16:06.119893,wrst=3.95': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=09-??? avg=0.0,best=0.0,last=0.0,loss=100.0,snt=30i,stdev=0.0,time=2018-12-12 11:16:06.119893,wrst=0.0': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=10-172.253.50.22 avg=3.99,best=3.7,last=4.5,loss=0.0,snt=30i,stdev=0.2,time=2018-12-12 11:16:06.119893,wrst=4.5': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=11-172.253.50.173 avg=4.34,best=3.43,last=3.7,loss=0.0,snt=30i,stdev=2.63,time=2018-12-12 11:16:06.119893,wrst=18.13': invalid number\nunable to parse '8.8.8.8,destination=8.8.8.8,hop=12-google-public-dns-a.google.com avg=2.12,best=1.95,last=1.95,loss=0.0,snt=30i,stdev=0.17,time=2018-12-12 11:16:06.119893,wrst=2.62': invalid number"}
I'm aware that I'm not using your script the way you wrote it, but maybe you have an idea if the problem is related to my InfluxDB (1.6.4) or to a different output of mtr (0.92)?
Can you tell me which version of mtr you are using?
Thanks,
Frank
dear:
THE mtr monitor is very good!.BUT I don't want to use docker. Now I install influxdb.How can I create database ,tables,column?
and THE save_data.py hava you python2 ?
Thank you!
Hello,
trying to install on fresh debian 11, but i'm facing multiple issues.
first thing is that influxDB is not seen in python libs :
# python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" | xargs ls | grep -i influx
->returns nothing, but influxdb python module in installed :
# python3 -m pip list | grep -i infl
influxdb 5.3.1
other problems (that may be linked) : graphana dashboard does not conain anything related to mtr, and I have no influxdb datasource.
can you help me please ?
Regards
Hello, I was wondering how I could use this with multiple ISPs?
I have some other scripts that use multiple interfaces on my test box so I can specify which which gateway to use.
I know with mtr -I <interface>
I can get it to exit out the specified interface, I just don't know how to code it here and send that data to influx.
With time, I could figure it out, but I'm sure there's someone smarter here that could figure it out before me.
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.