Automated Central Reporting

Many organizations wish to create and store asset inventory and system configuration data in a central location. This can be useful for audits, disaster recovery planning, building a web page of system reports, and many other uses.

Automated Central Reporting with SysInfo Agent

If you have installed the SysInfo Agent (the default) you can write a script to poll each system and retrieve the requested data. Here's a sample sh(1) script which should run on most UNIX systems:

#!/bin/sh
#
# Run SysInfo Reports on the hosts given on the command line.
#

# Dir where reports are saved to
ReportDir=$HOME/SysInfoReports

if [ ! -d "$ReportDir" ]; then
    mkdir "$ReportDir"
fi

echo "Reports will be saved into $ReportDir"

for host in $* ; do
    echo "Creating report for $host . . ."
    mcsysinfo --host $host --nw --encode html \
	--class general,hardware,partition,network,netif,software \
	> $ReportDir/${host}.html
done

The following example shows how to create reports for several hosts using this script:

host% ./autoreport.sh sneezy doby winey
Reports will be saved into /home/john/SysInfoReports
Creating report for sneezy
Creating report for doby
Creating report for winey

Automated Central Reporting without SysInfo Agent

If you have not installed the SysInfo Agent on each system as part of the default installation, you'll need to run the SysInfo command on each host you wish to collect a report from.

On UNIX based systems (including Linux and Mac), you can use the cron scheduler to run SysInfo reports on each system. The results of this report could be saved to a central network location via NFS or CIFS. Alternatively, you could email the results to a collections mailbox for further processing.

Let's take the example of storing the data to a central network server via NFS. On each system you wish to run a report, you would create a cron job that looks something like the following:

0 4 * * * root /opt/sysinfo/bin/mcsysinfo --nw --encode html \
          --class general,hardware,software,partition,network,netif \
          --output /net/server/sysinfodata/sysinfo-`hostname`.html

In this example, the report would be run once per day at 4am and the data would be saved in HTML format to the file /net/server/sysinfodata/sysinfo-`hostname`.html where `hostname` is replaced with the name of the host the report is run on.

The same report could be sent via email using a cron command such as this:

0 4 * * * root /opt/sysinfo/bin/mcsysinfo --nw --encode html \
          --class general,hardware,software,partition,network,netif \
          | mail -s "SysInfo Report" [email protected]