#!/bin/bash

dmidecode |grep "Product Name" |head -n 1 |grep ProLiant 1>/dev/null
if [ $? = 0 ]
then

export OFFSET=1
export HW_TIME=`/sbin/hwclock |awk '{ print $3, $2 ",", $4, $5 $6}'`
export NOW_TIME=`/bin/date '+%s'`
HW_CLOCK=`/bin/date +%s -d"$HW_TIME"`
(( HW_VAL=NOW_TIME - HW_CLOCK ))
if [ $HW_VAL -gt $OFFSET ] || [ $HW_VAL -lt -$OFFSET ]; then
 echo -e "Hardware clock has Problem"
else
echo -e "Hardware clock is OK"
fi

else
echo -e "Server is VM "
fi

