machstat (AIX)
From Wikistix
AIX 5.1
The below information is taken from the script /etc/rc.powerfail.
On AIX 5.1, /usr/sbin/machstat -f returns a shell exit code representing the power status. The lower 4 bits are the error code, the upper 4 bits are bits 10-13 of the PKSR register. This only applies to systems of type "rspc", as returned by bootinfo -T.
# /usr/sbin/machstat -f; ret=$? # error=$(($ret % 16)) # state1=$(($ret / 16)) # echo "Error: $error, state1: $state1" Error: 0, state1: 2
state1 | Description |
---|---|
0 | normal operation |
1 | non-critical cooling problem |
2 | non-critical power problem |
3 | severe cooling problem |
4 | severe power problem |
AIX 5.2+
The below information is taken from the script /usr/lib/boot/bin/rc.powerfail_chrp.
On AIX 5.2 and later /usr/sbin/machstat -f writes to stdout two (AIX 5.2) or three (AIX 5.3) integers, being the power and cooling status bits. The first is the "EPOW Event" and the second is the "Modifier".
Eg:
# /usr/sbin/machstat -f 2 0 0
Meanings for the EPOW Event are:
EPOW | Modifier | Description |
---|---|---|
0 | normal operation | |
1 | non-critical cooling problem | |
2 | non-critical power problem | |
3 | 1, 3 or 4 | severe power problem, immediate shutdown |
3 | 0 or 2 | severe power problem, system will shutdown after wait time |
4 | severe problems, immediate shutdown | |
5 or 7 | unhandled issue |
See Also
- machstat manpage for AIX 5.3.
- rc.powerfail manpage for AIX 5.3.