LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-16-2010, 12:59 AM   #1
HariharanV
Member
 
Registered: Aug 2010
Posts: 49

Rep: Reputation: 0
Shell script for monitoring


Hi All,



Am new for linux shell script,can any one guide me to monitoring the LISTENING IP's when using netstat -alnp commang.i need this as a shell script end it ll generated in one file.



Thanks,

Hariharan V.
 
Old 09-16-2010, 01:15 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
What have you tried so far?

I am a little confused about what you are trying to achieve.

Are you able to run the command netstat -alnp and identify which parts of the output are relevant for your request?

The following link provides an introduction to BASH script programming:
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
 
Old 09-16-2010, 02:12 AM   #3
HariharanV
Member
 
Registered: Aug 2010
Posts: 49

Original Poster
Rep: Reputation: 0
Hi,

natstat -alnp is working fine,i need to monitor particular port number.
what i want means? i wanna shell script for this......
 
Old 10-04-2010, 09:10 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Hi Hariharan,

Sorry for the delay, I have just got back from Holiday.

Have you read the link in my previous post, this should have shown you how to write a basic shell script

Example:
Code:
#!/bin/bash
###
### Script to get information about a specific port
###  (passed as the first variable)
###
usage() {
   echo "check_port [port]"
   exit 1
}

### Check number of parameters passed
if [ $# -lt 1 ]
then
   usage
fi


PORT=$1

### Run netstat -alnp and grab the relevant details
Please provide samples of the output that you get from netstat -alnp and highlight the section that you are interested in checking.
 
  


Reply



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
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
Korn Shell problem / User Monitoring script Fragments Programming 1 03-18-2010 07:09 AM
pass variable from one shell script into another shell script xskycamefalling Programming 9 10-03-2009 01:45 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:23 PM.

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
Open Source Consulting | Domain Registration