4.6 Condition Functions (formula.conditions)

Operations Center element conditions and alarm severities have assigned values. Table 4-2 lists the default values.

Table 4-2 Default Values for Element Condition and Alarm Severities

Condition/Severity

Numeric Value

CRITICAL

1

MAJOR

2

MINOR

3

UNKNOWN

0

INFORMATIONAL

4

OK

5

UNMANAGED/INITIAL

6

Using NOC Script you can retrieve and set conditions and severities. The following two sections describe functions related to element condition and alarm severities:

4.6.1 conditions

Operations Center elements allow for the retrieval and setting of their conditions. This property of the object exists as an associative array of conditions that can access the actual condition value used by Operations Center.

In the following example, we list all available conditions on elements in no specific order:

js> for( var p in formula.conditions )
   writeln( p )
0
UNKNOWN
2
4
3
1
5
6
7
UNMANAGED
8
CRITICAL
MINOR
USAGE_BUSY
9
INFORMATIONAL
USAGE_IDLE
OK
MAJOR
USAGE_ACTIVE

Both numeric and textual lookups can be performed using formula.conditions. For example:

js> formula.conditions.OK
OK
js> formula.conditions.MAJOR
MAJOR
js> formula.conditions[3]
MINOR
js>

4.6.2 severities

Operations Center’s alarms allow for the retrieval and setting of severity. This property of the formula object exists as an associative array of severities which can be used to access the actual severity value used by Operations Center. The following example shows both numeric and textual lookups:

js> writeln( formula.severities.MINOR )
MINOR
js> writeln( formula.severities[3] )
MINOR
js> writeln( formula.severities.OK )
OK
js>