Hi!
I have a issue with the alerts API (/api/v1/alerts?state=X), the issue is that when I do a GET method for this I get very limited amount of information. I’m using the API within a Python script to collect data from a customers LibreNMS to generate a report containing alerts from the previous week. However I need more information than which device is alerting, which rule it’s alerting on and at which time. I really need which component within the device that is alerting such as which port, which VLAN, BGP peer and so on
This is the information I recieve:
"alerts": [
{
"hostname": "X.X.X.X",
"id": 83,
"device_id": 13,
"rule_id": 6,
"state": 1,
"alerted": 1,
"open": 0,
"note": "",
"timestamp": "2024-07-06 13:16:04",
"info": "{\"until_clear\":false}",
"severity": "warning"
}
],
To try to solve this I also in run a get method towards the rule ID to get limited information about the alert, but I get no port and so on. I was thinking about using transports where Libre sends out information towards a database of sorts which the script then collects data from, but this is sort of a last solution for me.
If anyone knows of a better solution for this please feel free to share it!
Br,
Linus