--- /dev/null
+#!/bin/sh
+#
+# Gnucomo system state report
+#
+# Obtain various system parameters and mail
+# the output to the gnucomo server.
+
+PATH=$PATH:/usr/local/bin
+GNUCOMO_ADDRESS=gnucomo@andromeda.nl
+
+if PACKAGER=`which rpm`
+then
+ PACKAGER='rpm -qa'
+else
+ if PACKAGER=`which dpkg`
+ then
+ PACKAGER='package-debian'
+ fi
+fi
+
+if [ x$PACKAGER == x ]
+then
+ echo "Packages not available"
+fi
+
+$PACKAGER | mail -s 'Gnucomo package report' $GNUCOMO_ADDRESS
+sleep 10
+df -lPk -x tmpfs | mail -s 'Gnucomo filesystem report' $GNUCOMO_ADDRESS
+sleep 10
+df -lPi -x tmpfs | mail -s 'Gnucomo filesystem report' $GNUCOMO_ADDRESS
+sleep 10
+systemload | mail -s 'Gnucomo load report' $GNUCOMO_ADDRESS
--- /dev/null
+#!/bin/sh
+#
+# Turn an 'ls' listing of RPM files into an 'rpm -qa' listing
+# Reads a list of filenames, possibly preceeded by a directory and
+# strips the directory path from the beginning and the two suffices
+# from the end of each filename. For example, the name
+# "/mnt/cdrom/RedHat/RPMS/kernel-2.4.20-13.7.i686.rpm" gets turned
+# into a simple "kernel-2.4.20-13.7".
+#
+# This is most usefull for maintaining a repository of the most recent
+# packages. Using this script, you can keep a list of packages in the
+# Gnucomo database. To do this, create a virtual object, for example
+# with the name "redhat-7.3" and feed the list of RPM names into gcm_input
+# like this:
+#
+# ls /mnt/cdrom/RedHat/RPMS | ls-rpm | sort | uniq | gcm_input -h redhat-7.3
+#
+# After that, enter the updated RPMs with the -i flag for gcm_input.
+#
+# Examples:
+# ls /archive/linux/update9.0/*/*.rpm /archive/linux/latest/RH9/*.rpm | ls-rpm \
+# | sort | uniq | gcm_input -i -h redhat-9.0
+
+while read filename
+do
+ case $filename in
+ *.src.rpm)
+ ;;
+
+ *)
+ filename=`basename $filename .rpm`
+ case $filename in
+ *.athlon)
+ rpm=`basename $filename .athlon`
+ ;;
+ *.i386)
+ rpm=`basename $filename .i386`
+ ;;
+ *.i486)
+ rpm=`basename $filename .i486`
+ ;;
+ *.i586)
+ rpm=`basename $filename .i586`
+ ;;
+ *.i686)
+ rpm=`basename $filename .i686`
+ ;;
+ *.noarch)
+ rpm=`basename $filename .noarch`
+ ;;
+ esac
+ echo $rpm
+ ;;
+ esac
+done
--- /dev/null
+#!/bin/sh
+#
+# Gnucomo package parameter report.
+#
+# Create a list of packages and patches on a Debian Linux system
+# that can be read by the Gnucomo input program, gcm_input.
+#
+
+
+HOST=`hostname --fqdn`
+TIME=`date`
+
+echo "<?xml version='1.0'?>"
+echo "<gcmt:message xmlns:gcmt='http://gnucomo.org/transport/'>"
+echo " <gcmt:header>"
+echo " <gcmt:messagetype>package list</gcmt:messagetype>"
+echo " <gcmt:hostname>$HOST</gcmt:hostname>"
+echo " <gcmt:time>$TIME</gcmt:time>"
+echo " </gcmt:header>"
+echo " <gcmt:data>"
+
+echo " <gcmt:parameters gcmt:class='package'>"
+
+COLUMNS=180
+export COLUMNS
+
+dpkg -l | grep '^ii' | sed -e 's/&/&/' | while read FLAGS PACKAGE VERSION DESCRIPTION
+do
+ echo "<gcmt:parameter name='$PACKAGE'>"
+ echo " <gcmt:description>$DESCRIPTION</gcmt:description>"
+ echo " <gcmt:property name='version'>$VERSION</gcmt:property>"
+ echo "</gcmt:parameter>"
+done
+
+
+echo " </gcmt:parameters>"
+echo " </gcmt:data>"
+echo "</gcmt:message>"
+
--- /dev/null
+#!/bin/sh
+#
+# Gnucomo package parameter report.
+#
+# Create a list of packages and patches on a Solaris system
+# that can be read by the Gnucomo input program, gcm_input.
+#
+
+
+HOST=`hostname`
+TIME=`date`
+FILTER=/usr/local/bin/pkg-solaris.awk
+
+echo "<?xml version='1.0'?>"
+echo "<gcmt:message xmlns:gcmt='http://gnucomo.org/transport/'>"
+echo " <gcmt:header>"
+echo " <gcmt:messagetype>package list</gcmt:messagetype>"
+echo " <gcmt:hostname>$HOST</gcmt:hostname>"
+echo " <gcmt:time>$TIME</gcmt:time>"
+echo " </gcmt:header>"
+echo " <gcmt:data>"
+
+echo " <gcmt:parameters gcmt:class='package'>"
+
+pkginfo -l|awk -f $FILTER |sed -e 's/&/&/'
+
+showrev -p | cut -f2 "-d " |sort| tr '-' ' ' > /tmp/patchlist.$$
+read PREV_PATCH PREV_VERSION < /tmp/patchlist.$$
+
+while read PATCH VERSION
+do
+ if [ $PREV_PATCH = $PATCH ]
+ then
+ PREV_VERSION=$VERSION
+ else
+ echo "<gcmt:parameter name='$PREV_PATCH'>"
+ echo " <gcmt:description>Solaris patch $PREV_PATCH</gcmt:description>"
+ echo " <gcmt:property name='version'>$PREV_VERSION</gcmt:property>"
+ echo "</gcmt:parameter>"
+ fi
+ PREV_PATCH=$PATCH
+ PREV_VERSION=$VERSION
+done < /tmp/patchlist.$$
+
+tail -1 /tmp/patchlist.$$ >/tmp/patchtail.$$
+read PATCH VERSION </tmp/patchtail.$$
+echo "<gcmt:parameter name='$PATCH'>"
+echo " <gcmt:description>Solaris patch $PATCH</gcmt:description>"
+echo " <gcmt:property name='version'>$VERSION</gcmt:property>"
+echo "</gcmt:parameter>"
+
+echo " </gcmt:parameters>"
+echo " </gcmt:data>"
+echo "</gcmt:message>"
+
+rm /tmp/patchlist.$$
+rm /tmp/patchtail.$$
+
--- /dev/null
+/PKGINST:/ { OFS=""; print "<gcmt:parameter name='", $2, "'>"; OFS=" " }
+/DESC:/ { $1=""; print " <gcmt:description>", $0, "</gcmt:description>" }
+/VERSION:/ { OFS=""; print " <gcmt:property name='version'>", $2, "</gcmt:property>"; OFS=" " }
+/^$/ { print "</gcmt:parameter>" }
--- /dev/null
+#!/bin/sh
+
+HOST=`hostname`.wt.tno.nl
+
+showprods -3 -n|awk '{printf "%s-%s\n",$2,$3}'|grep -v '^[-=]' |grep -v Version-Description
--- /dev/null
+#!/bin/sh
+#
+# Gnucomo system load report.
+#
+# Create a parameter report with two values:
+# The total number of processes and the 5-min load average.
+#
+
+
+HOST=`hostname --fqdn`
+TIME=`date`
+
+echo "<?xml version='1.0'?>"
+echo "<gcmt:message xmlns:gcmt='http://gnucomo.org/transport/'>"
+echo " <gcmt:header>"
+echo " <gcmt:messagetype>XML</gcmt:messagetype>"
+echo " <gcmt:hostname>$HOST</gcmt:hostname>"
+echo " <gcmt:time>$TIME</gcmt:time>"
+echo " </gcmt:header>"
+echo " <gcmt:data>"
+
+echo " <gcmt:parameters gcmt:class='systemload'>"
+
+PROCESSES=`ps ax|wc -l|awk ' {print $1}'`
+LOADAV=` uptime|awk ' { print $11 }' | tr -d ,`
+
+echo "<gcmt:parameter name='Load'>"
+echo " <gcmt:description>System processing load</gcmt:description>"
+echo " <gcmt:property name='processes'>$PROCESSES</gcmt:property>"
+echo " <gcmt:property name='runqueue'>$LOADAV</gcmt:property>"
+echo "</gcmt:parameter>"
+
+echo " </gcmt:parameters>"
+echo " </gcmt:data>"
+echo "</gcmt:message>"