Add an event rule

You can use the nzevent add command to add an event rule.

Adding an event rule consists of two tasks: specifying the event match criteria and specifying the notification method. These tasks are described in more detail after the examples.

Note: Although the z-series events are not templates on IBM® Netezza® 1000 or N1001 systems, you can add them by using nzevent if you have the syntax that is documented in the previous releases. However, these events are not supported on IBM Netezza 1000 or later systems.
To add an event rule that sends an email when the system transitions from the online state to any other state, enter:
nzevent add -name TheSystemGoingOnline -u admin -pw password 
-on yes -eventType sysStateChanged -eventArgsExpr '$previousState 
== online && $currentState != online' -notifyType email -dst -msg 'NPS system $HOST went from $previousState to 
$currentState at $eventTimestamp.' -bodyText 
Note: If you are creating event rules on a Windows client system, use double quotation marks instead of single quotation marks to specify strings.