mirror of
https://github.com/IgorKha/Grafana-Mikrotik.git
synced 2025-12-06 10:29:28 +00:00
hotfix
corrected change ip in prometheus.yml with sh script updated readme
This commit is contained in:
parent
6cb5701e16
commit
a4a059abdb
3 changed files with 5 additions and 3 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
[](https://liberapay.com/~1772367/donate)
|
||||||
|
|
||||||
Grafana dashboard for Mikrotik/routerOS. [prometheus/snmp_exporter](https://github.com/prometheus/snmp_exporter)
|
Grafana dashboard for Mikrotik/routerOS. [prometheus/snmp_exporter](https://github.com/prometheus/snmp_exporter)
|
||||||
|
|
||||||
| | ver. |
|
| | ver. |
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ scrape_configs:
|
||||||
- job_name: Mikrotik
|
- job_name: Mikrotik
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
- 192.168.88.1 # SNMP device IP.
|
- 192.168.88.1 # mikrotik_ip
|
||||||
metrics_path: /snmp
|
metrics_path: /snmp
|
||||||
params:
|
params:
|
||||||
module: [mikrotik]
|
module: [mikrotik]
|
||||||
|
|
|
||||||
4
run.sh
4
run.sh
|
|
@ -112,11 +112,11 @@ router_ip() {
|
||||||
if ask "Change target mikrotik IP address ?" Y; then
|
if ask "Change target mikrotik IP address ?" Y; then
|
||||||
read -rp 'Enter target mikrotik IP address: ' IP
|
read -rp 'Enter target mikrotik IP address: ' IP
|
||||||
if [ -d "./${REPO}" ]; then
|
if [ -d "./${REPO}" ]; then
|
||||||
sed -i -e 's/192.168.88.1/'"${IP}"'/g' \
|
sed -ri -e '/mikrotik_ip/s/([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/'"${IP}"'/g' \
|
||||||
${REPO}/prometheus/prometheus.yml
|
${REPO}/prometheus/prometheus.yml
|
||||||
sed -ri -e 's/^(MIKROTIK_IP=)(.*)$/\1'"$IP"'/g' "$ENV_FILE"
|
sed -ri -e 's/^(MIKROTIK_IP=)(.*)$/\1'"$IP"'/g' "$ENV_FILE"
|
||||||
else
|
else
|
||||||
sed -i -e 's/192.168.88.1/'"${IP}"'/g' \
|
sed -ri -e '/mikrotik_ip/s/([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/'"${IP}"'/g' \
|
||||||
./prometheus/prometheus.yml
|
./prometheus/prometheus.yml
|
||||||
sed -ri -e 's/^(MIKROTIK_IP=)(.*)$/\1'"$IP"'/g' "$ENV_FILE"
|
sed -ri -e 's/^(MIKROTIK_IP=)(.*)$/\1'"$IP"'/g' "$ENV_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue