LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-28-2006, 08:46 PM   #1
seefor
Member
 
Registered: Mar 2006
Posts: 34

Rep: Reputation: 15
Question monitoning services


Greetings all,

I'm new to Linux and was looking around for some kind of software that monitors your service(s).
If a service stop it will send out an email. Is there anything like that out there?

Thanks in advance,
Sif aka SeeFor

Last edited by seefor; 03-28-2006 at 08:53 PM.
 
Old 03-28-2006, 09:13 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Are you talking about a home PC or do you have several PCs in an office? Nagios (http://www.nagios.org/) is probably overkill for home, but is useful in an office.

Alternatively, set up a cron job that scans your open ports and emails you when one of them no longer accepts connections.
 
Old 03-28-2006, 09:39 PM   #3
seefor
Member
 
Registered: Mar 2006
Posts: 34

Original Poster
Rep: Reputation: 15
gilead thank you very much.

It's for the office, we have six new Linux servers and I'm now learning Linux

Thanks for your advice.

Not sure how to setup a cron job to scan open ports. So I will start off by looking in to Nagios.

Thanks again!

-Sif aka SeeFor
 
Old 03-29-2006, 06:39 AM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
If you have nmap installed you can create a cron job in (for example) /etc/cron.hourly called stopped-daemons.sh that contains the following (change the port numbers to those you want to monitor):
Code:
#!/bin/sh

for CLOSED in "$(/usr/local/bin/nmap -p 22,80,443 localhost | /usr/bin/grep 'closed' | /usr/bin/awk {'print $1'})"; do
  if [ ! -z "$CLOSED" ]; then
    echo "Port $CLOSED has closed."
  fi
done
cron should email any output to you and there should only be output if one the ports 22, 80 or 443 becomes closed.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Necessary Services? nistelrooy Linux - Security 5 02-25-2005 08:25 AM
TightVNC Ver terminal Services.. also looking for terminal Services for linux 2782d4 Linux - Security 3 05-20-2004 02:30 AM
Services xneowolf Linux - General 11 01-24-2003 10:21 PM
services xlord Slackware 2 01-19-2003 12:43 AM
Services matt3333 Linux - Distributions 1 01-15-2003 10:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:16 AM.

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