set_alarm_ranges()


Set the range for the alarm conditions for a particular application or parameter.

Syntax

set_alarm_ranges(new_ranges,param,appl,[param_oid],[path])

 

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). 
Each element of the list is in the following the format: active min max trigger max_occ state 
active = 1 or 0 indicating whether the alarm is active 
min = integer indicating the minimum of the zone 
max = integer indicating the maximum of the zone 
trigger = integer indicating how many times the parameter value must be in the range before triggering 0 immediately on alarm 1 after alarm has occurred n times 2 after all recovery actions fail 
max_occ = maximum number of times the alarm occurs 
state = 0(OK) or 1(WARN) or 2(ALARM) indicating what action occurs

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.

 

new_ranges= "1 0 100 0 0 2\n1 5 10 0 0 1\n1 10 100 0 0 2";
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.

 

new_ranges= "1 0 100 0 0 2\n1 5 10 0 0 1\n1 10 20 0 0 2";
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:

new_ranges = "0 1 100 0 0 0\n0 80 90 0 0 0\n0 91 100 1 0 2";
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");

 

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*