#!/bin/sh
# config2xml.sh
# Author : AR (alex@raclot.org)
#
# .~.
# /V\ -- GnuPG plublic key ---------------
# // \\ http://www.raclot.org/gnupg/alex.asc
# ( ) ------------------------------------
# ^^-^^
VERSION=2006031501
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
PROG=`basename $0`
DIR=`dirname $0`
# http://cvs.savannah.gnu.org/viewcvs/*checkout*/config/config/config.guess
OS=`./config.sh`
HOST=`uname -n | cut -d. -f1`
PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
###
ISROOT=0
if id | grep root > /dev/null
then
ISROOT=1
fi
###
usage() {
cat <<EOF >&2
Usage: $prog [options]
EOF
exit 1
}
###
#touch ARCH
#(
#cat ARCH
#echo $OS
#) | sort | uniq > ARCH.tmp && mv ARCH.tmp ARCH
###
(
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"
echo
echo "<config2xml>"
echo
echo "<version>"$VERSION"</version>"
echo
) > $HOST.xml
(
echo "<date>`date '+%d/%m/%y'`</date>"
echo "<hostname>$HOST</hostname>"
echo "<os>$OS</os>"
echo
) >> $HOST.xml
###########
# general #
###########
(
case $OS in
*-linux-gnu)
echo "<hard>PC</hard>"
M=`grep MemTotal /proc/meminfo | awk '{print $2}'`
M=`expr $M / 1024`
M=`expr $M / 128`
M=`expr $M + 1`
M=`expr $M \* 128`
echo "<memory>$M</memory>"
echo "<uname>`uname -sr`</uname>"
if [ -f /etc/lsb-release ]
then
LSB1=`grep DISTRIB_ID= /etc/lsb-release | cut -d= -f2 | \
sed s:\"::g | tr '[A-Z]' '[a-z]'`
LSB2=`grep DISTRIB_RELEASE= /etc/lsb-release | cut -d= -f2 | \
sed s:\"::g | tr '[A-Z]' '[a-z]'`
LSB3=`grep DISTRIB_CODENAME= /etc/lsb-release | cut -d= -f2 | \
sed s:\"::g | tr '[A-Z]' '[a-z]'`
echo "<lsb>"
echo " <id>$LSB1</id>"
echo " <release>$LSB2</release>"
echo " <codename>$LSB3</codename>"
echo "</lsb>"
fi
case $OS in
alpha*)
grep 'cpu model' /proc/cpuinfo | tr -s ' ' | sed s/'cpu model.*:'// \
| sed s/^\ *//g | sed s/^/\<cpu\>/ | sed s/$/\<\\/cpu\>/
;;
sparc*)
grep '^cpu' /proc/cpuinfo | tr -s ' ' | sed s/'cpu.*:'// \
| sed s/^\ *//g | sed s/^/\<cpu\>/ | sed s/$/\<\\/cpu\>/
;;
*)
grep 'model name' /proc/cpuinfo | tr -s ' ' | sed s/'model name.*:'// \
| sed s/^\ *//g | sed s/^/\<cpu\>/ | sed s/$/\<\\/cpu\>/
;;
esac
echo "<cpuinfo>"
cat /proc/cpuinfo
echo "</cpuinfo>"
echo
;;
sparc-sun-solaris*)
echo "<hard>`prtconf |grep '^SUNW,'`</hard>"
echo "<provider>`showrev | grep 'provider' | \
sed s/Hardware\ provider:\ //`</provider>"
echo "<hostid>`showrev | grep 'Hostid' | \
sed s/Hostid:\ //`</hostid>"
echo "<serialnumber>`eeprom | grep 'system-board-serial' | \
sed -e 's/.*#[=:]\(.*\)/\1/' | sed s/\^\ // | \
sed s/.$//`</serialnumber>"
echo "<kernelarch>`showrev | grep 'Kernel architecture' | \
sed s/Kernel\ architecture:\ //`</kernelarch>"
echo "<apparch>`showrev | grep 'Application architecture' | \
sed s/Application\ architecture:\ //`</apparch>"
echo "<memory>`prtconf | grep 'Memory size' | \
sed s/Memory\ size:\ // | sed s/\ Megabytes//`</memory>"
echo "<prom>`prtconf -V`</prom>"
echo "<uname>`uname -sr`</uname>"
psrinfo -v | grep operates | sed -e 's/ The //' -e 's/,//' \
-e s/\^\ */\<cpu\>/ -e s/\$/\<\\/cpu\>/ \
-e s/processor\ operates\ at\ //
echo
;;
powerpc-ibm-aix*)
echo "<hard>`uname -M`</hard>"
echo "<provider>IBM</provider>"
echo "<hostid>`hostid`</hostid>"
echo "<memory>`expr \`bootinfo -r\` / 1024`</memory>"
echo "<uname>`uname -s` `oslevel`</uname>"
P=`lsdev -C -c processor | head -1 | awk '{print $1}'`
TYPE=`lsattr -E -l $P | grep type | awk '{print $2}'`
lsdev -C -c processor | \
awk -v TYPE=$TYPE '{printf ("%s %s\n", $1, TYPE)}' | \
sed s/^/\<cpu\>/ | sed s/$/\<\\/cpu\>/
echo
;;
hppa*-hp-hpux*)
echo "<hard>`model`</hard>"
echo "<provider>HP</provider>"
echo "<memory>`expr \`grep -i Physical: /var/adm/syslog/syslog.log | \
tail -1 | sed s/.*Physical:// | awk '{print $1}'\` / 1024`</memory>"
echo "<uname>`uname -sr`</uname>"
MHZ=`echo itick_per_tick/D | adb -k /stand/vmunix /dev/kmem | \
tail -1 | cut -f2`
MHZ=`expr $MHZ / 10000`
ioscan -fnC processor | grep processor | \
awk -v MHZ=$MHZ '{printf ("%s %s %sMHz\n", $1, $5, MHZ)}' |
sed s/^/\<cpu\>/ | sed s/$/\<\\/cpu\>/
echo
;;
mips-sgi-irix*)
echo "<hard>SGI</hard>"
echo "<memory>`hinv | grep -i memory | cut -d: -f2 | \
sed s/\^\ // | sed s/\ Mbytes//`</memory>"
echo "<uname>`uname -sr`</uname>"
echo "<cpu>`hinv | grep MHZ`</cpu>"
echo
;;
powerpc-apple-darwin*)
;;
*)
;;
esac
) >> $HOST.xml
###########
# network #
###########
(
echo "<network>"
## resolv.conf ##
echo " <resolv>"
if [ -f /etc/resolv.conf ]
then
for i in `grep '^nameserver' /etc/resolv.conf | \
tr '\011' ' ' | tr -s ' ' | awk '{print $2}'`
do
echo " <nameserver>"$i"</nameserver>"
done
echo " <conf>"
cat /etc/resolv.conf | tr '\011' ' ' | tr -s ' '
echo " </conf>"
fi
echo " </resolv>"
## nis ##
echo " <nis>"
D=`domainname 2>/dev/null`
case $D in
'' | '(none)')
echo " <domain>none</domain>"
;;
*)
echo " <domain>$D</domain>"
case $OS in
sparc-sun-sunos* | powerpc-apple-darwin*)
Y=`ps aux | grep [y]pbind | wc -l`
;;
*)
Y=`ps -eaf | grep [y]pbind | wc -l`
;;
esac
if [ $Y = 1 ]
then
M=`ypwhich -m passwd`
O=`ypwhich -m | grep ypservers | wc -l`
if [ $HOST = $M ]
then
echo " <status>master</status>"
else
if [ $O = 1 ]
then
S=`ypcat -k ypservers | grep $HOST | wc -l`
if [ $S = 1 ]
then
echo " <status>slave</status>"
else
echo " <status>client</status>"
fi
fi
fi
echo " <server>"`ypwhich`"</server>"
echo " <master>"$M"</master>"
if [ $O = 1 ]
then
for i in `ypcat -k ypservers | grep -v $M`
do
echo " <slave>"$i"</slave>"
done
fi
else
echo " <status>none</status>"
fi
;;
esac
echo " </nis>"
## nic ##
echo " <nic>"
case $OS in
*-linux-gnu)
## default ##
for i in `cat /proc/net/dev | tail +3 | cut -d':' -f1 | grep -v lo`
do
echo " <if>"
echo " <name>"$i"</name>"
echo " <config>"
ifconfig $i | sed -e 's/</\</' -e 's/>/\>/'
echo " </config>"
echo " <mac>`ifconfig $i | grep HWaddr | awk '{print $5}'`</mac>"
echo " <ip>`ifconfig $i | grep 'inet addr' | cut -d':' -f2 | cut -d' ' -f1`</ip>"
mii-tool $i 2>/dev/null 1>&2 && (
echo " <speed>"
echo " <small>"`mii-tool $i | sed s/.*:\ //`"</small>"
echo " <full>"
mii-tool -v $i
echo " </full>"
echo " </speed>"
)
echo " </if>"
done
## vmware ###
for i in `cat /proc/net/dev | tail +3 | cut -d':' -f1 | grep -v lo`
do
j=`echo $i | awk '{ printf ("%s",substr($1,1,5)) }'`
if [ $j = "vmnet" ]
then
echo " <vmware>"$i"</vmware>"
fi
done
## etherchan ##
for i in `cat /proc/net/dev | tail +3 | cut -d':' -f1 | grep -v lo`
do
M=`ifconfig $i | grep MASTER | wc -l`
if [ $M = 1 ]
then
echo " <ec>"
echo " <master>"$i"</master>"
IPM=`ifconfig $i | grep 'inet adr' | cut -d':' -f2 | cut -d' ' -f1`
for j in `cat /proc/net/dev | tail +3 | cut -d':' -f1 | grep -v lo`
do
IPS=`ifconfig $j | grep 'inet adr' | cut -d':' -f2 | cut -d' ' -f1`
if [ $IPM = $IPS ]
then
S=`ifconfig $j | grep SLAVE | wc -l`
if [ $S = 1 ]
then
echo " <slave>"$j"</slave>"
fi
fi
done
echo " </ec>"
fi
done
;;
sparc-sun-solaris*)
## default ##
for i in `ifconfig -a | grep '^[a-z]' | cut -d: -f1 | grep -v lo0 | sort`
do
echo " <if>"
echo " <name>"$i"</name>"
echo " <config>"
ifconfig $i | sed -e 's/</\</' -e 's/>/\>/'
echo " </config>"
echo " <mac>`ifconfig $i | grep 'ether' | awk '{print $2}' | \
awk -F':' '{printf ("%02s:%02s:%02s:%02s:%02s:%02s\n", $1,$2,$3,$4,$5,$6)}' | \
tr '[a-z]' '[A-Z]'`</mac>"
echo " <ip>`ifconfig $i | grep 'inet' | awk '{print $2}'`</ip>"
if1=`echo $i | sed -e 's/[0-9]*$//'`
if2=`echo $i | sed -e 's/^[a-z]*//'`
echo " <speed>"
case "$if1" in
eri | hme)
ndd -set /dev/$if1 instance $if2
FDX10=`ndd /dev/$if1 adv_10fdx_cap`
HDX10=`ndd /dev/$if1 adv_10hdx_cap`
FDX100=`ndd /dev/$if1 adv_100fdx_cap`
HDX100=`ndd /dev/$if1 adv_100hdx_cap`
AUTONEG=`ndd /dev/$if1 adv_autoneg_cap`
echo " <fdx10>"$FDX10"</fdx10>"
echo " <hdx10>"$HDX10"</hdx10>"
echo " <fdx100>"$FDX100"</fdx100>"
echo " <hdx100>"$HDX100"</hdx100>"
echo " <autoneg>"$AUTONEG"</autoneg>"
;;
ce)
ndd -set /dev/$if1 instance $if2
FDX10=`ndd /dev/$if1 adv_10fdx_cap`
HDX10=`ndd /dev/$if1 adv_10hdx_cap`
FDX100=`ndd /dev/$if1 adv_100fdx_cap`
HDX100=`ndd /dev/$if1 adv_100hdx_cap`
FDX1000=`ndd /dev/$if1 adv_1000fdx_cap`
HDX1000=`ndd /dev/$if1 adv_1000hdx_cap`
AUTONEG=`ndd /dev/$if1 adv_autoneg_cap`
echo " <fdx10>"$FDX10"</fdx10>"
echo " <hdx10>"$HDX10"</hdx10>"
echo " <fdx100>"$FDX100"</fdx100>"
echo " <hdx100>"$HDX100"</hdx100>"
echo " <fdx1000>"$FDX1000"</fdx1000>"
echo " <hdx1000>"$HDX1000"</hdx1000>"
echo " <autoneg>"$AUTONEG"</autoneg>"
;;
esac
echo " </speed>"
echo " </if>"
done
;;
powerpc-ibm-aix*)
## default ##
for i in `lsdev -C -c if | grep Available | awk '{print $1}' | grep -v lo0 | sort`
do
echo " <if>"
echo " <name>"$i"</name>"
echo " <config>"
ifconfig $i | sed -e 's/</\</' -e 's/>/\>/'
echo " </config>"
echo " <mac>`netstat -i | grep -i link | \
sed s/\</\ / | sed s/\>/\ / | \
grep $i | awk '{ print $4 }' | \
awk -F'.' '{printf ("%02s:%02s:%02s:%02s:%02s:%02s\n", $1,$2,$3,$4,$5,$6)}' | \
tr '[a-z]' '[A-Z]'`</mac>"
echo " <ip>`ifconfig $i | grep 'inet' | awk '{print $2}'`</ip>"
echo " <speed>"
j=`echo $i | sed s/^en/ent/`
lsattr -E -l $j
echo " </speed>"
echo " </if>"
done
;;
hppa*-hp-hpux*)
## default ##
for i in `lanscan -i | awk '{print $1}' | sort`
do
echo " <if>"
echo " <name>"$i"</name>"
echo " <config>"
ifconfig $i | sed -e 's/</\</' -e 's/>/\>/'
echo " </config>"
echo " <mac>`lanscan | grep ' '$i' ' | awk '{print $2}' | sed s/^0x// | \
awk '{printf ("%02s:%02s:%02s:%02s:%02s:%02s\n",
substr ($1,1,2),
substr ($1,3,2),
substr ($1,5,2),
substr ($1,7,2),
substr ($1,9,2),
substr ($1,11,2))}' | \
tr '[a-z]' '[A-Z]'`</mac>"
echo " <ip>`ifconfig $i | grep 'inet' | awk '{print $2}'`</ip>"
echo " <speed>"
nmid=`lanscan | grep $i | awk '{print $7}'`
lanadmin -x $nmid 2>/dev/null | grep Speed | sed s/.\*=\ //
echo " </speed>"
echo " </if>"
done
;;
mips-sgi-irix*)
## default ##
for i in `ifconfig -a | grep '^[a-z]' | cut -d: -f1 | grep -v lo0 | sort`
do
echo " <if>"
echo " <name>"$i"</name>"
echo " <config>"
ifconfig $i | sed -e 's/</\</' -e 's/>/\>/'
echo " </config>"
echo " <mac>`netstat -ia -I $i | tail -1 | awk '{print $1}' | \
tr '[a-z]' '[A-Z]'`</mac>"
echo " <ip>`ifconfig $i | grep 'inet' | awk '{print $2}'`</ip>"
echo " <speed>"
ifconfig -v $i | grep -i speed | tr '\011' ' ' | sed s/^\ //
echo " </speed>"
echo " </if>"
done
;;
powerpc-apple-darwin*)
;;
*)
echo " <if>"
echo " <name></name>"
echo " <config></config>"
echo " <mac></mac>"
echo " <ip></ip>"
echo " </if>"
;;
esac
echo " </nic>"
## route ##
echo " <netstat>"
echo " <full>"
netstat -rn
echo " </full>"
case $OS in
*-linux-gnu)
for i in `netstat -rn | grep '^[0-9]' | grep -v '127.0.0' | tr -s ' ' '@'`
do
echo " <route>"
echo " <dest>"`echo $i | cut -d'@' -f1`"</dest>"
echo " <gw>"`echo $i | cut -d'@' -f2`"</gw>"
echo " <mask>"`echo $i | cut -d'@' -f3`"</mask>"
echo " <if>"`echo $i | cut -d'@' -f8`"</if>"
echo " </route>"
done
;;
sparc-sun-solaris*)
for i in `netstat -rn | grep '^default' | tr -s ' ' '@'`
do
echo " <route>"
echo " <dest>"`echo $i | cut -d'@' -f1`"</dest>"
echo " <gw>"`echo $i | cut -d'@' -f2`"</gw>"
echo " <if>"`echo $i | cut -d'@' -f6`"</if>"
echo " </route>"
done
for i in `netstat -rn | grep '^[0-9]' | grep -v '127.0.0' | tr -s ' ' '@'`
do
echo " <route>"
echo " <dest>"`echo $i | cut -d'@' -f1`"</dest>"
echo " <gw>"`echo $i | cut -d'@' -f2`"</gw>"
echo " <if>"`echo $i | cut -d'@' -f6`"</if>"
echo " </route>"
done
;;
powerpc-ibm-aix*)
for i in `netstat -rn | grep '^default' | tr -s ' ' '@'`
do
echo " <route>"
echo " <dest>"`echo $i | cut -d'@' -f1`"</dest>"
echo " <gw>"`echo $i | cut -d'@' -f2`"</gw>"
echo " <if>"`echo $i | cut -d'@' -f6`"</if>"
echo " </route>"
done
for i in `netstat -rn | grep '^[0-9]' | grep -v '127.0.0' | tr -s ' ' '@'`
do
echo " <route>"
echo " <dest>"`echo $i | cut -d'@' -f1`"</dest>"
echo " <gw>"`echo $i | cut -d'@' -f2`"</gw>"
echo " <if>"`echo $i | cut -d'@' -f6`"</if>"
echo " </route>"
done
;;
hppa*-hp-hpux*)
for i in `netstat -rn | grep '^default' | tr -s ' ' '@'`
do
echo " <route>"
echo " <dest>"`echo $i | cut -d'@' -f1`"</dest>"
echo " <gw>"`echo $i | cut -d'@' -f2`"</gw>"
echo " <if>"`echo $i | cut -d'@' -f6`"</if>"
echo " </route>"
done
for i in `netstat -rn | grep '^[0-9]' | grep -v '127.0.0' | tr -s ' ' '@'`
do
echo " <route>"
echo " <dest>"`echo $i | cut -d'@' -f1`"</dest>"
echo " <gw>"`echo $i | cut -d'@' -f2`"</gw>"
echo " <if>"`echo $i | cut -d'@' -f6`"</if>"
echo " </route>"
done
;;
mips-sgi-irix*)
;;
powerpc-apple-darwin*)
;;
*)
;;
esac
echo " </netstat>"
echo "</network>"
echo
) >> $HOST.xml
#########
# disks #
#########
(
echo "<disks>"
case $OS in
*-linux-gnu)
if [ $ISROOT = 1 ]
then
echo " <fdisk>"
fdisk -l | grep ^/
echo " </fdisk>"
fi
# for i in /proc/ide/hd*
# do
# M=`cat $i/media`
# if [ $M = disk ]
# then
# D1=`echo $i | sed s:/proc/ide/::`
# D2=`cat $i/model | tr ' ' '-'`
# D3=`cat $i/capacity`
# D4=`cat $i/cache`
# echo " <ide>"
#
# echo " <dev>"$D1"</dev>"
# echo " <model>"$D2"</model>"
# echo " <size>"`expr $D3 \* 512`"</size>"
# echo " <cache>"$D4"</cache>"
#
# if [ $ISROOT = 1 ]
# then
# echo " <part>"
# echo " <all>"
# sfdisk -l /dev/$D1 | grep -e ^/dev
# echo " </all>"
# echo " </part>"
# fi
#
# echo " </ide>"
# fi
# done
## raid ##
echo " <raid>"
for DRIVER in cciss cpqarray
do
if [ -d /proc/driver/$DRIVER ]
then
for i in `find /proc/driver/$DRIVER -type f`
do
echo " <controller>"
echo " <proc>$i</proc>"
echo " <name>"`cat $i | head -1 | cut -d: -f2 | sed s:^\ *::`"</name>"
echo " <all>"
cat $i
echo " </all>"
echo " </controller>"
done
fi
done
echo " </raid>"
## lvm ##
if [ $ISROOT = 1 ]
then
echo " <lvm>"
if [ -x /sbin/vgdisplay ]
then
for i in `vgdisplay -s | awk -F\" '{print $2}' | grep vg | sort`
do
echo " <vg>"
echo " <name>$i</name>"
for j in `vgdisplay -v $i | awk -F' +' '/PV Name/ {print $4}' | sort`
do
echo " <pv>$j</pv>"
done
for j in `vgdisplay -v $i | awk -F' +' '/LV Name/ {print $3}' | sort`
do
echo " <lv>$j</lv>"
done
echo " </vg>"
done
echo " <all>"
vgdisplay -v
echo " </all>"
fi
echo " </lvm>"
fi
;;
sparc-sun-solaris*)
## std ##
echo " <iostate>"
iostat -E 2>/dev/null | \
sed -e 's/</\</' -e 's/>/\>/'
echo " </iostate>"
echo " <format>"
echo 0 | format 2>&1 | sed -e '/^Specify disk/,$d' | \
sed -e 's/</\</' -e 's/>/\>/'
echo " </format>"
# gather disk partition information
echo " <prtvtoc>"
for i in `ls /dev/rdsk/*s2`
do
diskname=`echo $i | sed s/.dev.rdsk.// | sed s/s2// | sed s/\$/\&s/`
# we need devinfo to find a non zero length partition, since prtvtoc
# will return "No such device or address" on a zero length partition.
# prtvtoc will be executed on one partition only as the info is the same
# for all partitions.
for k in 0 1 2 3 4 5 6 7
do
if test "`devinfo -p /dev/rdsk/$diskname$k 2>/dev/null`" != ""
then
echo " <part>"
echo " <name>"$diskname$k"</name>"
echo " <full>"
prtvtoc /dev/rdsk/$diskname$k
echo " </full>"
echo " </part>"
break
fi
done
done
echo " </prtvtoc>"
## sds ##
echo " <sds>"
if [ -x /usr/opt/SUNWmd/sbin/metastat ]
then
# The metastat command displays the current status for each
# metadevice (including stripes, concatenations, concatenations
# of stripes, mirrors, RAID5, and trans devices) or hot spare pool,
# or of specified metadevices or hot spare pools.
echo " <metastat>"
/usr/opt/SUNWmd/sbin/metastat 2>/dev/null
echo " </metastat>"
# -p Displays the list of active metadevices and hot spare
# pools in a format like md.tab.
echo " <metastatp>"
/usr/opt/SUNWmd/sbin/metastat -p 2>/dev/null
echo " </metastatp>"
# -t Prints the current status and timestamp for the specified
# metadevices and hot spare pools. The timestamp provides
# the date and time of the last state change.
echo " <metastatt>"
/usr/opt/SUNWmd/sbin/metastat -t 2>/dev/null
echo " </metastatt>"
fi
if [ -x /usr/opt/SUNWmd/sbin/metadb ]
then
# The metadevice state database contains the configuration of
# all metadevices and hot spare pools in the system.
echo " <metadb>"
/usr/opt/SUNWmd/sbin/metadb 2>/dev/null
echo " </metadb>"
fi
echo " </sds>"
## vm ##
echo " <vm>"
if [ -x /usr/sbin/vxdg ]
then
echo " <vxdgqlist>"
vxdg -q list
echo " </vxdgqlist>"
fi
if [ -x /usr/sbin/vxdisk ]
then
echo " <vxdisklist>"
vxdisk list
echo " </vxdisklist>"
fi
if [ -x /usr/sbin/vxprint ]
then
echo " <vxprinth>"
vxprint -h
echo " </vxprinth>"
fi
echo " </vm>"
;;
powerpc-ibm-aix*)
;;
hppa*-hp-hpux*)
;;
mips-sgi-irix*)
;;
powerpc-apple-darwin*)
;;
*)
;;
esac
echo "</disks>"
echo
) >> $HOST.xml
########
# soft #
########
(
echo "<soft>"
case $OS in
*-linux-gnu)
echo " <sh>"`sh --version | head -1`"</sh>"
echo " <cc>"`cc --version | head -1`"</cc>"
;;
sparc-sun-solaris*)
;;
powerpc-ibm-aix*)
;;
hppa*-hp-hpux*)
if [ -f /usr/bin/sh ]
then
echo " <sh>"`strings /usr/bin/sh | grep -i version`"</sh>"
fi
if [ -f /usr/bin/cc ]
then
echo " <cc>"`strings /usr/bin/cc | grep -i compiler | grep HP`"</cc>"
fi
;;
mips-sgi-irix*)
;;
powerpc-apple-darwin*)
;;
*)
;;
esac
## netbackup ##
if [ -d /usr/openv ]
then
echo " <netbackup>"
if [ -f /outils/openv/volmgr/bin/sgscan ]
then
echo " <sgscan>"
echo " <changer>"
/outils/openv/volmgr/bin/sgscan changer | grep '^/'
echo " </changer>"
echo " <tape>"
/outils/openv/volmgr/bin/sgscan tape | grep '^/'
echo " </tape>"
echo " </sgscan>"
fi
echo " </netbackup>"
fi
##
echo "</soft>"
echo
) >> $HOST.xml
########
# case #
########
(
case $OS in
*-linux-gnu)
;;
sparc-sun-solaris*)
;;
powerpc-ibm-aix*)
;;
hppa*-hp-hpux*)
;;
mips-sgi-irix*)
;;
powerpc-apple-darwin*)
;;
*)
;;
esac
) >> $HOST.xml
#######
# end #
#######
(
echo "</config2xml>"
) >> $HOST.xml