Is there currently a way using the SDK to get the list of categories and priorities from here?
I tried using this code, but sometimes “PriorityValues” and “CategoryValues” is an empy, and we only get the GUID of the selected pririty or category.
How can we make sure we get the available values?
MS = new ManagementServer(SiteItem.FQID.ServerId);
var alarms = MS.AlarmDefinitionFolder.AlarmDefinitions.Select(x => x.Name).ToList();
var priorities = MS.AlarmDefinitionFolder.AlarmDefinitions.SelectMany(x => x.PriorityValues.Select(y => y.Value)).Distinct().ToList();
var categories = MS.AlarmDefinitionFolder.AlarmDefinitions.SelectMany(x => x.CategoryValues.Select(y => y.Value)).Distinct().ToList();
The ability to read and manage these fields was introduced with the new Alarm API (currently in 2023R3 this is in beta).
See - https://doc.developer.milestonesys.com/mipvmsapi/api/alarms-rest/v1/#tag/Alarm-Categories
You cannot get to this in the Configuration API. You can extract their usage in Alarm Definitions which is the code you show but not read the fields directly. Only in the new Alarms Rest API you can read these tables/fields directly.
OK thanks, do you have any idea why the alarm definitions on one server provide the priorityValues, but on another identical similar server (2023R3 with hotfixes) the PriorityValues are empty?
For example, I am connecting the SDK to FED1 (top of the federation) and the priorities are empty, but when I check the alarm definitions in FED2 (federated to FED1), the priorities AND categories are available, even thought there is no selected Category for the Alarm Definition:
I have a test server where I get no categories. the one where you do get categories is that another version? Please give me details on the version if not the exact same..
Per default there are no alarm categories, please double check if you have defined alarm categories. You will have to use thee Management Client to check this.
Yes that is what confused me.
I have indeed added custom categories to both servers.
The only thing that seems consistant is that if the priorities are not populated alarm definition data, the categories won’t be there either. Both servers are 2023R2.
I have another couple of servers in a similar configuration, but in 2023R3. On those servers I can’t see the prios or cats on any of them.
I have never seen the Priorities not being populated. I have never seen the Categories not being populated, but had a setup where I forgot to create them prior to testing. Those servers where you cannot see Priorities and Categories, I am sort of hoping that there are errors in the logs or something else special you can find in troubleshooting.
Hmm OK I will check MIP logs and event server logs. Any other logs I should check?
On general Configuration API there could be something in the Management Server logs, but we suspect that for this there will be nothing there..