gatherinfo: Get Useful Information About UNIX/Linux System


01:43 | 0 Comments


I recently came across HP Universal Discovery software but its very complicated, requires separete server and database and is far from complete when it comes to gather data from the UNIX and Linux systems.

So I sit one day and thought what information about a system You need to tell that You know enought about it and that You can take responsibility for its uptime ... and of course how to fast end efficently gather that information from a running system.

After several hours I already had a prototype which gather information about UNIX and Linux systems, without idea for a better name I end up with gatherinfo. Its simple script gatherinfo.sh with dependency on POSIX sh(1) and echo/cat/sed, all other commands are used to gather info from the running system. The result of the script is report-like HTML file named gatherinfo.sh.$( hostname ).htm with outputs of the desired commands.

As script is running it shows which command is now being processed, so You know why it may take that much time, usually its work is done in less then a minute. And yes, it does need to run as root.

# gatherinfo.sh
top -d 1
sockstat
ps ax
ps aux
ps auxwww
ps auxefw
pstree -A
pstree -A -a
lsof
cat /etc/hostid
cat /etc/freebsd-update.conf
grep enable /etc/rc.conf
kldstat
kldstat -v
jls
vmstat 1 5
(...)

And the end result looks like that one below. You can expand/collapse each command so its not several kilemeters long ;)





Of course its far from complete after two days of messing with it, but I will add more and more useful commands.

Currently it gathers information from FreeBSD and Linux but my personal TODO contains operating systems like AIX, Solaris, HP-UX and of course other BSDs. On the other side I will also add cluster and/or HA software like FreeBSD's HAST/CARP, Linux RHCS, Oracle Clusterware, Sun Cluster, HP Serviceguard and AIX PowerHA. Also various Veritas storage and HA sollutions are on my TODO list.

I have created https://github.com/vermaden/gatherinfo repository for the development.

Feel free to submit your favorite commands ;)




Post a Comment