Sponsored Content
Top Forums Shell Programming and Scripting Animation Ping on Solaris Like Cisco Ping Post 302579015 by gokcell on Saturday 3rd of December 2011 09:40:25 PM
Old 12-03-2011
Animation Ping on Solaris Like Cisco Ping

Hi,

I develop simple animation ping script on Solaris Platform. It is like Cisco ping.

Examples and source code are below.
Code:
bash-3.00$ gokcell 152.155.180.8 30
Sending 30 Ping Packets to 152.155.180.8
!!!!!!!!!!!!!.!!!!!!!!!!!!!!!.
% 93.33 success... % 6.66 packet loss...
Start:04-12-2011-03:53:17
End :04-12-2011-03:54:08


bash-3.00$ gokcell 152.155.180.8 60
Sending 60 Ping Packets to 152.155.180.8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
% 100.00 success... % 0 packet loss...
Start:04-12-2011-05:36:40
End :04-12-2011-05:37:44



bash-3.00$ more gokcell
#!/bin/bash
count1=0
count2=0
start=`date +"%d-%m-%Y-%T"`
#Developed by Goksel Yangin for STC Network 
echo
echo Sending $2 Ping Packets to $1
echo
for ((i=1; i<=$2; i++))
do
  sonuc=`/usr/sbin/ping -s $1 64 1 | grep packet | awk '{print $(NF-2)}'`
  sleep 1
  if [[ "$sonuc" == "0%" ]]
  then
    count1=`expr $count1 + 1`
    echo -n !
  else 
    count2=`expr $count2 + 1`
    echo -n .
  fi
done
end=`date +"%d-%m-%Y-%T"`
let "count1*=100"
#let "count1/=$2"
#let kalan=count1%$2 

let "count2*=100"
#let "count2/=$2"
#let kalan2=count2%$2

echo
num1=$(echo "scale=2; $count1 / $2" | bc) 
num2=$(echo "scale=2; $count2 / $2" | bc) 
#printf "\x1b[5m$num1..$num2\x1b[25m"
#echo -n % $num1 success... % $num2 packet loss...
echo -n "`tput blink`% $num1 success... % $num2 packet loss...`tput sgr0`"
echo 
echo Start:$start 
echo End :$end
echo

Regards,

Goksel Yangin
Computer Engineer

Last edited by Scott; 12-04-2011 at 07:44 AM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Solaris Based Ping Sweeper

good morning, anybody know of a good Freeware ping sweeper for Solaris, I've been given the job of finding active IP's on the network, would like a tool which can search for range or address's do you know of anything cheers Kie (2 Replies)
Discussion started by: kie
2 Replies

2. Shell Programming and Scripting

Perl telnet to cisco router and compare the ping ms

All Please help, i will telnet to router to obain the ping status and compare, if higher than normal latency, i will have further action.. if i do the telent and in perl script then .... e.g the result i obtain from the router will be =' Success rate is 100 percent (5/5), round-trip... (4 Replies)
Discussion started by: optimus
4 Replies

3. Solaris

Can't ping using hostname on Solaris 10

I recently installed Solaris 10 on my Sun workstation. I cannot ping using hostname from another computer on the same network. But I can ping using the IP address. Also I can ping other systems using their hostnames. Can anyone give some information regarding how to resolve this issue. (4 Replies)
Discussion started by: alpha123
4 Replies

4. Solaris

Can not ping from Solaris VMWare to Windows

Dear All, I have installed Sun Solaris 10 on VMWare 6.5 completely and i have configured IP address already. Solaris's IP Address (on VMWare) is 192.168.10.241 and Windows xp that contain VMWare IP address is 192.168.10.125, but when i ping from solaris to my windows it didn't response at all.... (3 Replies)
Discussion started by: veasnabee
3 Replies

5. Solaris

Ping Sun Solaris 10 on VmWare

Hi, i installed Sun Solaris 10 on VmWare Workstation 6.5 on my Windwos Vista PC. I would to ping solaris virtual machin froma my pc, but i can't do that. Can help me?! I'm sorry for my bad English. akela87 (2 Replies)
Discussion started by: akela87
2 Replies

6. Solaris

solaris ping timeout

Hi, I have two solaris 9 servers on the same switch, primary int0: 10.35.65.51 int1: 10.35.65.53 warm standby int0: 10.35.65.52 int1: 10.35.65.54 Primary server communicates with the other for db replication on int0 interfaces. But meanwhile we are using web interface running... (8 Replies)
Discussion started by: magnimious
8 Replies

7. 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

8. Solaris

Solaris 10 - ping network issue

Hi, I'am begineer in this OS. I've installed it few days ago only to perform project "Managing users in Solaris". I have to create two virtual systems in eg. vmware , connect them and eg. rlogin from user1/machine1 to user2/machine2, give them some permissions to write read etc (this is... (1 Reply)
Discussion started by: michael.pelc
1 Replies

9. Shell Programming and Scripting

How to get reason for ping failure using perls Net::Ping->new("icmp");?

Hi I am using perl to ping a list of nodes - with script below : $p = Net::Ping->new("icmp"); if ($p->ping($host,1)){ print "$host is alive.\n"; } else { print "$host is unreacheable.\n"; } $p->close();... (4 Replies)
Discussion started by: tavanagh
4 Replies

10. Programming

Ping test sends mail when ping fails

help with bash script! im am working on this script to make sure my server will stay online, so i made this script.. HOSTS="192.168.138.155" COUNT=4 pingtest(){ for myhost in "$@" do ping -c "$COUNT" "$myhost" &&return 1 done return 0 } if pingtest $HOSTS #100% failed... (4 Replies)
Discussion started by: mort3924
4 Replies
asadmin-jms-ping(1AS)						   User Commands					     asadmin-jms-ping(1AS)

NAME
jms-ping - checks to see if the JMS provider is up and running SYNOPSIS
jms-ping --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--passwordfile filename] [--secure|-s] [--terse=false] [--echo=false] [--interactive=false] Checks to see if the JMS provider is up and running. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --passwordfile file containing the domain application server password. --secure if true, uses SSL/TLS to communicate with the domain application server. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. Example 1: Using jms-ping asadmin> jms-ping --user admin --password adminadmin --host bluestar --port 4848 server1 JMS Ping Status=RUNNING EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-jmsdest(1AS), asadmin-delete-jmsdest(1AS), asadmin-list-jmsdest(1AS) J2EE 1.4 SDK March 2004 asadmin-jms-ping(1AS)
All times are GMT -4. The time now is 02:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy