- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Help
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-26-2006 05:56 AM
01-26-2006 05:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:20 AM
01-26-2006 06:20 AM
Re: Script Help
Which Script was it , perl , ksh ,sh ?
Regards ..bl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:25 AM
01-26-2006 06:25 AM
Re: Script Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:30 AM
01-26-2006 06:30 AM
Re: Script Help
I can't decipher the [, ]. Did you cut and paste, by any chance or is that the way it appears in the script?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:31 AM
01-26-2006 06:31 AM
Re: Script Help
Cut 'n'paste issue in the forums...
if [ "ping_status" ];
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:33 AM
01-26-2006 06:33 AM
Re: Script Help
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:34 AM
01-26-2006 06:34 AM
Re: Script Help
host=`cat ipfile`
for item in $host
do
echo "Checking $host..."
ping_status=`ping $host 10|grep 'no answer'`
if [ "ping_status" ]; then
echo "$host NOT RESPONDING"
echo " "
continue
fi
echo "$host UP"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:37 AM
01-26-2006 06:37 AM
Solution#! /bin/sh
host=`cat ipfile`
for item in $host
do
echo "Checking $host..."
ping_status=`ping $host 10|grep 'no answer'`
if [ "ping_status" ]; then
echo "$host NOT RESPONDING"
echo " "
continue
fi
echo "$host UP"
It is checking for a condition - if ping_status contains "no answer" then it will echo $host not responding.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 07:26 AM
01-26-2006 07:26 AM
Re: Script Help
The test part (if statement) is missing some constructs alongwith an else and done statements.
=============================================
#! /bin/sh
host=`cat ipfile`
for item in $host
do
echo "Checking $host..."
ping_status=`ping $host 10|grep 'no answer'`
if [ "$ping_status" ]; then
echo "$host NOT RESPONDING"
else
echo "$host UP"
fi
done
=============================================
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 08:39 AM
01-26-2006 08:39 AM
Re: Script Help
#! /bin/sh
host=`cat ipfile`
for item in $host
do
echo "Checking $host..."
ping_status=`ping $host 10|grep 'no answer'`
if [ "ping_status" -ne 0 ]; then
echo "$host NOT RESPONDING"
echo " "
continue
fi
echo "$host UP"
done
Rgds...Geoff