set_alarm_ranges()
Set the range for the alarm conditions for a particular application or parameter.
Syntax
Parameter
Parameter | Definition |
---|---|
new_ranges | newline-separated list of alarm range settings The first element of the list is the setting for the border alarm, the second element is for the first alarm zone (Alarm1), and the third element is for the second alarm zone (Alarm2). |
param | name of the parameter that is monitored |
appl | either the name of the application or the application instance objectid |
param_oid | optional parameter objectid |
path | optional path to the parameter |
Description
The set_alarm_ranges() function sets the range for the alarm conditions for a particular application or parameter.
Although param and appl are required, they can be "" if param_oid or path or both are supplied.
Calls to the set_alarm_ranges() function that specify the param and appl parameters without the param_oid and path parameters set the alarm ranges for the parameter class and affect all parameter instances of that class.
However, calls to the set_alarm_ranges() function that specify the param_oid and path parameters set the alarm ranges for that particular parameter instance and do not affect the alarm ranges for other instances of that class.
Return Value
The function returns the string "not found" if the parameter class cannot be found. Otherwise, it returns a number indicating which ranges were correctly set. The binary representation of the number should be considered. If the first bit is set, then the setting of the first range (border alarm range) has failed. If the second bit is set, the setting of the Alarm1 range has failed, and so on.
Note
The console's knowledge may not be a true reflection of the knowledge in the agent if this function is used. The consoles do gather alarm range information from the agent, but the agent sends it only when a parameter is drilled down on. Therefore, if the console has an open graph and the alarm ranges are subsequently changed by theset_alarm_ranges() function, then the range information displayed in the graph will not be updated until the graph is popped down and drilled into again.
Example
The following example changes the alarm ranges for the /NT_EVLOGFILES/NT_EVAPP/ELMEvFileFreeSpacePercent parameter, but does not change /NT_EVLOGFILES/NT_EVSEC/ELMEvFileFreeSpacePercent or /NT_EVLOGFILES/NT_EVSYS/ELMEvFileFreeSpacePercent.
result=set_alarm_ranges(new_ranges,"","","",
"/NT_EVLOGFILES/NT_EVAPP/ELMEvFileFreeSpacePercent");
The following example changes the alarm ranges for all three parameters: /NT_EVLOGFILES/NT_EVAPP/ELMEvFileFreeSpacePercent, /NT_EVLOGFILES/NT_EVSEC/ELMEvFileFreeSpacePercent, and /NT_EVLOGFILES/NT_EVSYS/ELMEvFileFreeSpacePercent.
result=set_alarm_ranges(new_ranges,"ELMEvFileFreeSpacePercent",
"NT_EVLOGFILES");
The following example shows how to use the object ID to set the alarm ranges of a parameter:
oid = get("/NT_PHYSICAL_DISKS/DISK_0/PDpdDiskTimePercent/objectId");
printf("oid = %d\n", oid);
result = set_alarm_ranges(new_ranges, "", "", oid,
"/NT_PHYSICAL_DISKS/DISK_0/PDpdDiskTimePercent");