sadm_nmon_watcher.py

2 minute read

This script is automatically run from the client crontab every 45 minute. It check if the performance collector ‘nmon’ is running, it it isn’t it will start it.

NAME

sadm_nmon_watcher.py
This script ensure that ‘nmon’ performance monitor is running.

SYNOPSIS

sadm_nmon_watcher.py [-d 0-9] [-h] [-v]
$SADMIN/bin/sadm_nmon_watcher.py - v1.5
Posted 2021-06-25 - Updated 2023-10-18
Supported on Linux
Can be executed on a client and on the SADMIN Server.

DESCRIPTION

This script is automatically run from the client crontab every 45 minute. It check if the performance collector ‘nmon’ is running, it it isn’t it will start it.

Back to the top

EXAMPLE

# sadm_nmon_watcher.sh 
================================================================================
Tue 29 Jun 2021 10:35:10 AM EDT - sadm_nmon_watcher.sh V2.7 - SADM Lib. V3.70
Server Name: ubuntu2104.maison.ca - Type: LINUX
UBUNTU 21.04 Kernel 5.11.0-22-generic
==================================================
 
[OK] Yes, 'nmon' is available (/usr/bin/nmon)
 
There is 1 nmon process actually running
     1	root     4005672       1  0 00:00 ?        00:00:04 /usr/bin/nmon -f -s120 -c719 -t -m /opt/sadmin/dat/nmon
 
Nmon already Running ... Nothing to Do.
 
Last nmon files created
-rw-rw-r-- 1 sadmin sadmin 649832 Jun 28 23:56 ubuntu2104_210628_0000.nmon
-rw-r--r-- 1 root   root   318130 Jun 29 10:34 ubuntu2104_210629_0000.nmon
 

==================================================
Script exit code is 0 (Success) and execution time is 00:00:10
History (/opt/sadmin/dat/rch/ubuntu2104_sadm_nmon_watcher.rch) trim to 35 lines ($SADM_MAX_RCLINE=35).
Script will send an alert only when it terminate with error ($SADM_ALERT_TYPE=1).
Script succeeded, no alert will be send to 'default' alert group.
Log /opt/sadmin/log/ubuntu2104_sadm_nmon_watcher.log trim to 500 lines ($SADM_MAX_LOGLINE=500).
End of sadm_nmon_watcher.sh - Tue 29 Jun 2021 10:35:11 AM EDT
================================================================================

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
sadmin.cfg SADMIN main configuration file
sadm_nmon_rrd_update.sh Daily performance database update
sadm_server crontab It execute everything that keep SADMIN running smoothly
sadm_client crontab Collect perf. & system information, run system monitor and housekeeping
sadm_nmon_watcher.sh If performance collector (nmon) is not running, start it.

Tags:

Categories:

Updated: