#!/bin/bash
# (c) 2002-2003 Newisys, Inc.  All rights reserved.
#
# Example shell script to monitor the status of a set of Service Processors.
# Could be run by the cron daemon on your client.
#
# Requires: 
#    sp-ips.txt file with list of IP addresses for each Service Processor to connect to.
#    To be run from a SSH client. 
# See documentation for more information about commands.
#
for ip in `cat sp-ips.txt` ; do
   echo "Checking status for IP: $ip"
   status=`ssh $ip sp get status`   
   if [ $status != "Nominal" ]; then
      echo "SP $ip reporting status: $status "
   fi
done