sadm_database_update.py

Updated: 2018/11/29
O/S : Aix, Linux, MacOS

 
NAME

sadm_database_update.py  -  Update SADMIN database with information collected the Daily Farm Fetch

 
SYNOPSIS

sadm_database_update.py     [ -v -h  ]    [ -d   0-9  ]   

 
DESCRIPTION
  • Update the SADMIN server database with all information collected the Daily Farm Fetch.
  • All the information updated in the server database is taken from the System information file.
    • All information included in the System Information file can by viewed in SADMIN Web interface.

    Example of the content of System Information File (${SADMIN}/dat/dr/${hostname}_sysinfo.txt).
    
        # cat $SADMIN/dat/dr/centos7_sysinfo.txt
        # Home of SysAdmin - SysInfo Report File - Thu Nov 21 23:25:12 EST 2019
        # This file is use to update the SADMIN server inventory.
        #
        SADM_OS_TYPE                          = LINUX
        SADM_UPDATE_DATE                      = 2019-11-21 23:25:12
        SADM_HOSTNAME                         = centos7
        SADM_DOMAINNAME                       = maison.ca
        SADM_HOST_IP                          = 192.168.1.140
        SADM_SERVER_TYPE [V]irtual [P]hysical = V
        SADM_OS_VERSION                       = 7.7.1908
        SADM_OS_MAJOR_VERSION                 = 7
        SADM_OS_NAME                          = CENTOS
        SADM_OS_CODE_NAME                     = Core
        SADM_KERNEL_VERSION                   = 3.10.0-1062.4.3.el7.x86_64
        SADM_KERNEL_BITMODE (32 or 64)        = 64
        SADM_SERVER_MODEL                     = VM
        SADM_SERVER_SERIAL                    =
        SADM_SERVER_MEMORY (in MB)            = 3789
        SADM_SERVER_HARDWARE_BITMODE          = 64
        SADM_SERVER_NB_CPU                    = 1
        SADM_SERVER_CPU_SPEED (in MHz)        = 2800
        SADM_SERVER_ARCH                      = x86_64
        SADM_SERVER_NB_SOCKET                 = 1
        SADM_SERVER_CORE_PER_SOCKET           = 2
        SADM_SERVER_THREAD_PER_CORE           = 1
        SADM_SERVER_IPS                       = ens192|192.168.1.140|255.255.255.0|00:0c:29:b3:81:eb
        SADM_SERVER_DISKS (Size in MB)        = sda|43929
        SADM_SERVER_VG(s) (Size in MB)        = rootvg|40448|28222|12226
        SADM_OSUPDATE_DATE                    = 2019.11.18 04:39:26
        SADM_OSUPDATE_STATUS                  = S
        SADM_ROOT_DIRECTORY                   = /opt/sadmin
        #
        


    Web view of the information that is updated every morning by this update script.



    Sample of the script log, it show exactly what the script is doing.
    
        2018.11.29 05:06:20 - =====================================================================
        2018.11.29 05:06:20 - Starting sadm_database_update.py V3.4 - SADM Lib. V2.23
        2018.11.29 05:06:20 - Server Name: holmes.maison.ca - Type: Linux
        2018.11.29 05:06:20 - O/S: Centos  7.5.1804 - Code Name: Core
        2018.11.29 05:06:20 - ==================================================
        2018.11.29 05:06:20 -  
        2018.11.29 05:06:20 - ----------------------------------------
        2018.11.29 05:06:20 - PROCESSING ALL ACTIVES SERVERS
        2018.11.29 05:06:20 - 
        2018.11.29 05:06:20 - ----------------------------------------
        2018.11.29 05:06:20 - Processing (1) centos6.maison.ca - os:centos
        2018.11.29 05:06:20 - Processing file : /sadmin/www/dat/centos6/dr/centos6_sysinfo.txt
        2018.11.29 05:06:20 - Updating centos6.maison.ca data in Database
        2018.11.29 05:06:20 - [OK] centos6 update Succeeded
        2018.11.29 05:06:20 - 
        ...
        ...
        2018.11.29 05:06:20 - ----------------------------------------
        2018.11.29 05:06:20 - Processing (23) yoda.maison.ca  - os:ubuntu
        2018.11.29 05:06:20 - Processing file : /sadmin/www/dat/yoda/dr/yoda_sysinfo.txt
        2018.11.29 05:06:20 - Updating yoda.maison.ca data in Database
        2018.11.29 05:06:20 - [OK] yoda update Succeeded
        2018.11.29 05:06:21 -  
        2018.11.29 05:06:21 - ==================================================
        2018.11.29 05:06:21 - Script return code: 0
        2018.11.29 05:06:21 - Script execution time is 00:00:01
        2018.11.29 05:06:21 - Trim /sadmin/dat/rch/holmes_sadm_database_update.rch to 125 lines.
        2018.11.29 05:06:21 - Mail requested if script fail - No mail sent
        2018.11.29 05:06:21 - Trim /sadmin/log/holmes_sadm_database_update.log to 2000 lines.
        2018.11.29 05:06:21 - Thu Nov 29 05:06:21 2018 - End of sadm_database_update.py
        2018.11.29 05:06:21 - =====================================================================
        2018.11.29 05:06:21 -  
        

 
OPTIONS

-d
Specify debug level (0-9).
Value of 0 indicate that no debug information is to be displayed.
-h
Display this help and exit.
-v
Output version information and exit.



REQUIREMENTS
 
EXIT STATUS
[0]    An exit status of zero indicates success
[1]    Failure is indicated by a nonzero value, typically ‘1’.

 
AUTHOR
Jacques Duplessis (jacques.duplessis@sadmin.ca.).
Any suggestions or bug report can be sent at http://www.sadmin.ca/support.php

 
COPYRIGHT
Copyright © 2018 Free Software Foundation, Inc. License GPLv3+:
    - GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
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   (This is the script that execute this script every morning)
sadm_daily_farm_fetch.sh   (Get all systems information files generated the SADM client)
sadm_backupdb.sh   (Do a backup of SADMIN Database)


 
INDEX
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
REQUIREMENTS
EXIT STATUS
AUTHOR
COPYRIGHT
SEE ALSO

Copyright © 2015-2019 - www.sadmin.ca - Suggestions, Questions or Report a problem at support@sadmin.ca