I bought a TP-Link TL-SG105E, which is a “Easy Smart Managed” switch that supports a variety of “smart” features. One would assume it supports SNMP, right? Well, you’d be wrong, just like I was. However, this switch has a web user interface that takes basic username/password authentication and provides statistics including individual port traffic.
I’d like to write a script to scrape the web interface and provide its data to LibreNMS. I’ve considered writing a SNMP server, but that would necessarily show up as a separate device with a different IP address than the real host and would cause 2 devices to show up in LibreNMS for the one switch (one w/ stats, one w/ basic up/down information).
What options do I have for getting it into LibreNMS?
Long story short, there is no solution out of the box to have a complete integration like SNMP devices would provide.
You could write a custom discovery and poller code, that would collect data and feed the database/rrd, but it would be almost impossible to maintain for you (and would not be accepted in LibreNMS unless you almost rewrite all discovery and polling code in a ProtocolAgnostic version …)
I think you could register the switch in LibreNMS by ICMP (Ping) and then link this resource in the form of services to obtain the statistics.
It’s not the most “beautiful” but it would surely work.
I think what @aleferrari mentions is the best that can be done. I explored the API but there is no way to add custom ports or provide port data from the API. Due to that, the best that can be done is add it as ICMP-only.
I’m not going to develop any custom service at this time.