Managing the KSYS notifications

After you add the contact details to the KSYS configuration for the first time, you can modify it later depending on the changing requirements.

To modify the contact information, use the following commands:
ksysmgr modify notify oldcontact=old_username newcontact=new_username
ksysmgr modify notify oldcontact=old_email_address newcontact=new_email_address
For example, to change the user name of John to Dave, and to change the email address, enter the following command:
ksysmgr modify notify oldcontact=John newcontact=Dave
ksysmgr modify notify oldcontact=john@gmail.com newcontact=dave@gmail.com
To delete all the contact information for a specific user, use the following command:
ksysmgt delete notify user=username
For example,
ksysmgt delete notify user=John
To query all the registered contact details, use the following command:
ksysmgr query notify contact
The output might be similar to the following example:
User:            Mark Smith
Contact:       mike@mike.com

User:            joe
Contact:       joe@gmail.com

Running scripts for specific events

You can create scripts for specific events. When an event occurs, you can enable the script to be run as part of the event. By using scripts, you not only get notified for a specific event, but you can also collect details about the event, take corrective actions, and handle the processes after the event completion. For more information about scripts, you can refer to the event script samples that are located in the /opt/IBM/ksys/samples/event_handler/event_script_template directory.

You must specify the full path of the script to add a script for notification configuration. When the event occurs, the KSYS subsystem validates the existence and the authorization of the scripts.

To add a script, use the following command:
ksysmgr add notify script=script_file_path_name events=event_name
For example,
ksysmgr add notify script=/tmp/script.sh events=HMC_DOWN
To modify a script, use the following command:
ksysmgr modify notify oldscript=old_script_file_path_name newscript=new_script_file_path_name
For example,
ksysmgr modify notify oldscript=/tmp/script.sh newscript=/tmp/newscript.sh
To remove a script, use the following command:
ksysmgr delete notify script=script_file_path_name
For example,
ksysmgr delete notify script=/tmp/script.sh
To query a script, use the following command:
ksysmgr query notify script

Notification message

Even if you set the KSYS configuration to not receive any event notifications, the messages are logged in the /var/ksys/events.log notification log file. An example of the notification message follows:
HMC_DOWN event has occurred. Details are as follows: 
     Event:              HMC_DOWN
     Type:               Critical Error Event
     Time:               Tue Jul 19 00:35:32 CDT 2016
     Entity Affected:    HMC
     Resource Affected:  vmhmc1
     Description:        0000-132 Error - HMC x.x.x.x is down.
     Suggestion:         Please try to restart.