I am getting CPU details with their respective thresholds so is it possible to assign these values as alarm threshold for these parameters. for example, cpu load is 50 and threshold I receive 75 so is possible to alert an alarm after load equals that value.
Hi Chirangee,
I recommend creating an alarm template for your element first. Once it's set up, you can use the AlarmTemplateHelper to dynamically adjust the thresholds for your desired parameters.
You can then extract the row you want from the template and edit the thresholds. Something like this (pseudo code):
AlarmTemplateHelper alarmTemplateHelper = new AlarmTemplateHelper(engine.SendSLNetMessages);
AlarmTemplateID alarmTemplateID = new AlarmTemplateID(YourAlarmTemplateName, DesiredProtocol, DesiredVersion);var alarmTemplateRows = new List<AlarmTemplateRow>();
----
var parameterValue = CreateResponseMessage(normalValue, minorHigh, minorLow, displayKey);
alarmTemplateRows.Add(new AlarmTemplateRow
{
ID = new AlarmTemplateRowID(DesiredParamReadPid, null, displayKey),
Condition = null,
ParameterValues = parameterValue,
});----
private static GetAlarmTemplateResponseMessage CreateResponseMessage(string normalValue, string minorHigh, string minorLow, string displayKey = null)
{
return new GetAlarmTemplateResponseMessage
{
ID = ReadPidOfDesiredParameter,
CH = string.Empty,
CL = string.Empty,
MaH = string.Empty,
MaL = string.Empty,
MiH = minorHigh,
MiL = minorLow,
WaH = string.Empty,
WaL = string.Empty,
Info = string.Empty,
Normal = normalValue,
Monitored = true,
Filter = displayKey,
};
}alarmTemplateHelper.MergeAlarmTemplateRowsOnServer(alarmTemplateID, alarmTemplateRows);
When using the AlarmTemplateHelper, there’s a method called MergeAlarmTemplateRow that updates the specific row for your chosen parameter within an alarm template.
The alarm template itself is an XML file located at C:\Skyline DataMiner\Protocols
To dynamically adjust your alarm template thresholds as new information becomes available, you’ll need to use the AlarmTemplateHelper. This will allow you to modify threshold values in real-time, ensuring your parameters stay updated with the latest data.
where I need to write these updates.