Open pangqiss1986 opened 5 years ago
check available options here: https://github.com/carbolymer/mtr-monitor/blob/master/mtr-monitor.sh#L10
You don't need to create schema in influxdb. Everything is done in https://github.com/carbolymer/mtr-monitor/blob/master/save_data.py
You just need to set correct port and host in mtr-monitor.sh
this is my mtr-monitor.sh
CYCLES=30
INTERVAL=30 MTR_HOSTS=("114.114.114.114")
INFLUXDB_HOST="localhost" INFLUXDB_PORT=8086
function monitor_mtr() { for MTR_HOST in "${MTR_HOSTS[@]}"; do ( mtr --report --json --report-cycles $CYCLES $MTR_HOST | ./save_data.py --host $INFLUXDB_HOST --port $INFLUXDB_PORT ) & done }
which mtr &>/dev/null if [ $? -eq 1 ]; then echo "mtr is not available on this system - it is required for this script to work" exit 1 fi
while true; do monitor_mtr sleep $INTERVAL done
THE save_data.py must use python3?
looks fine, and yes you should use python 3
THANK YOU!
sorry,I have two question....
NO.1:
(py3) [root@localhost mtr]# ./mtr-monitor.sh
mtr: unrecognized option '--json'
mtr: unrecognized option '--json'
mtr: unrecognized option '--json'
mtr: unrecognized option '--json'
Traceback (most recent call last):
File "./save_data.py", line 65, in
NO.2 grafana version is 6.1.4 THE grafana_dashboard_mtr.json import is Templating init failed Datasource named ${DS_TBD_INFLUX MTR} was not found
can you help me...thank!!!
which mtr version you have? you need >=0.87
You need to setup datasource manually in grafana
the grafana_dashboard_mtr.json import is not support grafana6.1.4.....
@pangqiss1986 @carbolymer The same quessiton No.1
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!