The nzevent command
You use the nzevent command to manage the alerts and triggers for problem and condition reporting.
Use the nzevent command to do any of the following tasks:
- Show a list of event rules.
- Copy a predefined template event rule and use it as your source to add a rule.
- Modify an existing event rule or a copied predefined template.
- Add an event rule.
- Delete an event rule.
- Generate events.
Syntax
The nzevent command uses the following
syntax:
nzevent [-h|-rev|-hc] subcmd [subcmd options]
Inputs
The nzevent command takes the following inputs:
Input | Description |
---|---|
nzevent add options | Adds an event rule. |
nzevent copy options | Copies a predefined template event rule or an existing event rule. |
nzevent delete options | Deletes an event rule. |
nzevent generate options | Generates an event. |
nzevent listEventTypes options | Lists the valid event types. |
nzevent listNotifyTypes options | Lists the notification types. |
nzevent modify options | Modifies an event rule. |
nzevent show options | Displays the event rules. |
Options
The nzevent command takes the following options:
Command | Option | Description |
---|---|---|
All nzevent commands | -u user | Specifies the database user name [NZ_USER]. |
-pw password | Specifies the user password [NZ_PASSWORD]. | |
-host name | Specifies the host name or IP address [NZ_HOST]. | |
-timeout secs | Specifies the time to wait before it exits with a timeout error (default = 300). Does not apply to listEventTypes and listNotifyTypes. | |
nzevent add nzevent copy nzevent modify |
-eventType type | Specifies the event type for the event. For a list of the event types, see Table 1. |
-eventArgsExpr expr | Specifies the optional match expression for further filtering. For more information, see Table 1. | |
-name value | If you are adding an event, specifies the event rule name. If you are copying an event, specifies the name of the event you are copying. If you are modifying an event, specifies the name of the event that you are changing. | |
-newname value | If you are modifying or copying an event, specifies the name of the new event. | |
-useTemplate | If you are copying an existing event, uses the rule that is specified with the -name option as a template for this new rule. | |
-notifyType type | Specifies the type of notification to generate for this event. The notify types are email and runCmd. Starting from 11.2.1.9, the notify types are email, runCmd, and platform. | |
-dst value | Specifies the notification destination (notify-type specific). For email, it is the email address. For runCmd, it is the full path of the command or command file to run. | |
-ccDst value | Specifies additional notification destinations (email only). | |
-msg string | Specifies the notification message to send. For email, this is the subject string and cannot be blank. For runCmd, this is the argument for -msg parameter. | |
-bodyText string | Specifies more text to send with the notification message. | |
-callHome bool | Specifies whether to append system information to the notification message. For email, the system sends /nz/kit/data/config/callHome.txt as an attachment. This file contains customer information such as company, address, contact, and system information such as model number, and serial number. For runCmd, the system passes the file path to the command. | |
-on bool | Enables or disables processing for this rule. | |
-eventAggrCount int | Specifies the number of events to aggregate (email events only). You can specify a number from 1 - 1000. | |
nzevent delete | -force | Does not prompt for confirmation. |
-name rule_name | Deletes the event rule <rule_name>. | |
nzevent generate | -eventType type | Generates the specified type of event. For a list of the event types, see Table 1. |
-eventArgs expr | Specifies a list of one or more optional event arguments (<tag>=<value>, ...). | |
-force | Flushes all aggregate events and sends a notification (email only). | |
nzevent show | -name rule_name | Displays only the event rule corresponding to the rule_name. If you do not specify a name, the command displays all event rules. |
-syntax | Displays the rule in CLI syntax. | |
-maxColW chars | Specifies the maximum number of characters to print in each output table column. The default is 24 characters. | |
-orient type | You can specify the output display. The value values are
|
|
-caCertFile path | Specifies the path name of the root CA certificate file on the client system. This argument is used by Netezza Performance Server clients who use peer authentication to verify the Netezza Performance Server host system. The default value is NULL, which skips the peer authentication process. | |
-securityLevel level | Specifies the security level that you want to use for the session. This option does not apply
when you are logged in to the Netezza Performance Server
system and running the command. The argument has four values:
|
Description
The nzevent command does the following:
- Privileges required
- Your database user account must have Manage System privilege.
- Common tasks
- Use the nzevent command to set the preconfigured event rules, and to create your own event rules.
Usage
The following provides some sample usage:
- To add an event rule,
enter:
nzevent add -name Newrule -u admin -pw password -host nzhost -on yes -eventType sysStateChanged -eventArgsExpr ‘$previousState == online && $currentState != online’ -notifyType email -dst jdoe@netezza.com -msg ‘NPS system $HOST went from $previousState to $currentState at $eventTimestamp.’ -bodyText ‘$notifyMsg\n\nEvent:\n$eventDetail\nEvent Rule:\n$eventRuleDetail’
- To copy a template event rule from the template table to the user-modifiable table, enter:
nzevent copy -u admin -pw password -useTemplate -name HostNoLongerOnline -on yes -dst jdoe@netezza.com
- To delete an event rule,
enter:
nzevent delete -u admin -pw password -host nzhost -name Newrule
- To generate an event rule, enter:
nzevent generate -u admin -pw password -host nzhost -eventtype custom1 -eventArgs ‘customType=tooManySessions, numSessions=<n>’
- To list event types, enter:
nzevent listEventTypes
- To list notification types, enter:
nzevent listNotifyTypes
- To modify an existing event rule, enter:
nzevent modify -u admin -pw password -host nzhost -name Newrule -on yes -dst jdoe@netezza.com
- To display a specific event rule, enter:
nzevent show -u admin -pw password -host nzhost -name Newrule
- To display event rules vertically, enter:
nzevent show -u admin -pw password -host nzhost -orient vertical