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
You could script something up yourself (with nmap, or even attempting to telnet to a port).
Or, try this: Zazzy Gambling News 2021 – Internet Casino Bulletin
Cheers,
ZB
you are looking for it or have you tried doing it yourself?
if you have lsof, you can just check for that port
lsof -i tcp:22
if it returns results, then its listening..
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.
#!/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.
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