The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
snoop command on Sun box jimmyc IP Networking 1 04-02-2008 06:05 PM
snoop command kurtolo SUN Solaris 4 01-21-2008 08:55 AM
Snoop Functions mf_lattanzi SUN Solaris 0 05-08-2006 10:17 AM
snoop equivalent for AIX jcasares UNIX for Advanced & Expert Users 1 04-28-2005 11:45 AM
snoop equivalent pbonilla UNIX for Dummies Questions & Answers 2 04-22-2003 10:17 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-29-2008
tafil tafil is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 14
Snoop Script

Hi,

I want to write a script that checks an interface with the snoop command, if there is no traffic in 10 minutes on port 123 from the ip add 10.*.*.* it should send a e-mail.but i don't know how to start writing this script does anybody have an idea or an sample script that i can modifi.

Thanks in advance.
  #2 (permalink)  
Old 07-29-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
You have a couple of options as to how you interact with snoop, you can have it log to a file, then periodically look at that file, noting the timestamp of the most recent packet seen (some simple maths will then tell you if it's been more than 600 seconds), or you could open a filehandle to snoop and actually read from it's stdout and parse what it tells you.

The latter is more elegant but a tad more complex, the former is quick but you need to find a way to manage the temporary log size.
  #3 (permalink)  
Old 07-30-2008
tafil tafil is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 14
thanks for you answer
i was thinking the same to store a output file from snoop and then to analyze it but i make this script

if [ `snoop -c 50 -p 21 10.*.*.* 10.*.*.* | awk '/FTP/ {print $8}'` ]
then
echo "OK"
else
echo "Is not working (email will be send)"
fi

do you have a sample script ?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0