sadm_database_update.py

2 minute read

NAME

sadm_database_update.py
Take system information collected files from clients and update database

SYNOPSIS

sadm_database_update.py [-d 0-9] [-h] [-v]
$SADMIN/bin/sadm_database_update.py - v3.13
Posted 2021-05-29 - Updated 2021-06-03
Supported on Linux
Can only be run on SADMIN Server.

DESCRIPTION

The function of this script is to read the system information file that was produced by each client and to update the corresponding system in SADMIN database. This script is run automatically every morning by the sadm_server-sunrise.sh script.

Back to the top

EXAMPLE

# sadm_database_update.py 
================================================================================
Starting sadm_database_update.py V3.12 - SADM Lib. V3.18
Server Name: holmes.maison.ca - Type: Linux
O/S: Centos  7.9.2009 - Code Name: Core
==================================================
 
Processing all actives systems

----------------------------------------
Processing (1) borg.maison.ca  - os:ubuntu
Reading sysinfo file : /sadmin/www/dat/borg/dr/borg_sysinfo.txt
Updating borg.maison.ca data in Database
[OK] borg update Succeeded

----------------------------------------
Processing (2) centos6.maison.ca - os:centos
Reading sysinfo file : /sadmin/www/dat/centos6/dr/centos6_sysinfo.txt
Updating centos6.maison.ca data in Database
[OK] centos6 update Succeeded
...
...
---------------------------------------
Processing (10) imac.maison.ca  - os:macosx
Reading sysinfo file : /sadmin/www/dat/imac/dr/imac_sysinfo.txt
Updating imac.maison.ca data in Database
[OK] imac update Succeeded
...
...
----------------------------------------
Processing (25) yoda.maison.ca  - os:fedora
Reading sysinfo file : /sadmin/www/dat/yoda/dr/yoda_sysinfo.txt
Updating yoda.maison.ca data in Database
[OK] yoda update Succeeded
 
==================================================
Script return code: 0
Script execution time is 00:00:02
Trim /sadmin/dat/rch/holmes_sadm_database_update.rch to 35 lines.
Alert requested if script fail.
Trim /sadmin/log/holmes_sadm_database_update.log to 500 lines.
Sun May 30 11:45:43 2021 - End of sadm_database_update.py
================================================================================

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

sadm_server-sunrise.sh - Collect & process data produced by all actives clients
sadm_server_housekeeping.sh - Purge old log,rch,nmon files and check $SADMIN permission
sadm_daily_farm_fetch.sh - Collect Hardware/Software/Performance data from actives servers
sadm_fetch_clients.sh - rsync all .rch/.log/.rpt from actives clients to the SADMIN server.
sadm_create_sysinfo.sh - Collect hardware & software information about the system
sadmin.cfg - SADMIN main configuration file