syschk command
.mdThe syschk BASIC program checks a system running under UNIX to detect abnormal situations.
For Windows: Not Supported
Syntax
syschk keyword{=value} {...} {(options}
Parameter(s)
| start | Starts the syschk command running as a phantom with the same argument as the last time it was started. If necessary, the process is stopped before it is restarted. If the process was never started, a set of defaults is applied. | |
| edit | Enters the Update processor to allow editing the arguments used by the start command. Note that if any edits are made to the arguments, the syschk process needs to be stopped and restarted for the edits to take affect. | |
| now | Instructs the syschk phantom process to take a sample immediately, and sends the anomaly messages, if any, to the terminal requesting the sample, instead of the normal notify mechanism. | |
| stop | Stops the syschk command running as a phantom. | |
| options | a | Logs a short summary of all error messages to the
errors file. The initial swap
space control is always logged, and can be specified by
using the |
| f | Starts syschk in foreground on the current process, as opposed to a phantom process. With this option, the only way to stop the process is to do a break/end, or a logoff. | |
| l | Logs a short summary of the error messages to the
errors file. The initial swap
space control is always logged, and can be specified by
using the |
|
| q | Quiet option suppresses the user messages (for example, started, stopped). | |
| v | Verbose option can be used if syschk runs in the foreground, instead of a phantom. | |
The syschk command uses UNIX system commands, such as
sar, ps, and some others. If the
process that executes this command does not have root privilege, it might
be necessary to change the permissions of the required utilities to make
these commands work.
If the syschk command fails to access a system parameter, an
error message, such as: Cannot get swap usage, is sent to
the system administrator. See the following error messages. Usually,
changing the set user-ID bit gives adequate permissions to
the tools.
For example, to run sar as non-root on AIX:
chmod 06755 /usr/sbin/sar chmod 06755 /usr/lib/sa/sadc
AIX: ’lsps -a/’ Linux: !cat /proc/meminfo |grep Swap
This command can use some very intrusive UNIX commands. Do not run it with a sampling period less than a few minutes.
Description
The UNIX parameters are obtained through a variety of more or less UNIX-dependent commands. Often, on a given UNIX version, there might be several ways of obtaining the information. Therefore, results shown by syschk might differ from results provided by other UNIX tools and be very difficult to compare to results given by another system.
For example, a given application might prompt the syschk
command to complain about heavy CPU usage on a UNIX platform and not on another,
all other factors being equal (if this is possible). When a UNIX device is
specified in the notify parameter, the messages are written
asynchronously on the device, even if it is not logged on to either UNIX or D3.
It is a good idea to specify the UNIX console as a notify device.
Error Message Types
Could not get the swap information. These are the UNIX commands used:
Cannot get swap usage: syschk
These are the UNIX commands used:
Cannot get real memory: syschk
AIX: ’lsattr -l sys0 -E’ Linux: !cat /proc/meminfo |grep Memtotal
Could not get information on the currently active processes. On all systems, this is obtained by a ps -ef.
Cannot get proc list: syschk
Could not get information on the UNIX file systems. On all systems, this information is obtained by some form of df. The most common errors involve a remote file system, which is unreachable.
Cannot get FS: syschk
Example(s)
Example 1
This example starts a phantom process to check the system every 30 minutes for a CPU system usage above 10%, a swap usage above 60% and a process runaway limit of 10%.
- UNIX terminal /dev/tty0
- D3 user bob if he is logged on
- Line 0, whether it is logged on or not
syschk sampling=00:30:00 syscpu=10% notify=/dev/tty0,bob,!0 swapusg=60% proccpu=10% log
Example 2
This example logs syschk messages to the errors file and uses syschk edit to set the check period to 30 seconds. After starting syschk with the A option, run the following program:
fin=1 loop while fin do repeat
You will see messages logged every 30 seconds logged about CPU usage.
Example 3
This example checks whether syschk is running:
syschk syschk is running on port 132 Started on 03/11/94 at 08:20:21 Current running parameters: Sampling period 00:30:00 Notify list /dev/tty0 bob !0 Maximum system CPU % 10 Maximum CPU % per process 25 Maximum % of swap 60 Maximum % of overflow 90 UNIX file systems / Log messages (0=no;1=yes) 1 Current System Status: User CPU usage 3% System CPU usage 11% Waiting for IO 82% Idle CPU 4% Total swap space 128 Mb Used swap space 76 Mb (59%)
Example 4
This example stops the phantom running syschk as a background process, suppressing the message stopped. This command could be included in the user-shutdown macro.
syschk stop (q
Example 5
This example restarts the syschk phantom with the same parameters.
syschk start
Example 6
This example edits the syschk command line to change the arguments. Use the Update processor command to edit the command line.
syschk edit