Networking

Configure mktxp for Mikrotik RouterOS devices

Only first time:

Add to /home/pi/IOTstack/services/prometheus/config.yml

  - job_name: 'mktxp'
    static_configs:
      - targets: ['mktxp_machine_IP:49090']

ssh to router

Add monitoring group and user:

/user group add name=prometheus policy=api,read
/user add name=prometheus group=prometheus password=***

Add router config to the mktxp docker (192.168.1.162):

/home/pi/IOTstack/services/mktxp/mktxp.conf:

[CRS326-01]                               # Change to your Router

    capsman_clients = True

    firewall = True

    wireless_clients = True

    use_ssl = False

    pool = True

    wireless = False

    monitor = True

    capsman = False

    netwatch = True

    ssl_certificate_verify = False

    enabled = True

    use_comments_over_names = True

    no_ssl_certificate = False

    dhcp_lease = True

    dhcp = True

    route = True

    interface = True

    poe = False                         # Enable for PoE stats

    hostname = 192.168.1.2              # Change to your IP

    username = prometheus               # Change to your Mikrotik user

    password = ***                 # Change to your Mikrotik password

    port = 8728                         # Default Port for Mikrotik API

 

Install mDNS on Netgear NightHawk AC900 R7000 running on DD-WRT:

https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

Mounting required additional step to make the mount writable:

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=916754

mount -o bind /tmp/mnt/sda1 /opt

Install Avahi

opkg install avahi-utils

Monitoring

http://blog.thescorpius.com/index.php/2016/03/14/dd-wrt-network-statistics-graphics-using-grafana-and-influxdb/

https://mostlyoperational.com/posts/2017-12-28_monitoring-your-home-network-with-influxdb-on-raspberry-pi-with-docker/

https://g-ee.alexsguardian.net/UserGuides/Cameron/WAN_Metrics

https://github.com/carlosedp/ddwrt-monitoring/blob/master/prometheus/prometheus.yml

https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus.yml

https://github.com/carlosedp/ddwrt-monitoring

https://wiki.dd-wrt.com/wiki/index.php/Multi_Router_Traffic_Grapher

 

https://sensorsiot.github.io/IOTstack/Getting-Started/

Issues: files were created as directories:

./services/telegraf/telegraf.conf

https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md

set hostname value under [agent] in telegraf.conf

Manually Added snmp to docker-compose.yml:

  snmp:
    image: quay.io/prometheus/snmp-exporter
    volumes:
      - ./services/snmp-exporter:/etc/snmp_exporter
    ports:
      - 9116:9116
      - 116:116/udp
    restart: unless-stopped
    command: --config.file=/etc/snmp_exporter/snmp.yml

Result SNMP Exporter

http://192.168.1.162:9116/snmp?target=192.168.1.7&module=ddwrt

To Investigate:

Gaps in snmp data in prometheus shown in Grafana:

level=info ts=2021-05-09T21:26:03.078Z caller=collector.go:224 module=ddwrt target=192.168.1.7 msg="Error scraping target" err="scrape canceled (possible timeout) walking target 192.168.1.7"

level=info ts=2021-05-09T21:26:13.079Z caller=collector.go:224 module=ddwrt target=192.168.1.7 msg="Error scraping target" err="error walking target 192.168.1.7: Error reading from socket: read udp 10.77.60.10:57340->192.168.1.7:161: read: connection refused"

level=info ts=2021-05-11T11:29:33.061Z caller=collector.go:224 module=ddwrt target=192.168.1.7 msg="Error scraping target" err="scrape canceled (possible timeout) walking target 192.168.1.7"

 

https://www.robustperception.io/using-snmpbulkwalk-to-debug-snmp_exporter-issues

https://thwack.solarwinds.com/product-forums/server-application-monitor-sam/f/forum/35634/net-snmp-snmpv2-v3-configuration-example-for-linux-distros

15-05-2021 Removed from DD-WRT -> Administration -> Commands -> Startup

snmpd -c /jffs/snmpd/snmpd.conf

Enabled SNMP instead in DD-WRT -> Services -> Services -> SNMP