Sponsored Content
Full Discussion: Ssh on ping result?
Top Forums Shell Programming and Scripting Ssh on ping result? Post 303026470 by wbport on Wednesday 28th of November 2018 10:47:05 AM
Old 11-28-2018
At one time we had to check a number of branches. The following code shows the "ping" as run in a "do" loop followed by the "sed" control file. Run sed with the -n option and "p" something appropriate when you find "0 packets".
Code:
ping -c 1 $in >>mylog1 2>&1


/ ping statistics / {
                    N
                   / 0 packets / {
                        s/^....br//
                        s/ .*//
                        p
                      }
                   }


sed -n -f ping.sed mylog1 > mylog2

If mylog2 exists, the blooming thing is down.
 

10 More Discussions You Might Find Interesting

1. Linux

Can't SSH / ping Linux box !!!

I have a linux box build11 which can be pinged from build18 (Windows) box. And we can only login to the box (using SSH) from build18 box. Plz help to characterize the problem, network, DNS, DHCP, etc (or whatever which I am unsure) Any idea what may be the reason ? :confused: Thanks in... (4 Replies)
Discussion started by: csaha
4 Replies

2. Shell Programming and Scripting

Problem storing SSH result in a variable

i have this SSH command which runs perfectly on command prompt in sunOS ssh -o Port=${portno} ${uname}@${server} find ${dir_path} -name '***' output : /usr/local/home/*** My problem is when i run same command in my script #!/usr/bin/ksh res=`ssh -o Port=${portno} ${uname}@${server}... (1 Reply)
Discussion started by: prash184u
1 Replies

3. Solaris

could not ssh and ping

hi , i cannot ssh to a server , i have restarted the ssh instances also. and i cannot ping to the server.. any ideas ..plz (5 Replies)
Discussion started by: jegaraman
5 Replies

4. Solaris

could not ssh and ping

Hi, I have a solaris 8 machine. I see ssh is running in the machine sbnismwp2# ps -aef | grep ssh root 947 945 0 04:34:45 ? 0:00 /export/opt/SSHtecagt/sbin/ssh-mgmt-sysmonitor root 945 1 0 04:34:45 ? 0:00 /export/opt/SSHtecagt/sbin/ssh-mgmt-agent... (11 Replies)
Discussion started by: jegaraman
11 Replies

5. Shell Programming and Scripting

prevent ssh from executing result in shell

Hi, I am writing a script on Solaris 10 and want to execute a remote ssh command. Normally this command should just return the value 0000000000002356 but when using ssh it seems it is passing the result to the shell to execute. ssh root@10.5.112.145 `/usr/bin/nawk -F\, '$1=="USG" && $2=="01"... (3 Replies)
Discussion started by: borderblaster
3 Replies

6. Solaris

Ping = no, SSH = eventually. Next step?

I have a Solaris 9 server that does not return a ping. When I try to log in via SSH I eventually get in. I am logged in now. I know this is a wide open question, but can you recommend some things I should check? . Thanks in advance, ~R (2 Replies)
Discussion started by: abstractrick
2 Replies

7. Shell Programming and Scripting

Perl : code on ping showing difference result

Hi all, I am using the below code to ping a code and print whehter the connection is successful or not. use Net::Ping; $p = Net::Ping->new(); my $host = "x.x.x.x"; # print "$host is alive.\n" if $p->ping($host); if ($p->ping($host,3)) { print... (0 Replies)
Discussion started by: scriptscript
0 Replies

8. Shell Programming and Scripting

Ping result talking too long

Hello all, I am writing a script that pings various machines to check connectivity. If a machine is available, the prompt returns a result immediately: root@ops # ping 172.21.5.5 172.21.5.5 is alive BUT if a machine is Down , the reply takes a long time to come. The issue is I want to... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies

9. AIX

Not able to ssh or ping a server

Hi, Earlier I was able to ssh /ping the server but now it just hangs Please suggest how to troubleshoot. Best regards, Vishal (4 Replies)
Discussion started by: Vishal_dba
4 Replies

10. UNIX for Advanced & Expert Users

Cant ssh, but ping works

I cant ping to some of my machines, but ping works. I attach screenshots. Port is open and it is 22. I can't figure out why i cant access. https://www.unix.com/attachments/unix-for-advanced-and-expert-users/7492d1541541072-cant-ssh-but-ping-works-sshlisten-jpg... (17 Replies)
Discussion started by: tomislav91
17 Replies
DNPING(1)						      General Commands Manual							 DNPING(1)

NAME
dnping - Loopbacks diagnostic packets through a remote node SYNOPSIS
dnping nodename [user pass] count or dnping nodename [options] nodename Options: [qsv] [-c number] [-i interval] [-p password] [-s size] [-u username] [-w timeout] DESCRIPTION
This utility sends to remote DECnet node nodename the number of packets specified by count to test the link between the two systems. Optionally a username and password may be specified for the connection as well as several other options. NOTE that if you dnping another Linux box it must have dnetd running. NOTE also that dnping is not really like an IP "ping" in that it needs a registered object at the other end to connect to. So, just because you cannot ping a machine does not, necessarily, mean that machine is not available, just that the MIRROR object is not available. There is not (to my knowledge) a low-level equivalent in DECnet of the ICMP ping message. OPTIONS
-c number Number of packets to send (default 10) -d Debug mode (default off) -i interval interval between packets in microseconds (default 0) -p password Access control password. If this is "-" then you will be prompted. -q Quiet mode (default off) -s size size of frame to send in bytes (40 data + 68 hdr) -t timestamps mode (default off) -u username access control username -w timeout Specifies a timeout (in seconds). If not response is received after this time then dnping will abort. The default is to wait for- ever. -v verbose mode (default off) EXAMPLES
Pings 10 packets through remote node "mv3100" # dnping mv3100 10 Make it look a bit like IP ping: # dnping -vti 1000000 marsha SEE ALSO
dntype(1), dndir(1), dndel(1), dntask(1), sethost(1), dnetd(8) DECnet utilities January 25 2000 DNPING(1)
All times are GMT -4. The time now is 08:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy