What's new

Monitor internal network with SNMP

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Jason A

Occasional Visitor
Hi there,

I am running Merlin 384.15_beta1 on an Asus RT-86U, it has 4 AiMesh nodes (also 86Us) connected to it. The aim is to monitor the internal network with information such as devices connected and how much bandwidth they are using, I would like to monitor the AiMesh nodes as well but one step at a time.

I have got SNMPD up and running and logging data to Zabbix. It shows total network traffic per ethernet adapter which is nice but I cannot see the individual devices connected to that adapter.

So my question is, has anyone managed to set up something similar to monitor a network? Did you use SNMP? Also, which tool did you log to?

Thanks

Jason
 
This is exactly what i was looking for, as i had wifi problems and tryed to optimize the stability.
I could not find anythin what fits my needs, espeacilly to monitor the wifi strenght of each antenna. So i wrote my own scripts to monitor the wifi data and addopt some scripts i found here in the forum for the overall data.

I dont have the code public yet, because i dont have time to support it. But if you are interested in it, i can share it with you.

The scripts monitors:
- inBytes/outiytes of each client on each mac adress
- sync the spdstats.db with influx
- wifi: save tx/rx rate, rssi, rssi per antenna, noise, noise per antenna


Anmerkung 2020-02-05 200507.jpg
Anmerkung 2020-02-05 200412.jpg
Anmerkung 2020-02-05 195908.jpg
Anmerkung 2020-02-05 195818.jpg
 
@corgan2222 that looks very impressive.

What router does this code run on?
 
Im running a RT-AX88U (and since yesterday with one lyra node)

most of the bash code is nasty print/awk stuff (could break at any time on system updated, if there are changes in the output of commands i use) and it need a manual added client list for the mac->clientname to run correct (or to show the correct client names in grafana).
For me it works great, but i think it needs some improvements to shared it with the public.

but if someone is interested in it, i would share it.
 
@corgan2222 I am not capable of customizing any scripts without directions and your time sounds filled right now.

But, I hope some of the more advanced scriptwriters here take an interest. :)

@thelonelycoder, @Jack Yaz, @Martineau, @dave14305, @SolluxCaptor, @everyone else other than me? :D
You won't get grafana running on a router. Adding support to pipe out data from my scripts is actually a WIP on my local codebase, since I run an InfluxDB/Prometheus and Grafana stack. Oh, and Netdata thrown in for good measure
 
You won't get grafana running on a router. Adding support to pipe out data from my scripts is actually a WIP on my local codebase, since I run an InfluxDB/Prometheus and Grafana stack. Oh, and Netdata thrown in for good measure

Your are right, grafana, influxDB and zabbix are running on a different servers.
For traffic and client data collection i dont generate most of the data. if there are ways to use existing data, i use them

Traffic logging for each client: using iptables command
wifi infos: using "nvram get wl_ifnames" and then some wl -i xxx commands

TrafficAnalyzer: parsing/sync /jffs/.sys/TrafficAnalyzer/TrafficAnalyzer.db into influx
NTP Data: parsing/sync /jffs/addons/connmon.d/connstats.db into influx
Speedtest: prasing/sync /jffs/addons/spdmerlin.d/spdstats.db into influx

I had looked into your spdMerlin and spdStats code and was thinking about to add the one line of code, but i dont like this kind of "hacking" wich breaks on each update.
So it would be great, if you would implemented some kind of option to give us the possibblity to pipe the output from spdMerlin/ntpMerlin to some external databases like influx/prometheus.
 
Your are right, grafana, influxDB and zabbix are running on a different servers.
For traffic and client data collection i dont generate most of the data. if there are ways to use existing data, i use them

Traffic logging for each client: using iptables command
wifi infos: using "nvram get wl_ifnames" and then some wl -i xxx commands

TrafficAnalyzer: parsing/sync /jffs/.sys/TrafficAnalyzer/TrafficAnalyzer.db into influx
NTP Data: parsing/sync /jffs/addons/connmon.d/connstats.db into influx
Speedtest: prasing/sync /jffs/addons/spdmerlin.d/spdstats.db into influx

I had looked into your spdMerlin and spdStats code and was thinking about to add the one line of code, but i dont like this kind of "hacking" wich breaks on each update.
So it would be great, if you would implemented some kind of option to give us the possibblity to pipe the output from spdMerlin/ntpMerlin to some external databases like influx/prometheus.
I'm happy to look at any suggestions you have, no point me reinventing the wheel if you've got something already working. Feel free to pm me :)
 
Thanks, sounds great!! i would do.
This week im really busy with some projects, but next week i have some days off and then i would going to refactor the code to bring it to public and then i will get in contact with you.
Till then, i want to make an installer as in your scripts. I hope its ok, if i use your scripts as a kind of template for this. :)

greetz Stefan
 
Any update on this? Any chance you could please provide me with the scripts which you have working?

Neil


Sent from my iPhone using Tapatalk
 
sorry for the delay, dammed work.. :/

as i wrote my first comment here, i hade my lyra mesh system only for some days and did not checked if the script is working fine with in a mesh configuration.
It seams, that the commands i use on the router, did not cover the clients connected to the lyra.
atm i can only get the wifi informations from the client conected to the router.

I could not find any documentation about how the mesh nodes are talking to the router, but I was able to ssh to the node, but there are the importand commands missing (
wl -i [interface] )

So there are two possible ways to go.

1. Try to figure out the correct commands to get the wifi infos from the clients and run a script on each mesh node

2. or find the informations about the connected clients->nodes in the router, wich must be somewhere, because the router are showing the informations about the nodes in the gui.

It would be great if the pro-devs could push me in the right direction. :)
@thelonelycoder , @Jack Yaz , @Martineau , @dave14305 , @SolluxCaptor
 
That's some impressive Zabbix wrangling there.

I have the basic SNMP daemon running on my RT-AC68U. I was hoping to learn how to add some interesting things like cpu temperature or whatnot to the router's SNMP repertoire. Looking forward to seeing some examples here.
 
you can try my extStats script, but be warned, its written on my RT-AX88U and i have no clue if its working on your router.
actually it in alpha stage, absolutly no testing have been done from others.

https://github.com/corgan2222/extstats

I just want to say this is a FANTASTIC project.

I installed it on my RT-AC86U and its mostly working. I was able to make a few tweaks to get some additional metrics flowing into influx/grafana. I am far from a developer but I would be happy to test any updates you make!
 
you can try my extStats script, but be warned, its written on my RT-AX88U and i have no clue if its working on your router.
actually it in alpha stage, absolutly no testing have been done from others.

https://github.com/corgan2222/extstats
Is this compatible with the latest versions of Merlin firmware? Very interesting project you have here.
 
I too am trying to find within the router files information for these :

WiFi clients
Connected rsi level
Tx/rx levels
Client count by bands

Commands used to find the above

My set up is in my signature

Thanks





Sent from my SM-G955F using Tapatalk
 
Last edited:
you can try my extStats script, but be warned, its written on my RT-AX88U and i have no clue if its working on your router.
actually it in alpha stage, absolutly no testing have been done from others.

https://github.com/corgan2222/extstats

Hi

I got your script running on a RT-86u and having a few problems. Quite a few scripts fail and after a few days the system resource of my router is suffering and requires a reboot

My system swap space slowing fails away

Screenshot 2021-02-15 at 09.15.29.png


The number of processes increased until the CPU is maxed out



Screenshot 2021-02-15 at 09.15.13.png



Running the scripts in test I get errors like this

Choose an option: t5

extstats:mod_trafficAnalyzer: Update import
extstats:mod_trafficAnalyzer: date: 1613403537
extstats:mod_trafficAnalyzer: startdate: 1613399937
extstats:mod_trafficAnalyzer: Export Traffic Analyser into InfluxDB. 159 entrys

/jffs/addons/extstats.d/mod_trafficAnalyzer.sh: line 215: python: not found

Press enter to continue...



Could you please help ? I'm more than happy to test but need a few pointers as I'm 100% sure how it works

Many Thanks
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Members online

Top