smon (sadm_sysmon_cli.sh)

4 minute read

This command line tool (smon), will run the System Monitor on then current system and show the content of the SysMon report file. It will also show any script error or warning your have on the current system. So by running this command, you have a pretty good status of any pending status on the current system.

NAME

smon (sadm_sysmon_cli.sh)
Allow you run SysMon and see the report file

SYNOPSIS

smon (sadm_sysmon_cli.sh) [-d 0-9] [-h] [-v]
$SADMIN/bin/smon (sadm_sysmon_cli.sh) - v2.3
Posted 2021-06-15 - Updated 2021-06-15
Supported on Linux, Aix, MacOS
Can be executed on a client and on the SADMIN Server.

DESCRIPTION

This command line tool (smon), will run the System Monitor on then current system and show the content of the SysMon report file. It will also show any script error or warning your have on the current system. So by running this command, you have a pretty good status of any pending status on the current system.

Back to the top

EXAMPLE

~ # smon
Creating lock file /sadmin/sysmon.lock
Loading SADMIN configuration file /sadmin/cfg/sadmin.cfg
------------------------------------------------------------------------------
SADMIN SYStem MONitor Tools - Version 2.43
------------------------------------------------------------------------------
O/S Name                 = linux
Debugging Level          = 5
SADM_BASE_DIR            = /sadmin
Hostname                 = holmes
Virtual Server           = N
CMD_SSH                  = /bin/ssh
------------------------------------------------------------------------------

Loading SysMon configuration file /sadmin/cfg/holmes.smon
File /sadmin/cfg/holmes.smon loaded in sysmon_array (274 lines loaded)

Checking for new filesystems ...
No new filesystem detected

Checking CPU Load Average ...
Uptime line:  10:09:42 up 22 days,  2:53,  2 users,  load average: 0.14, 0.16, 0.17
Load Average is at 0 - W: 20 E: 35

Checking CPU Usage ...
CPU Usage line:   0  0 325888 2774076  15272 2664484    0    0     0     4  424  781  0  0 100  0  0

CPU User:   0 - System:   0  - Total:   0
 - Warning Level: 85 - Error Level: 95

Checking Swap Space ...
Swap Info Line: Swap:       7340024      325888     7014136
Swap size: 7340024 - Usage: 325888 - Percentage use: 4 %

Checking service crond,cron
  - service crond status ... [RUNNING]
[OK] Service is running - Total returned (1)

Checking service chronyd
  - service chronyd status ... [RUNNING]
[OK] Service is running - Total returned (1)

Checking service ssh,sshd
  - service sshd status ... [RUNNING]
[OK] Service is running - Total returned (1)

Checking service postfix
  - service postfix status ... [RUNNING]
[OK] Service is running - Total returned (1)

Checking service at,atd
  - service atd status ... [RUNNING]
[OK] Service is running - Total returned (1)

Checking Multipath ...Status of Multipath skipped - Command multipathd not present on system
Multipath status is not in use - Code = (1) (1=ok 0=Error)
[OK] Filesystem / at 39% ... Warning: 85 - Error: 90
[OK] Filesystem /usr at 72% ... Warning: 85 - Error: 90
[OK] Filesystem /boot at 53% ... Warning: 85 - Error: 90
[OK] Filesystem /wiki at 5% ... Warning: 85 - Error: 90
[WARNING] Filesystem /wsadmin at 82% ... Warning: 80 - Error: 90
Automatic filesystem increase script 'sadm_fs_incr.sh' not specified in /sadmin/cfg/holmes.smon.
Therefore filesystem increase will not be performed.
[OK] Filesystem /backups at 64% ... Warning: 85 - Error: 90
[OK] Filesystem /psadmin at 4% ... Warning: 85 - Error: 90
[OK] Filesystem /storix at 12% ... Warning: 85 - Error: 90
[OK] Filesystem /opt at 71% ... Warning: 85 - Error: 90
[OK] Filesystem /tmp at 1% ... Warning: 85 - Error: 90
[OK] Filesystem /sysadmin at 9% ... Warning: 85 - Error: 90
[OK] Filesystem /linternux at 4% ... Warning: 85 - Error: 90
[OK] Filesystem /var at 27% ... Warning: 85 - Error: 90
[OK] Filesystem /sadmin at 39% ... Warning: 85 - Error: 90
[OK] Filesystem /home at 55% ... Warning: 85 - Error: 90
[OK] Filesystem /install at 6% ... Warning: 85 - Error: 90
[OK] Filesystem /gitrepos at 10% ... Warning: 85 - Error: 90
[OK] Filesystem /history at 1% ... Warning: 85 - Error: 90

-----
Updating SADM Sysmon configuration file (/sadmin/cfg/holmes.smon)
Deleting SYStem MONitor lock file /sadmin/sysmon.lock
#SYSMON 2.43 holmes - Last Boot: 2021-05-28 07:16:27 - Sat Jun 19 10:09:43 2021 - Execution Time 1.00 seconds

SysMon Command line output

Back to the top

OPTIONS

Options Description
[ -d 0-9 ] Set debug level from 0 to 9 (Default is 0)
[ -h ] Display this help and exit.
[ -v ] Output version information and exit.

ENVIRONMENT

  • The “$SADMIN” environment variable must be defined and contains the root directory of the SADMIN tools (normally /opt/sadmin). It should be already done, the setup script have updated the ‘/etc/profile.d/sadmin.sh’ and the ‘/etc/environment’ files.
  • The SADMIN configuration file, is needed and loaded in memory at the beginning of every scripts. This file should already exist and contains your SADMIN configuration and preference setting.
  • For Shell script the Shell Library is used and for Python script the Python Library is used.

EXIT STATUS

Exit Code Description
0 An exit status of zero indicates success.
1 Failure is indicated by a nonzero value, typically ‘1’.

AUTHOR

Jacques Duplessis
Any suggestions or bug report can be submitted at the support page

Copyright © 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
This is free software, you are free to change and redistribute it.
There is NO WARRANTY to the extent permitted by law.

SEE ALSO

Link to … Description
sview View summary of alerts & failed scripts of all your servers
sadmin.cfg SADMIN main configuration file
sadm_sysmon.pl Client system monitor
SysMon configuration file Client System Monitor configuration file
sdf sadmin version of the ‘df’ command
sadm System Administration Tools Menu
smon Allow you run SysMon and see the report file