IBM Support

How to setup an AIX mousetrap / AIX errnotify

How To


Summary

This document describes how one can set up a mousetrap / AIX error notification.

Objective

This document describes how one can set up a mousetrap, which is useful in several situations where a kernel trace is needed (or other elements), but has to be stopped as soon as a specific AIX errlog entry is generated (to avoid having a wrapped trace file).

Environment

Steps

We are covering this technique by using an example on the AIX errlog entry named J2_FSCK_REQUIRED.
But this can be applied on any errlog entry, which can be displayed by the command:
# errpt -t
1. Create a file /tmp/my_errnotify, containing the following text:
errnotify:
       en_name = "mousetrap"
       en_label = "J2_FSCK_REQUIRED"
       en_method = "/usr/bin/trcstop"
The "en_method" will set the action to be performed when the errlog entry is generated, so you can use a simple command, as in this example, but one can even set a shell script that can do more complex actions.

2. Activate it:
# odmadd /tmp/my_errnotify
Everything is already set up by now for the error notification.
Since in this example we are covering the stop of a kernel trace, so of course one need to start a kernel trace, which will automatically be stopped when encountering the error we trap, so in this case when hitting a J2_FSCK_REQUIRED.
A typical starting point for a kernel trace would be as 
# trace -anl -C all -T10M -L200M -o /<filesystem_with_free_space>/trace.raw

3. When the problem is re-created, and you don't need anymore the error notification to be used, to delete the mousetrap:
# odmdelete -o errnotify -q "en_name = mousetrap"

 

Document Location

Worldwide

[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z0000001fMuAAI","label":"AIX General Support"},{"code":"a8m0z000000cvyeAAA","label":"Filesystem"},{"code":"a8m0z000000cw0FAAQ","label":"IO Device Drivers"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Document Information

Modified date:
07 October 2020

UID

ibm16340629