- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need UNIX system call to check the remote m/c ...
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
02-15-2002 11:40 AM
02-15-2002 11:40 AM
Need UNIX system call to check the remote m/c is up or not
I have written a c++ program on HPUX-10.20, at one point I need to check whether the remote machine (HPUX-10.20) is active or not. But I want to use UNIX system call command rather than doing PING in a shell. Can any one tell me what command is that?
Thanks in advance
Vasu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2002 04:32 PM
02-15-2002 04:32 PM
Re: Need UNIX system call to check the remote m/c is up or not
If it is for C, you can download a copy of hping2 and look at the source.
hping2 is a tool which allows sending of crafted ICMP/TCP/UDP packets:
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2002 09:23 AM
02-18-2002 09:23 AM
Re: Need UNIX system call to check the remote m/c is up or not
However, I suspect that there is no UNIX command to tell you if a remote sytem is up unless the local system already has some sort of UNIX relationship with the remote system such a remote file system. Any test of a remote system's status will be some variation of ping in that we have to send a packet and check for a response. The local system otherwise has no idea and couldn't really care less if another system is up or not.
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2002 01:19 PM
02-18-2002 01:19 PM
Re: Need UNIX system call to check the remote m/c is up or not
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2002 08:55 PM
02-18-2002 08:55 PM
Re: Need UNIX system call to check the remote m/c is up or not
Here is a perl script that you could use to check if the remote system is UP...
---------------------Cut here------------------
# Author : Shabu Khan/Alan Acevedo
#!/usr/local/bin/perl -w
# Initialize!
use IO::Socket;
$numarg = @ARGV;
if ($numarg != 2) {
print "usage: tcpping
exit 1;
}
$host=$ARGV[0];
$tcpport=$ARGV[1];
# Main
$socket=IO::Socket::INET->new
(
PeerAddr => "$host",
PeerPort => "$tcpport",
Proto => "tcp",
Type => SOCK_STREAM
) or die "Could not open port $tcpport.\n";
print "Able to open port $tcpport.\n";
close($socket);
---------------------Cut here------------------
There was a need for us to write something like this in my previous project..
You could test something like this..
./tcpping hostname 23
If the system is alive it will say "Able to open port" else it will say "Could not open port"... you could capture these messages in a variable in your script or however you would like to handle it...
Enjoy !
-Shabu Khan