Unix Port Monitoring Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix Port Monitoring Script
# 1  
Old 06-28-2007
Unix Port Monitoring Script

Is there a script which monitors a specific port and tells whethers its listening
basically i am looking for a script which we can hardcode the port number there and hardcode an email address. It should alert to the email if the port is down.
any idea.?plz
# 2  
Old 06-28-2007
You could script something up yourself (with nmap, or even attempting to telnet to a port).

Or, try this: http://www.zazzybob.com/svcmon.html

Cheers,
ZB
# 3  
Old 06-28-2007
you are looking for it or have you tried doing it yourself?
if you have lsof, you can just check for that port
Code:
lsof -i tcp:22

if it returns results, then its listening..
# 4  
Old 06-28-2007
yes i did use lsof..but its a command ..i was looking for script and lets see i can use the solution mentioned by zazzybob
# 5  
Old 06-29-2007
Quote:
Originally Posted by tintedwindow
yes i did use lsof..but its a command ..i was looking for script and lets see i can use the solution mentioned by zazzybob
what's wrong with using the command inside a script? its just a simple as something like this.
Code:
#!/bin/sh
var=$(lsof -i tcp:22)
if [ ! -z "$var" ];then echo "found"; fi

fine tune it, schedule a cron job for it and off you go.
try to write scripts yourself instead of searching for a ready made script that fit exactly to your needs. most of the time, you won't find it.
# 6  
Old 06-29-2007
thanks ghostdog..
i am a newbie into unix..i am learning it...but am not a programmer basically..so its kinda painstaking to learn about unix programming
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies

2. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

3. Shell Programming and Scripting

Performance Monitoring script for UNIX servers

Hi, I have been working on writing an automated script that will run 24x7 to monitor the performance parameters like CPU,Memory,Disk I/O,Network,SWAP Space etc for all types of Unix servers ( HP-UX,AIX,SOLARIS,LINUX). Problem is I am confused with the commands top,prstat,vmstat,free,sar etc.... (4 Replies)
Discussion started by: ssk250
4 Replies

4. Shell Programming and Scripting

Help needed to create a UNIX Space monitoring script

Hi All, Its urgent.. pls help me out.. I want to create a KSH which should generate a report with the list of users and the files larger than 5 GB created by them in a direcorty and send autogenerated e-mail to them. my input would be users list,directory path and the file size (say 5 GB) ... (11 Replies)
Discussion started by: anman0523
11 Replies

5. Shell Programming and Scripting

Script to port a file from unix and save in windows

hi, when i finish running some scripts in unix...some csv file is getting generated...now im manually taking this csv file from this generated directory and using FTP, i'm importing to windows os and saving in a directory... please give me a script to automate this..so that i can add in my... (1 Reply)
Discussion started by: dll_fpga
1 Replies

6. Solaris

Solaris Port Monitoring

I would like to know if it is possible to read from an I/O Port in solaris. I need to monitor the parallel port of 1 PC and save all the incoming and outgoing messages. I use a SPARC Solaris running Solaris 2.5.1. I have seen a driver for x86 based systems but none for SPARC. Any help on how to... (8 Replies)
Discussion started by: devjay
8 Replies

7. Shell Programming and Scripting

Error in script to automate the daily monitoring process of UNIX server and it's proc

hi friends, I am trying to automate the daily monitoring process of UNIX server and it's processes. the script are below i executed the above script using ksh -x monitortest1.sh in root login . It shows error at some lines . 1. i logged in using root ,but it... (8 Replies)
Discussion started by: rdhaprakasam
8 Replies

8. AIX

Monitoring the network activity happening in a port in AIX 5.3

Hi All, I would like to monitor the volume of Data that is transferred through a single port in AIX. I have nmon installed in my machine. What is the best possible solution for this problem. Thanks in Advance. (3 Replies)
Discussion started by: bravo13
3 Replies

9. UNIX for Dummies Questions & Answers

Help: Unix Monitoring Script

guys, i am creating a script to monitor our sun solaris unix server and email me the result of the script. currently, i am using the prtdiag -v command in the script to diagnose the hardware specs of the server. any suggestions on what else could i add like disk monitoring (using df)... ... (1 Reply)
Discussion started by: maztahvoodoo
1 Replies
Login or Register to Ask a Question