Netezza event

Reading Time: 4 minutes

How to backup all NzEvents in one go?

Here is the easy way to take a backup of Netezza events. Create a shell script with content (shown below) and execute the script. The script will create a file named backup_nzevent_DATETIME which will have a create NzEvent script for all the events in your NPS system.

IFS=

Once script is created run chmod 775 scriptname.sh on Linux prompt to make it executable else script may not run.

This script will also be useful if you have to make mass changes to all the Netezza events like send email address list change, enable disable events, etc.

How to Aggregate Netezza event messages?

We can aggregate Netezza event messages which are set to send email but cannot set this for Netezza events which calls a command/script when triggered. Aggregation of events can be configured either at server level or per event level.

To set at server level, we have to follow below steps:
1) Pause the system
nzsystem pause

2) Run below command to setup system parameter. We can set a value from 0 – 82400 seconds
nzsystem set -arg sysmgr.maxAggregateEventInterval=120

3) Start the system
nzsystem resume

To check if this setting is enabled at instance level we can run below command:
nzsystem showRegistry | grep maxAggregateEventInterval

Since the above step needs outage to set this at server level, we can always set this at per event level aslo. If we set at event level, then it will be from 1 – 1000 occurances of events and not time based.

nzevent modify -u admin -pw password -name TestEvent -on yes -dst abc@company.com -eventAggrCount 10

Above example will set the notification to 10 occurances. To set back to one occurrence set eventAggCount to 1.

When the aggregate events occur, system will write to /nz/kit/log/eventmgr/eventmgr.log for each time the evnet is triggered but will send email only when eventAggCount (at event level) or maxAggregateEventInterval (at system level) is reached. If both are enabled then which ever parameter is reached 1st will trigger the email.

Message Header 
Host : servername
Event : Hardware Disk Full.
Event Rule Detail : $threshold == 80 || $threshold == 85.
Start : 10-30-10 01:11:15 CDT.
Reporting Interval : 20 minutes.
Activity Duration : 00:01:37.
Number of events : 17

See, Number of events value in the email. These many events were aggregated in last 20 minutes (1200 sec)

\n’
for LINE in `nzevent -syntax`; do
echo “nzevent add ${LINE}” >> backup_nzevent_`date +%Y%m%d%H%M%S`.log
doneOnce script is created run chmod 775 scriptname.sh on Linux prompt to make it executable else script may not run.

This script will also be useful if you have to make mass changes to all the Netezza events like send email address list change, enable disable events, etc.

How to Aggregate Netezza event messages?

We can aggregate Netezza event messages which are set to send email but cannot set this for Netezza events which calls a command/script when triggered. Aggregation of events can be configured either at server level or per event level.

To set at server level, we have to follow below steps:
1) Pause the system
nzsystem pause

2) Run below command to setup system parameter. We can set a value from 0 – 82400 seconds
nzsystem set -arg sysmgr.maxAggregateEventInterval=120

3) Start the system
nzsystem resume

To check if this setting is enabled at instance level we can run below command:
nzsystem showRegistry | grep maxAggregateEventInterval

Since the above step needs outage to set this at server level, we can always set this at per event level aslo. If we set at event level, then it will be from 1 – 1000 occurances of events and not time based.

nzevent modify -u admin -pw password -name TestEvent -on yes -dst abc@company.com -eventAggrCount 10

Above example will set the notification to 10 occurances. To set back to one occurrence set eventAggCount to 1.

When the aggregate events occur, system will write to /nz/kit/log/eventmgr/eventmgr.log for each time the evnet is triggered but will send email only when eventAggCount (at event level) or maxAggregateEventInterval (at system level) is reached. If both are enabled then which ever parameter is reached 1st will trigger the email.

Message Header 
Host : servername
Event : Hardware Disk Full.
Event Rule Detail : $threshold == 80 || $threshold == 85.
Start : 10-30-10 01:11:15 CDT.
Reporting Interval : 20 minutes.
Activity Duration : 00:01:37.
Number of events : 17

See, Number of events value in the email. These many events were aggregated in last 20 minutes (1200 sec)