search
top

Gathering Open Systems System information with cfg2html

As systems administrators we are always wanting a way to gather information on your Open Systems, you can do this with various different systems commands and add them in scripts and set as cron jobs, or whatever method you prefer.

Now if there is a program that can do that for us and output in txt or html or both, then thats better. Well, such a program does exist call cfg2html (http://tech.groups.yahoo.com/group/cfg2html/).

According to the site:
Cfg2html is a UNIX shell script that creates a HTML (and ASCII) system documentation for HP-UX 10+11++, AIX, SCO-UX, SunOS and Linux systems. Plugins for SAP, Oracle, Informix, MC/SG, FibreChannel, TIP/ix, Mass Storage like XP48/128/256/512/1024/1×000, EVA3000-EVA8000, Network Node Manager and OmniBack/DataProtector etc. are included.

So were do I get it and how does it work?
URL: http://www.cfg2html.com/

Current version: http://www.cfg2html.com/cfg2html-linux-2.50-20120601_all.zip

Download and unzip the zipped installation files and install it.

$ sudo yum localinstall -y cfg2html-linux-2.50-2.noarch.rpm

Now that cfg2html is installed run it with root privileges to generate the files. We need to pass -o for the output directory, otherwise it will create the files in the directory you execute the command.

[mlinux@mhlinux3 /]$ sudo cfg2html -o /etc/cfg2html

--=[ http://come.to/cfg2html ]=-----------------------------------------------
Starting          cfg2html-linux version 2.50-2012-06-01
Path to Cfg2Html  /usr/bin/cfg2html-linux
HTML Output File  /etc/cfg2html/mhlinux3.td.afg.html
Text Output File  /etc/cfg2html/mhlinux3.td.afg.txt
Partitions        /etc/cfg2html/mhlinux3.td.afg.partitions.save
Errors logged to  /etc/cfg2html/mhlinux3.td.afg.err
Started at        2012-08-14 13:21:27
WARNING           USE AT YOUR OWN RISK!!! :-))           
--=[ http://come.to/cfg2html ]=-----------------------------------------------

Collecting:  Linux System (Fedora release 16 (Verne))  ......................
Collecting:  Cron and At  ...........
Collecting:  Hardware  .....................
Collecting:  Software  .......
Collecting:  Filesystems, Dump- and Swapconfiguration  ..........
Collecting:  LVM  ............
Collecting:  Network Settings  ...................................
Collecting:  Kernel, Modules and Libraries  ..............
Collecting:  System Enhancements  ..
Collecting:  Applications and Subsystems  ...........
Collecting:  Custom plugins  .
Collecting:  Local files  .

--=[ http://come.to/cfg2html ]=-----------------------------------------------

Output files are stored in /etc/cfg2html in text and html format.

Add to /etc/cron.monthly
Now let’s create a script and place it in /etc/cron.monthly and have it email it to us. Let’s call it collect_config.sh.

#!/bin/bash
MAILTO=admins@mycompany.com
/usr/bin/cfg2html -o /etc/cfg2html
cat /etc/cfg2html/*.txt|mail -s "cfg2html `uname -n`" $MAILTO

That’s all there is to it!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

top