- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Please make this script work for me
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 02:38 PM
01-23-2002 02:38 PM
# Declare variables
do
# Get the start time
ssh $i "tail -2 /var/opt/ignite/logs/makrec.log1 2> /dev/null | grep -i 'Started'" > $TMP_PAGE2
echo "
" >> $TMP_PAGE2
# Get the end time - will also use later for COLOR selection
END=$(ssh $i "tail -2 /var/opt/ignite/logs/makrec.log1 2> /dev/null | grep -i 'Completed'")
echo $END >> $TMP_PAGE2
echo "
" >> $TMP_PAGE2
echo "" >> $TMP_PAGE2
# Get the failure code and set the color
FAIL_CODE=$(ssh $i "tail -2 /var/opt/ignite/logs/makrec.log1 2> /dev/null | grep -i 'ended unsucessfully' | tail -1")
case $FAIL_CODE in
"Completed" )
COLOR="GREEN"
;;
"Ended Unsucessfully" )
COLOR="RED"
;;
* )
COLOR="RED"
;;
esac
# Also set the COLOR based on $END
[ $(echo $END | grep -c completed) -eq 1 ] && COLOR="GREEN"
# Build the first column - This is where we set the color
echo "" > $TMP_PAGE1
echo "" >> $TMP_PAGE1
echo "$i " >> $TMP_PAGE1
echo "" >> $TMP_PAGE1
echo "
" >> $TMP_PAGE1
# Pull it together
cat $TMP_PAGE1 $TMP_PAGE2 >> $PAGE
done
# end the table
echo "" >> $PAGE
echo "" >> $PAGE
#
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 02:43 PM
01-23-2002 02:43 PM
Re: Please make this script work for me
We didn't get any feedback from you in the following post
http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x21eac6af36b7d5118ff10090279cd0f9,00.html
You need to replace remsh with ssh and try my solution. Please let us know.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 03:16 PM
01-23-2002 03:16 PM
Re: Please make this script work for me
Completed: not found
Any ideas buddy!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 03:36 PM
01-23-2002 03:36 PM
SolutionIn the posting, the first line appears like two lines but it is one line. Did you try making it one?.
Try with ksh -x option. You will know where you are getting this completed: not found error. This may be because you are improperly specifying the case statement.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 05:47 AM
01-24-2002 05:47 AM