capture ping to a file


 
Thread Tools Search this Thread
Operating Systems Solaris capture ping to a file
# 1  
Old 09-13-2007
capture ping to a file

I would like to capture the output from ping into a file.
I am on solaris 9.

I can get the basic "server is alive" command in a file, but I want the response from ping -s into a file. I am going to schedule this in cron to run at certain times during the day.

When I run the ping -s in a script it just keeps going and going.

I already have traceroutes, but I want the ping -s also.Smilie
# 2  
Old 09-13-2007
Code:
ping -s > /path/to/file

# 3  
Old 09-14-2007
Quote:
it just keeps going and going
The fix is to set how many times it attempts to ping - read the man page for ping - there is a packetsize and count with the -s option.

ping -s myhost 56 10 > pingresults
(56 packetsize is a default normally, but with the -s you need to put it in)
This ping command will do 10 attempts of ping to myhost and then stop.
# 4  
Old 09-20-2007
AH. I was looking for that in the man pages. Missed it.

Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

String capture from ip file

Dear All From below mention input file I want op file as mention. Kindly help. IP file: "BSCGNR4_IPA17_C" 329 140119 0717 RXOCF-105 KJO001_BASC_NG AC FAULTY DG ON DOOR OPEN Needed OP: 140119 0717 KJO001_BASC_NG AC FAULTY DG ON DOOR OPEN Note that string mark in red as variable in... (3 Replies)
Discussion started by: jaydeep_sadaria
3 Replies

3. Shell Programming and Scripting

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. 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...... (1 Reply)
Discussion started by: gokcell
1 Replies

4. Shell Programming and Scripting

Want ro capture the debug in output file

I want to capture the debug for the below command in output file . i tried like this but its not working: sh -xv <scriptname> >> output.log i want the output in a log file. Anyone plz help in this (2 Replies)
Discussion started by: chakkaravarthy
2 Replies

5. Shell Programming and Scripting

capture the last file when you don't know the all name

I have to ftp a file from a directory in Windows, I need to be able to ftp the last file that was put in the directory, the only thing I know about that file is that the 4 first digits are always the same (3520) then it is a _5(more digits), random digits, so it will be something like this... (1 Reply)
Discussion started by: rechever
1 Replies

6. Shell Programming and Scripting

capture output of file and send last string thereof to new file

Hello, If I run a program from within shell, the output is displayed in the command line terminal. Is there a way I can capture that output and choose only the very last string in it to send it to a new file? Thank you (6 Replies)
Discussion started by: Lorna
6 Replies

7. Shell Programming and Scripting

Capture data in a file

How to capture the rows in a file after executing the store procedure using the perl scripts? (0 Replies)
Discussion started by: vinay123
0 Replies

8. Shell Programming and Scripting

Script to capture new lines in a file and copy it to new file

Hi All, I have a file that gives me new line/output every 5 minutes. I need to create a script that capture new line/output besides "IN CRON_STATUS", in this case the new output is "begin ------ cron_status.sh - -----------". I want this script to capture the line starting from "begin ------... (0 Replies)
Discussion started by: fara_aris
0 Replies

9. Shell Programming and Scripting

capture the file name

I am trying to capture the file name(which is not of fixed length) and put it in a variable. It is working in unix whereas when I am running the same script in Informatica it is not giving me the desired output. But when I comment the option(find the file name) then it is working fine. It can... (4 Replies)
Discussion started by: Mandab
4 Replies

10. UNIX for Advanced & Expert Users

Capture Value from file

I have a file in the following Format Fundid: 100-BankA AccountNumber Balance 1 200 2 300 3 400 FundId:123321-BankB AccountNumber Balance 1 200 3 100 ........... I can have N number of funds. (1 Reply)
Discussion started by: kris01752
1 Replies
Login or Register to Ask a Question