Rest API for interface information like IP

Started by cfuchs12345, June 13, 2023, 10:11:13 AM

Previous topic - Next topic
June 13, 2023, 10:11:13 AM Last Edit: June 14, 2023, 08:44:34 AM by cfuchs12345
Hi,

I wrote a small tool to manage my servers at home from one central point.
The tool is able to show data that my systems offer by an API (Proxmox, Docker, Pihole and so on).
Since I also got OPNSense running, I wanted to squeeze more information out of OPNSense , but I didn't find a way to get some data like the current interface status, connections speed and IP and so on by the REST API.


For Proxmox, I get a lot of information and can control more or less everything.
Would be nice to end up with something similar for OPNSense:
https://github.com/cfuchs12345/server-manager/blob/main/main_screen.png

Maybe someone could give me a hint how to get more useful information out of OPNSense - without having to write my own Agent that is running on the system?

At the moment I only have this:

https://github.com/cfuchs12345/server-manager/blob/main/opnsense.png

Would be also nice to get some data for the monitoring/graphs, that the tool can visualize


Regards,
Chris

PS: It is the first time, that I link it somewhere, so it is only used by myself so far. The tool is changing more or less daily. You can use it, but it might break due to it's early development state at any time. This is just a side-project where I wanted to learn some new stuff like Typescript, Angular, Rust and so on.

What about using a standard protocol like SNMP and a tool like Observium?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Hi,
I know that there are a lot of tools that can be used to monitor systems like OPNSense.
The thing is, I wanted to reduce the number of systems/tools that I use.

Before, I had one app for each task - a WakeOnLan WebGUI, CheckMK, Heimdall, all the GUIs for the system itself to control them (OpnSense GUI, Proxmox GUI, Tasmota).

For my homelab I felt this is overkill and I wanted to get all the functionality that I need in one place. Where I can switch my power-outlets for my 3D Printers, restart a Proxmox VM, trigger an Update, start a Server by WoL, send it to sleep and so on.

Besides that, it is fun to develop and I learned Rust, Angular and such things in parallel.

So yes, for the sake of getting data out of OpnSense, I know there are ways. But I wanted to integrate it into my app  :)

I wonder the same.

Want to use an ESP32 with an LCD screen to output metrics. Like public ip WAN in/out etc..

What options are there to get metrics out from opnsense, could not see anything in rest api's docs either.

Opnsense Grafana dashboard seem to use telegraf/influxdb so maybe this is the way to go? Would be nicer with fewer moving parts though :)