Solved

Remote port availability monitoring with notifications

Posted on 2007-03-26
3
310 Views
Last Modified: 2010-04-20
I want to be able to watch a few remote systems for application availability and send a notification via SMTP if they bocome unavailable. I only need to see if the HTTPS port is listening say every minute and then send the notification.

I am sure I could do this with a script but would rather just use something already proven, open source and, even better, an RPM for FC4 or something that is straightforward to compile.

Anybody have any ideas?
0
Comment
Question by:ferg-o
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
Luxana earned 125 total points
ID: 18797745
Hi,

You can use lsof as the main core of your smalll IDS. Change "awk" to regex you prefer. This will check it every 10 secs.


#!/bin/bash
MAILTO="root"
HOSTNAME=`hostname`
getports() {
  lsof -i -n -P | awk '/LISTEN/ {print $1"/"$3"/"$8}' | sort -u
}

OLD="$(getports)"
echo -e "Services monitored:\n$OLD"
while sleep 10 ; do
  NEW="$(getports)"
  if test "$OLD" != "$NEW" ; then
    echo "Sending mail to administrator"
    mail -s "Warning: $HOSTNAME LISTEN-Status changed" $MAILTO <<EOF
#old status
$OLD

#new status
$NEW
EOF
  fi
  OLD="$NEW"
done


Hope this helps...
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 125 total points
ID: 18797882
Nagios is what a lot of people use, but it maybe a little overkill if you're just monitoring a couple of servers.

http://nagios.org/
0
 
LVL 4

Author Comment

by:ferg-o
ID: 18798503
Hi thanks for these - the script option is beind me to customise and I would have trouble growing it out as I need to monitor more device.

Nagios is very configurable etc but definately too much for us at this stage - it would take me more time to configure it than I would save!

The only sorta easy things for dumb admins that I have found runs on Windows...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question