NetXMS Support Forum

English Support => General Support => Topic started by: chidex on May 08, 2025, 03:01:36 AM

Title: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: chidex on May 08, 2025, 03:01:36 AM
Hi

Am trying to replicate this dashboard https://netxms.org/documentation/adminguide/_images/grafana-alarm-browser.png by making API calls. Am able to get some data in but I cant see any API that retrieves the node name. All I see is the object ID as seen below. Is  there a way to get it to show the actual device name and not just ID. This is my API http://x.x.x.x:8080/webapi/alarms
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: Tatjana Dubrovica on May 09, 2025, 03:12:26 PM
Hi,
There are two options.

Our old Grafara plugin had it's own data point (that is still present and works): 
/grafana/alarms
Call examples:
/grafana/alarms - gives object id to object name 
/grafana/alarms?targets=[{}] - will return all alarms
grafana/alarms?targets=[{"alarmSource":{"id":108}}] - to get alarms for object with id 108
You can add as many elements with required object ids in array needed: [{"alarmSource":{"id":108}}, {"alarmSource":{"id":512}}, ...]
 
Another option is to add parameter resolveReferences=true to webapi/alarms request like: http://x.x.x.x:8080/webapi/alarms?resolveReferences=true 
This parameter adds full information about alarm source node, source event name and names of users if possible to resolve. 
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: chidex on May 09, 2025, 05:52:00 PM
Hi Tatjana,

Thank you soooo much. it worked. I resorted to using option 2 since I am using newer version of grafana and it does appear the plugin is deprecated on newer grafana version
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: Tatjana Dubrovica on May 09, 2025, 07:04:53 PM
First endpoint also just works without Grafana plugin (it just provides data in human readable way).
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: chidex on May 10, 2025, 12:17:35 AM
Thank you. I had thought is particular to the plugin. It made more sense now. Trying this out. Appreciate the input.
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: chidex on May 22, 2025, 12:09:07 PM
Quote from: Tatjana Dubrovica on May 09, 2025, 07:04:53 PMFirst endpoint also just works without Grafana plugin (it just provides data in human readable way).
Thank you for the support Tatjana Dubrovica (https://www.netxms.org/forum/profile/?u=54493). I have successfully retrieved the Alarms via API on grafana. I was wondering if I can do same to retrieve the following via API. Are there limitations? I cant find any clue on the API documentations.

1. DCI
2. Status Map
3. Device interfaces as it is on NetXMS UI and hardware inventory
4. Maps - the nice map showing real time statistics of link and interface states

If not supported via API, can it be done by querying the postgres database directly?
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: Tatjana Dubrovica on May 23, 2025, 02:32:06 PM
Hi. Happy that I helped you.

For DCI data please check this request:
https://netxms.org/documentation/adminguide/rest-api.html#dci-values

This is my example of configuration:
URL: http://10.5.5.111:8000/v1/objects/108/data-collection/183/history
UTL query params:
   timeFrom $__from/1000
   timeTo $__to/1000
Root: values


For status map I'm not sure how it can be created with help Ifinity plugin but check API that returns array with objects: https://netxms.org/documentation/adminguide/rest-api.html#get-multiple-objects-with-filters

The only option for maps as for now is to create link in NetXMS that afterwards will be used in IFrame plugin to insert it to the dashboard.
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: Tatjana Dubrovica on June 06, 2025, 01:36:39 PM
There is new blog post about Grafana/NetXMS integration. Maybe object queries might help you with interface display options.
Post:
https://netxms.com/blog/grafana-configuraiton-in-netxms
Title: Re: Using Web API to retrieve NetXMS Alarm data in Grafana
Post by: chidex on June 07, 2025, 11:20:34 AM
Quote from: Tatjana Dubrovica on June 06, 2025, 01:36:39 PMThere is new blog post about Grafana/NetXMS integration. Maybe object queries might help you with interface display options.
Post:
https://netxms.com/blog/grafana-configuraiton-in-netxms
Wow, Wow..Thank you so much Tatjana Dubrovica. This is a life saver. I have struggled working with infinity plugin to get all the things I want. Though I have made a little progress, the blog post provides a lot more granular insight. I really do appreciate this..