- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script required to check the PING Broken statu...
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
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
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
06-17-2011 12:15 AM
06-17-2011 12:15 AM
Script required to check the PING Broken status
I would require a script to check PING BROKEN status from a Source file .
With regards,
Mjoshi
- Tags:
- ping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2011 02:07 PM
06-17-2011 02:07 PM
Re: Script required to check the PING Broken status
you're trying to check.
A Forum search for keywords like, say:
ping script
might find several things.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2011 10:14 AM
06-18-2011 10:14 AM
Re: Script required to check the PING Broken status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2011 01:47 PM
06-18-2011 01:47 PM
Re: Script required to check the PING Broken status
Possibly something like:
for host in $(< file-of-hosts); do
/etc/ping $host -m 1 -n 1
if [ $? -ne 0 ]; then
echo "ping broken on $host" 1>&2
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011 09:13 PM
06-19-2011 09:13 PM
Re: Script required to check the PING Broken status
#!/bin/sh
for host in $(< tmp/hostfile.txt); do
/etc/ping $host -m 1 -n 1
if [ $? -ne 0 ]; then
echo "ping broken on $host" 1>&2
fi
done
root@ggnems21 # sh ping.sh
ping.sh: syntax error at line 2: `$' unexpected
Is failing..
With regards,
Mjoshi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2011 10:02 PM
06-26-2011 10:02 PM
Re: Script required to check the PING Broken status
>root@ggnems21 # sh ping.sh
>ping.sh: syntax error at line 2: `$' unexpected
You need to use a real shell: ksh or Posix shell
Otherwise you have to fall back to the archaic: `cat tmp/hostfile.txt`