- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ping return code on 11.i
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
10-15-2004 03:31 AM
10-15-2004 03:31 AM
ping return code on 11.i
I'm writing a monitoring script and I need the return code of a ping. The problem is, ping always returns 0 wether it's successfull or not! I found a patch that fixes this on a hp-ux 10.20 system: PHNE_24260. Now I need a similar patch on an 11.i system. I couldn't find anything on the table of equivalency. Has anybody found a solution for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 03:39 AM
10-15-2004 03:39 AM
Re: ping return code on 11.i
man ping will show you the return code details in 11i
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 03:39 AM
10-15-2004 03:39 AM
Re: ping return code on 11.i
I think path PHNE_27382 on 11i fixes that problem. the latest patch in that category is PHNE_31247.
http://www1.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main|patch.breadcrumb.pdb|patch.breadcrumb.search|&patchid=PHNE_31247&context=hpux:800:11:11
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 03:39 AM
10-15-2004 03:39 AM
Re: ping return code on 11.i
My 11i does return various codes for various failures. My system is upto June 2004 level.
I believe the patch PHNE_27382 fixes it. I would see if there is any superceding patch to it and the dependencies.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 04:37 AM
10-15-2004 04:37 AM
Re: ping return code on 11.i
So you'll have to code the ping test to use a single test (-n 1) and I would also add the -m option to force a timneout, especially if several hosts are being tested in a script. NOTE: The ping options are quite position sensitive! -I and -v come before the hostname/IP, followed by -n and -m must be preceeded by -n first.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 04:40 AM
10-15-2004 04:40 AM
Re: ping return code on 11.i
But it returns 0 if the host exists in the /etc/hosts, even if it can't reach it. That's my problem.
example:
server:/# ping localhost -n 2
PING localhost: 64 byte packets
64 bytes from 127.0.0.1: icmp_seq=0. time=0. ms
64 bytes from 127.0.0.1: icmp_seq=1. time=0. ms
----localhost PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
server:/# echo $?
0
Now if i try to ping an address that localhost knows but can't reach for unknown/irrelevant reasons:
server:/# ping whatever.hell.ca -n 2
PING whatever.hell.ca: 64 byte packets
----whatever.hell.ca PING Statistics----
2 packets transmitted, 0 packets received, 100% packet loss
server:/# echo $?
0
Notice the 0 again.
The reason i brought this to the forums is that i don't have that problem on linux. I'm transforming a script that works on a linux box so it can work on hp-ux. That's all.
Thanks for your help guys.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 04:50 AM
10-15-2004 04:50 AM
Re: ping return code on 11.i
Yes. Your question was very well understood. The solution is the patch we mentioned. See for ex.,
$ /etc/ping bla -n 1
/etc/ping: unknown host bla
$ echo $?
1
$ /etc/ping somehost -n 1
PING somehost.mydomain.com: 64 byte packets
----somehost.mydomain.com PING Statistics----
1 packets transmitted, 0 packets received, 100% packet loss
$ echo $?
2
$ /etc/ping goodhost -n 1
PING goodhost.mydomain.com: 64 byte packets
64 bytes from xx.xx.xx.xx: icmp_seq=0. time=1. ms
---- goodhost.mydomain.com PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 1/1/1
$ echo $?
0
$
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 05:01 AM
10-15-2004 05:01 AM
Re: ping return code on 11.i
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2005 02:29 AM
09-26-2005 02:29 AM