sadm_cfg2html.sh

4 minute read

NAME

sadm_cfg2html.sh
Get system configuration information and create a HTML web pages with it.

SYNOPSIS

sadm_cfg2html.sh [-d 0-9] [-h] [-v]
$SADMIN/bin/sadm_cfg2html.sh - v3.9
Posted 2021-06-01 - Updated 2022-07-28
Supported on Linux, Aix
Can be executed on a client and on the SADMIN Server.

DESCRIPTION

This script is use to generate a system information web page that is accessible via the SADMIN web interface. To generate this web page, we use the open source project “cfg2html”. The HTML page produced, include the collection of Cron and At, installed Hardware, installed Software, Filesystems, Dump- and Swap-configuration, LVM, Network Settings, Kernel, System enhancements and Applications, Subsystems. As of now, this script doesn’t support MacOS operating system.

Files produced by the script

root@raspi8:~  # cd $SADMIN/dat/dr
root@raspi8:/opt/sadmin/dat/dr  # ls -l cfg2html*
-rw-rw-r-- 1 sadmin sadmin   2846 Jun  3 14:54 cfg2html_raspi8.err
-rw-rw-r-- 1 sadmin sadmin 752477 Jun  3 14:54 cfg2html_raspi8.html
-rw-rw-r-- 1 sadmin sadmin      0 Jun  3 14:54 cfg2html_raspi8.partitions.save
-rw-rw-r-- 1 sadmin sadmin 724874 Jun  3 14:54 cfg2html_raspi8.txt
root@raspi8:/opt/sadmin/dat/dr  # 

To view cfg2html page, choose the server you want and click on “cfg2html” button sadm_cfg2html_button

Here is an example of report that was generated for a raspberry pi.

Back to the top

EXAMPLE

# sadm_cfg2html.sh 
================================================================================
Thu 28 Jul 2022 12:52:08 - sadm_cfg2html.sh v3.10 - Library v4.03
Desc: SADMIN template shell script
Host: sherlock.maison.ca - User: root - Arch: x86_64 - SADMIN: /opt/sadmin
Almalinux Linux release 9.0 - Kernel 5.14.0-70.17.1.el9_0.x86_64
==================================================
 
cfg2html-linux version 2.99-2015/04/06 // Linux 5.14.0-70.17.1.el9_0.x86_64 x86_64
Running : /usr/bin/cfg2html -H -o /opt/sadmin/dat/dr
Return code of the command is 0.

==================================================
Script exit code is 0 (Success) and execution time is 00:00:32
History file '$SADMIN/dat/rch/sherlock_sadm_cfg2html.rch' trim to 35 lines.
Script is set to send an alert only when it terminate with error.
Script succeeded, no alert will be send ($SADM_ALERT_TYPE=1).
New log created '$SADMIN/log/sherlock_sadm_cfg2html.log'.
End of sadm_cfg2html.sh - Thu 28 Jul 2022 12:52:35 PM 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

sadm_fetch_clients.sh - rsync all .rch/.log/.rpt from actives clients to the SADMIN server.
sadm_requirements.sh - List/install required SADMIN tools packages
sadm_sysmon_tui.pl - Command line summary of alerts and failed scripts of all your servers.
sadm_daily_report - Produce and email monitoring daily reports sadm_template.sh - Using SADMIN shell script template
sadm_template.py - Using SADMIN python script template
sadm_template_menu.sh - Using SADMIN shell menu template
sadm_wrapper.sh - Use to run your existing scripts & benefit of SADMIN tools
sadmlib_std.sh - SADMIN standard shell library
sadmlib_std.py - SADMIN standard python library
sadmlib_screen.sh - SADMIN screen oriented library
sadmlib_std_demo.sh - SADMIN shell library functions demo
sadmlib_std_demo.py - SADMIN python library functions demo
SADMIN installation - SADMIN installation page
How-to Add a client - How-to add a client to SADMIN inventory
How-to Remove a client - How-to remove a client from SADMIN inventory
sadm_uninstall.sh - Uninstall the SADMIN tools
sadm_push_sadmin.sh - Push SADMIN version to one or all actives clients
How-to update SADMIN - How-to update to latest version of SADMIN
sadm_service_ctrl.sh - Enable, Disable and get status of system startup and shutdown script
sadm_backup.sh - Backup based on the content of the backup list & exclude file
sadmin.cfg - SADMIN main configuration file
sadm_server-sunrise.sh - Collect & process data produced by all actives clients
sadm_server_housekeeping.sh - Enforce security SADMIN Web interface & crontab files sadm_daily_farm_fetch.sh - Collect Hardware/Software/Performance data from actives servers
sadm_database_update.py - Take data collected from clients and update database
sadm_nmon_rrd_update.sh - Daily performance database update
sadm_subnet-lookup.py - Scan network selected subnet & store info in database
sadm_backupdb.sh - Backup one or all MySQL/MariaDB databases on the system
sadm_client_sunset.sh - Clients end of day housekeeping and producing system information files
sadm_client_housekeeping.sh - Purge old log,rch,nmon files and check $SADMIN permission
sadm_create_sysinfo.sh - Collect hardware & software information about the system
System Information File - Documentation about the system information file
sadm_dr_savefs.sh - Save system filesystems information in order to recreate them from scratch. sadm_cfg2html.sh - Get System information and creates a HTML web page of it.