This chapter describes the commands that you need to use to manage event notifications.
The rule commands let you configure email notifications to be sent when specific types of events occur in the N1 Grid Service Provisioning System software.
The following table summarizes the CLI commands for managing rules for notifications.
Table 12–1 Summary of the rule Commands
Command |
Description |
---|---|
rule.add |
Adds a notification rule. |
rule.del |
Deletes a notification rule. |
rule.la |
Lists all notification rules. |
rule.lo |
Retrieves a specific rule. |
rule.mod |
Modifies an existing rule. |
This command adds a new rule for sending email notifications.
Table 12–2 Arguments and Result for the rule.add Command
Argument/Result |
Syntax |
Description |
|
---|---|---|---|
n |
[R] |
String |
The rule name |
d |
[O] |
String |
The rule description |
tf |
[O] |
CriteriaShorthand |
The rule event type filter |
mf |
[O] |
String |
The rule message filter |
haf |
[O] |
HostIDArray |
The rule hosts filter |
hsf |
[O] |
HostSetID |
The rule host set filter |
sf |
[O] |
String |
The rule severity filter. Possible values are INFO, WARNING, and ERROR. In addition, the severity may end with +, which means this severity or greater. For example, WARNING+ corresponds to events with severity WARNING or ERROR. |
ea |
[R] |
String |
The email address to notify |
result |
RuleMetaData |
The new rule |
The following table lists the keywords you can pass with the -tf argument to specify the type of event a rule applies to.
Table 12–3 CriteriaShorthand for the -tf Argument
Criteria Shorthand |
Event |
---|---|
any |
Any event |
planStart |
A plan starts |
planEndAbnormal |
A plan ends abnormally |
planEndNormal |
A plan completes normally |
cmpStart |
A comparison starts |
cmpEndAbnormal |
A comparison ends abnormally |
cmpEndNormal |
A comparison completes normally |
system |
Any system event |
admin |
Any administrative event |
custom |
Any custom events |
This command deletes the specified rule.
Table 12–4 Argument for the rule.del Command
Argument |
Syntax |
Description |
|
---|---|---|---|
ID |
[R] |
RuleID |
The rule ID |
This command lists all the rules defined in the N1 Grid Service Provisioning System software.
Table 12–5 Result of the rule.la Command
Result |
Syntax |
Description |
---|---|---|
result |
RuleMetaDataArray |
The rules |
This command retrieves a rule, which is specified by its ID.
Table 12–6 Argument and Result for the rule.lo Command
Argument/Result |
Syntax |
Description |
|
---|---|---|---|
ID |
[R] |
RuleID |
The rule ID |
result |
RuleMetaData |
The rule |
This command modifies the specified attributes of an an existing rule. Omitted arguments preserve current values.
Table 12–7 Arguments and Result for the rule.mod Command
Argument/Result |
Syntax |
Description |
|
---|---|---|---|
ID |
[R] |
RuleID |
The rule ID |
n |
[O] |
String |
The rule name |
d |
[O] |
String |
The rule description |
tf |
[O] |
CriteriaShorthand |
The rule event type filter |
mf |
[O] |
String |
The rule message filter |
haf |
[O] |
HostIDArray |
The rule hosts filter |
hsf |
[O] |
HostSetID |
The rule host set filter |
sf |
[O] |
String |
The rule severity filter |
ea |
[O] |
String |
The email address to notify |
result |
RuleMetaData |
The modified rule |