Sponsored Content
Top Forums Shell Programming and Scripting help to ping a host, is it alive or not ... Post 61062 by sx3v1l_1n51de on Thursday 27th of January 2005 06:14:13 PM
Old 01-27-2005
it's a bourne shell (sh), the system is a solaris 5:

$ sh -xv servscript
#Sistema de Monitoreo de Servidores
#CENCAR

a=1
a=1
while (test "$a"!="0")
do
for ipadr in `cat ipadress`
do

ping $ipadr

if ("$?"="0")

then
echo $ipadr" is alive"
else
echo $ipadr" esta muerto"
#ipadr >> deadhosts
#./strike1

fi
done
done
+ test 1!=0
+ cat ipadress
+ ping 148.202.1.29
148.202.1.29 is alive
+ 0=0
servscript: 0=0: not found
+ echo 148.202.1.29 esta muerto
148.202.1.29 esta muerto
+ ping 148.202.3.5
148.202.3.5 is alive
+ 0=0
servscript: 0=0: not found
+ echo 148.202.3.5 esta muerto
148.202.3.5 esta muerto
+ ping 148.201.3.2
no answer from 148.201.3.2
+ 1=0
servscript: 1=0: not found
+ echo 148.201.3.2 esta muerto
148.201.3.2 esta muerto
+ ping 148.202.202.25
148.202.202.25 is alive
+ 0=0
servscript: 0=0: not found
+ echo 148.202.202.25 esta muerto
148.202.202.25 esta muerto
+ ping 128.12.65.202
no answer from 128.12.65.202
+ 1=0
servscript: 1=0: not found
+ echo 128.12.65.202 esta muerto
128.12.65.202 esta muerto
+ ping 148.148.148.148
ICMP Host Unreachable from gateway host-200-76-4-89.block.alestra.net.mx (200.76.4.89)
for icmp from filgc.class.udg.mx (148.202.15.70) to 148.148.148.148
ICMP Host Unreachable from gateway host-200-76-4-89.block.alestra.net.mx (200.76.4.89)
for icmp from filgc.class.udg.mx (148.202.15.70) to 148.148.148.148
^C$
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unable to ping host

Hi, dear all, I am rather new to Unix and have this problem where I cant seem to ping from 1 host to another. The scenerio is as follows: - 1 QNX host->Eth->1 SCO host the SCO host is configured with it's IP the QNX host is configured with another IP both in the same domain, ie, 172.20.3.XX... (3 Replies)
Discussion started by: gavon
3 Replies

2. IP Networking

QNX host cannot ping SCO host, vice versa

The problem I am facing now is that the QNX host could not ping the SCO host and vice versa. They are in the same domain, ie, 172.20.3.xx. As I am very new to Unix, I guess I must have missed out some important steps. Pls help... Thanx alot (2 Replies)
Discussion started by: gavon
2 Replies

3. Solaris

PING - Unknown host 127.0.0.1, Unknown host localhost - Solaris 10

Hello, I have a problem - I created a chrooted jail for one user. When I'm logged in as root, everything work fine, but when I'm logged in as a chrooted user - I have many problems: 1. When I execute the command ping, I get weird results: bash-3.00$ usr/sbin/ping localhost ... (4 Replies)
Discussion started by: Przemek
4 Replies

4. Solaris

unable to ping a host in another domain

Hello I have a server in it.siroe.com I added it.siroe.com in /etc/resolv.conf. I still can't ping the server. any service to restart here? any other file to edit? thx (4 Replies)
Discussion started by: melanie_pfefer
4 Replies

5. Solaris

Unable to ping Solaris VM from Xp host

Hi All, I am using Vmware Workstation 6.0.3 build-80004. Guest OS: Solaris 10 Host OS : Win XP I am getting request time out when i am trying to ping from XP ( cmd line) to Solaris VM - I have assigned IP 192.168.50.5 in Solaris VM ( Hostname: Tower1) and it is in UP status. ... (4 Replies)
Discussion started by: saurabh84g
4 Replies

6. IP Networking

ping can not recognize host but host command can

Hi, I have a weird problem. when ever I do ping command like for example ping unix.comI get the following message: # ping unix.com ping: unknown host unix.com but when I use host the computer is able to know the host. # host unix.com unix.com has address 81.17.242.186 unix.com mail is... (2 Replies)
Discussion started by: programAngel
2 Replies

7. Solaris

able to ping all hosts but not able to traceroute any host

i am using solaris 10 and i am able to ping all the hosts but i am not able to traceroute any of them. how to fix this? (9 Replies)
Discussion started by: chidori
9 Replies

8. Shell Programming and Scripting

Ping Host Until it is up and email

Hi I am trying to write a script which runs until the host is up. i got it figured out that it needs to be in loop till it return $? = 0. Not getting it through though. I am not sure about the 6th line !!! #!/bin/sh HOSTS="host.txt" ping(){ for myhost in "$HOSTS" do ping -c -1 "$myhost"... (8 Replies)
Discussion started by: Antergen
8 Replies

9. Shell Programming and Scripting

Ping Response from the host name

Hi All, I have the requirement where am pinging the server and matching the IP address with the existing IP address. Below code is returning me the IP address and my requirement is i have to see that also whether it is pinging or not PING useipapd01 (172.22.32.87) 56(84) bytes of data. 64... (1 Reply)
Discussion started by: sharsour
1 Replies

10. AIX

Ping to remote host failed

Actually. I was getting a ping to remote host failed for one of my etherchannel. When I checked it was in backup adapter and again I use to faileover and brought to primary channel. But it was again going to backup channel and giving me the alert ping to remotehost failed. When I checked the load... (3 Replies)
Discussion started by: Mohamed Thamim
3 Replies
CISCO_IOS2DLF.IN(1)					  LogReport's Lire Documentation				       CISCO_IOS2DLF.IN(1)

NAME
cisco_ios2dlf - convert cisco logs to dlf format SYNOPSIS
cisco_ios2dlf DESCRIPTION
This script expects syslog-type logs from a CISCO IOS router on stdin. These look like e.g. Jul 3 00:00:39 router 40108: 4d09h: %SEC-6-IPACCESSLOGP: list FR_VA_in permitted udp 192.168.19.1(137) (Serial0/0.2 DLCI 120) -> 192.168.19.255(137), 2 packets Jul 3 00:02:39 router 40109: 4d09h: %SEC-6-IPACCESSLOGP: list FR_VA_in permitted udp 192.168.80.42(138) (Serial0/0.2 DLCI 120) -> 192.60.60.148(138), 1 packet Jul 3 00:02:39 router 40110: 4d09h: %SEC-6-IPACCESSLOGDP: list FR_VA_in permitted icmp 192.168.80.82 (Serial0/0.2 DLCI 120) -> 149.1.1.1 (8/0), 1 packet or Aug 19 04:02:34 gateway.foo.bar 218963: Aug 19 04:02:32.977: %LINEPROTO-5-UPDOWN: Line protocol on Interface BRI0:1, changed state to down Aug 19 04:02:34 gateway.foo.bar 218964: Aug 19 04:02:33.262: %ISDN-6-DISCONNECT: Interface BRI0:1 disconnected from 172605440 acme, call lasted 42 seconds Aug 19 04:02:35 gateway.foo.bar 218965: Aug 19 04:02:33.266: %LINK-3-UPDOWN: Interface BRI0:1, changed state to down Aug 19 04:02:38 gateway.foo.bar 218966: Aug 19 04:02:36.103: %SEC-6-IPACCESSLOGP: list 102 denied tcp 100.198.139.148(4652) -> 100.193.176.49(80), 1 packet Aug 19 04:02:45 gateway.foo.bar 218967: Aug 19 04:02:43.543: %ISDN-6-LAYER2DOWN: Layer 2 for Interface BR0, TEI 86 changed to down Aug 19 04:02:53 gateway.foo.bar 218968: Aug 19 04:02:51.471: %SEC-6-IPACCESSLOGP: list 102 denied tcp 100.74.103.1(2162) -> 100.193.176.98(80), 1 packet The outputted dlf files look like: 994118619 permitted icmp 192.168.80.9 - Serial0/0.2 DLCI_120 192.168.19.1 - 1 994118619 permitted udp 192.168.19.1 138 Serial0/0.2 DLCI_120 192.168.19.255 138 1 EXAMPLES
To process a log as produced by Cisco IOS: $ cisco_ios2dlf < cisco.log cisco_ios2dlf will be rarely used on its own, but is more likely called by lr_log2report: $ lr_log2report cisco_ios < /var/log/cisco.log AUTHORS
Francis J. Lacoste based on initial code by Joost Bekkers <joost@jodocus.org> VERSION
$Id: cisco_ios2dlf.in,v 1.8 2006/07/23 13:16:35 vanbaal Exp $ COPYRIGHT
Copyright (C) 2001 Joost Bekkers <joost@jodocus.org> Copyright (C) 2002 Stichting LogReport Foundation <logreport@logreport.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 CISCO_IOS2DLF.IN(1)
All times are GMT -4. The time now is 10:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy