LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2009, 07:04 AM   #1
hasan_sust
LQ Newbie
 
Registered: May 2007
Posts: 23

Rep: Reputation: 0
I am in need of a shell script


Hello All
I want to ping several ips from a linux machine, put this ping results to .xls file in hhmmddmmyy format. Again If if the packet loss is greater than 20%, script will send a mail to administrator, to an ftp server. Script will read ip lists from a file. I am new at linux . Please help me asap.
 
Old 02-01-2009, 07:24 AM   #2
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES11 / FC20/ OES / CentOS
Posts: 609

Rep: Reputation: 32
It`s not 100% what you are looking for, but it`s a start!

Code:
clear
name=$1
echo "Rechner mit der IP: " $name " wird ueberwacht!"

touch ./pingtest-dir/$1

echo "Rechner mit der IP: " $1 "wird überprüft!" >> ./pingtest-dir/$name
echo "========================================="  >> ./pingtest-dir/$name

i=1

while [ $i -eq 1 ]
	do 
	datum=`date +%Y-%b-%d-%H-%M-Uhr`
	echo $datum  >> ./pingtest-dir/$name
	/bin/ping -c 1 $1 | /usr/bin/tail -1  >> ./localtools/pingtest-dir/$name
	sleep 600
	done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 07:24 AM
help with execute mulitple shell script within shell script ufmale Programming 6 09-13-2008 01:21 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 03:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM


All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration