The Error Notification object class specifies the conditions and actions to be taken when errors are recorded in the system error log. The user specifies these conditions and actions in an Error Notification object.
Each time an error is logged, the Error Notification daemon determines if the error log entry matches the selection criteria of any of the Error Notification objects. If matches exist, the daemon runs the programmed action, also called a notify method, for each matched object.
The Error Notification object class is located in the /etc/objrepos/errnotify file. Error Notification objects are added to the object class by using Object Data Manager (ODM) commands. Error Notification objects contain the following descriptors:
|en_alertflg|| Identifies whether the error is alertable. This descriptor is provided for use by alert agents associated with network management applications. The valid alert descriptor values are:
|en_class|| Identifies the class of the error log entries to match. The valid en_class descriptor values are:
|en_crcid||Specifies the error identifier associated with a particular error.|
|en_label||Specifies the label associated with a particular error identifier as defined in the output of the errpt -t command.|
|en_method|| Specifies a user-programmable action, such as a shell script or command string, to be run when an error matching the selection criteria of this Error Notification object is logged. The error notification daemon uses the sh -c command to execute the notify method.
|en_name||Uniquely identifies the object. The creator uses this unique name when removing the object.|
|en_persistenceflg|| Designates whether the Error Notification object should be automatically removed when the system is restarted. For example, to avoid erroneous signaling, Error Notification objects containing methods which send a signal to another process should not persist across system restarts. This is because the receiving process and its process ID do not persist across system restarts.
The creator of the Error Notification object is responsible for removing the Error Notification object at the appropriate time. In the event that the process terminates and fails to remove the Error Notification object, the en_persistenceflg descriptor ensures that obsolete Error Notification objects are removed when the system is restarted.
|en_pid||Specifies a process ID (PID) for use in identifying the Error Notification object. Objects which have a PID specified should have the en_persistenceflg descriptor set to 0.|
|en_rclass||Identifies the class of the failing resource. For the hardware error class, the resource class is the device class. The resource error class is not applicable for the software error class.|
|en_resource||Identifies the name of the failing resource. For the hardware error class, a resource name is the device name.|
|en_rtype||Identifies the type of the failing resource. For the hardware error class, a resource type is the device type a resource is known by in the devices object class.|
|en_symptom||Enables notification of an error accompanied by a symptom string when set to TRUE.|
|en_type|| Identifies the severity of error log entries to match. The valid en_type descriptor values are:
|TRUE|| Matches alertable errors.
|0|| Removes the Error Notification object at system restart.
Only processes running with the root user authority can add objects to the Error Notification object class.
errnotify: en_name = "sample" en_persistenceflg = 0 en_class = "H" en_type = "PERM" en_rclass = "disk" en_method = "errpt -a -l $1 | mail -s 'Disk Error' root"To add the object to the Error Notification object class, enter:
odmadd /tmp/en_sample.addThe odmadd command adds the Error Notification object contained in /tmp/en_sample.add to the errnotify file.
odmget -q"en_name='sample'" errnotifyThe odmget command locates the Error Notification object within the errnotify file that has an en_name value of "sample" and displays the object. The following output is returned:
errnotify: en_pid = 0 en_name = "sample" en_persistenceflg = 0 en_label = "" en_crcid = 0 en_class = "H" en_type = "PERM" en_alertflg = "" en_resource = "" en_rtype = "" en_rclass = "disk" en_method = "errpt -a -l $1 | mail -s 'Disk Error' root"
odmdelete -q"en_name='sample'" -o errnotifyThe odmdelete command locates the Error Notification object within the errnotify file that has an en_name value of "sample" and removes it from the Error Notification object class.
Error Logging Overview in AIX Version 4.3 Problem Solving Guide and Reference.
Error Logging Special Files in AIX Version 4.3 Files Reference.
The errdemon daemon in AIX Version 4.3 Commands Reference.
The errclear command, errdead command, errinstall command, errlogger command, errmsg command, errpt command, errstop command, errupdate command, odmadd command, odmdelete command, odmget command in AIX Version 4.3 Commands Reference.
The errlog subroutine in AIX Version 4.3 Technical Reference: Base Operating System and Extensions Volume 1.
The errsave kernel service in AIX Version 4.3 Technical Reference: Kernel and Subsystems Volume 1.