Scripts for collecting data on Gnucomo clients.
[gnucomo.git] / scripts / gnucomo_report
diff --git a/scripts/gnucomo_report b/scripts/gnucomo_report
new file mode 100755 (executable)
index 0000000..b41e7bd
--- /dev/null
@@ -0,0 +1,32 @@
+#!/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