Sponsored Content
Operating Systems Solaris Ping trace telnet monitoring script Post 302539410 by marmellata on Sunday 17th of July 2011 01:08:10 PM
Old 07-17-2011
thanks for your reply,

Code:
WEB="www.google.it"
GW="192.168.1.1"
PORT="80"


if ping -c 5 -w 5 -n ${GW} | grep -q "bytes from"
then
  echo ${GW} " is OK"
else
  echo ${GW} " is DOWN"
fi

if telnet -e "b" ${WEB} ${PORT} | grep -q "connected to"
then
  echo ${WEB}:${PORT} " is OK"
else
  echo ${WEB}:${PORT} " is DOWN"
fi

Code:
marmellata@marmellata-desktop:~/testping$ sh test.sh 
192.168.1.1  is OK
..
..
..

it stops on telnet command



Kind regards

-

---------- Post updated at 08:52 AM ---------- Previous update was at 08:43 AM ----------

I've been also trying to implement traceroute command so that if I can reach PROXY I get an answer or if I dont reach PROXY but can rach PROXY1 I get another answer. Doesnt work, how can I do it ?

Code:
PROXY="10.99.4.1"
PROXY1="10.40.4.1"

if traceroute ${PROXY} | grep -q "10.99.4.1"
then
  echo ${PROXY} " is OK"
elif grep -q "10.40.4.1" !"10.99.4.1"
then
  echo ${PROXY} " is DOWN but "${PROXY1} " is UP"


Last edited by Scott; 07-17-2011 at 11:57 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. IP Networking

ping and telnet

I can ping other computers in my office. I can telnet other users in my office but i cannot get out of the office network. If i try to go out side of my network it cannot find host. Any ideas? (5 Replies)
Discussion started by: macdonto
5 Replies

2. AIX

Ping/Telnet is not happening

Hi All, We are not able to ping to a AIX box...Network is ok..when we give ping from that AIX box..it is giving 0821-067 ping: The socket creation call failed.there is no enough buffer space for the requested socket operation. refresh -s inetd is also giving socket error. Please help to... (1 Reply)
Discussion started by: b_manu78
1 Replies

3. IP Networking

can ping but can not telnet UNIX

I have one problem and it is giving me hard time I can ping my windows machine root@x1ChXpress:/sbin >ping 192.168.129.66 192.168.129.66 is alive root@x1ChXpress:/sbin >netstat -rn Routing Table: Destination Gateway Flags Ref Use Interface... (3 Replies)
Discussion started by: amon
3 Replies

4. Shell Programming and Scripting

Monitoring script (Ping, MySQL)

Hi guys - Relatively new to shell programming so please bare with me (I bet everyone says that!) I'm faced with a problem: I need a shell script to do the following: Connect to a MySQL database and pull all entrys from the nodes field in a table called 'nodes' These nodes will then be... (1 Reply)
Discussion started by: daveomcgee
1 Replies

5. Infrastructure Monitoring

no telnet, ping ok...

We have a Sun Solaris Netra 20 server. Our O&M Server gets Alarm Processor not responding. When Alarm occurs, you can ping the sun server but cannot telnet it. We keep getting Interrupt level not serviced. var/adm/message log is > tail -f messages Apr 12 20:09:56 cama pcisch: PCI-device:... (9 Replies)
Discussion started by: krabu
9 Replies

6. UNIX for Advanced & Expert Users

ping and telnet - HP-UX

Hi all, I am not sure if my problem is specific to HP-UX or not. Hopefully someone can tell me what's wrong. I have a server name server1 10.100.50.10 in the /etc/hosts file and if I do a ping server1, it shows the right IP address. However, if I run telnet server1, it is not using... (4 Replies)
Discussion started by: newbie_01
4 Replies

7. AIX

ping OK - telnet refused

Hi, After a crash of our older AIX server it happend as it is in the title: ping is ok, but telnet: What it can be this strange thing? Franci (2 Replies)
Discussion started by: frajer
2 Replies

8. UNIX for Dummies Questions & Answers

ping,telnet, traceroute

can you provide the command in solaris8 if I wanted to ping,telnet, traceroute an IP address with a port? thanks (1 Reply)
Discussion started by: lhareigh890
1 Replies

9. Shell Programming and Scripting

ping and telnet timeout

Hello, I need help, I have the following which save in the result file ping and telnet:port test. Basically the script works but I should implement a check on ping and telnet command so that ping has 5 seconds threshold and telnet (more important) 10 seconds. Over that threshold ping and... (0 Replies)
Discussion started by: marmellata
0 Replies

10. Shell Programming and Scripting

Need shell script to Telnet multiple node , Ping some IP and print output

Hi Team, Need shell script to Telnet multiple node , Ping some IP and print output like pass or fail. Need this script to check reachability of multiple nodes at same time. Help me. I use this but not working... Eg. in this script i need to telnet... (4 Replies)
Discussion started by: Ganesh Mankar
4 Replies
Wiki::Toolkit::Plugin::Ping(3pm)			User Contributed Perl Documentation			  Wiki::Toolkit::Plugin::Ping(3pm)

NAME
Wiki::Toolkit::Plugin::Ping - "ping" various services when nodes are written SYNOPSIS
use Wiki::Toolkit::Plugin::Ping; my $ping = Wiki::Toolkit::Plugin::Ping->new( node_to_url => 'http://mywiki/$node', services => { "geourl" => 'http://geourl.org/ping?p=$url' }, agent => "My Wiki ping agent", ); $wiki->register_pugin( plugin => $ping ); DESCRIPTION
A plug-in for Wiki::Toolkit sites, which will "ping" various external services when a node is written. A list of the services to ping, and where in their URLs to add the URL of the node, are supplied when the plugin is created. You need to tell it how to turn a node into a URL (node_to_url), and what services to ping (services). You can optionally pass a custom user-agent string AUTHOR
The Wiki::Toolkit team (http://www.wiki-toolkit.org/) COPYRIGHT
Copyright (C) 2003-2004 I. P. Williams (ivorw_openguides [at] xemaps {dot} com). Copyright (C) 2006-2009 the Wiki::Toolkit team (http://www.wiki-toolkit.org/) All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Wiki::Toolkit, Wiki::Toolkit::Plugin, OpenGuides perl v5.10.1 2009-02-24 Wiki::Toolkit::Plugin::Ping(3pm)
All times are GMT -4. The time now is 05:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy