#!/bin/sh
##################################################################
#		W H E N _ B O O T E D
#		---------------------
# Description:
#	Produces a report of when machines has been rebooted
#	and the number of machines rebooted at that time.
#	This can be useful for getting a "feeling" of the systems
#	life.
#
# Special note:
#	This command demants that there is a "rebooted"-column
#	in the database.
#
##################################################################

lista=`machines -show rebooted | awk '{ print $2 " " $3 " " $4 }' | grep "^[A-Z]" | sort -u | tr ' ' ';'`

for i in $lista ; do
	datum="`echo $i | tr ';' ' '`"
	number=`machines -show rebooted | grep "$datum" | wc -l | awk '{ print $1 }'`
	echo "$datum	$number"
done > /tmp/list.$$

echo ""
echo "Datum		Antal"
echo "---------------------"
cat /tmp/list.$$ | sort -n -r -t "	" +1
echo "---------------------"

rm /tmp/list.$$
exit 0
#
# History of changes:
# when_booted,v
# Revision 1.1  1997/01/09 20:39:07  lasse
# Created by Lars Olsson, i only added header and footer.
#
#
