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 07-27-2015, 04:34 AM   #1
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Rep: Reputation: 20
Tool to monitor hosts and services & notify through mail and XMPP?


Hi all,

Currently I'm using a windows based program to do this but I wonder if there is something similar for linux and move away from a complete win-based system, just for this.
If possible, doing this on a RPI would be awesome.

What I would like to do is to be able to monitor:
- hosts
- services
and notify by mail or XMPP when going offline or online.

Thanks a lot in advance for your suggestions!
Peter
 
Old 07-27-2015, 05:02 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
There are a bunch of monitoring tools. Most notable is nagios. Though I dig Zabbix. A more complete and easier to setup tool imho.
For only a few machines maybe munin might suite. Also i don't know if it has an alert function. But creates nice graphs and does not need a server on its own but can just run the client.
Nother thing to do if it really is only a few systems use some hand rolled bash script.

Quote:
#!/bin/bash
ping hostname -c 1 -t 5
if [ $? -eq 0 ]; then
echo "System up"
else
echo "system down $hostname" | mail your@address.com
fi
 
1 members found this post helpful.
Old 07-27-2015, 08:22 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
zabbix supports the jabber protocol.
 
1 members found this post helpful.
Old 07-28-2015, 03:49 AM   #4
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
Thank you for these suggestions, I will have a look at them.

@zhjim: is it possible with scripting to check if services on remote hosts are running and I guess that notifications through XMPP also might be possible but it will become quite complex for me.
Therefore: if there are tools for this, I will certainly not reinvent the wheel.
 
Old 07-29-2015, 03:10 AM   #5
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
zhjim, can you - or someone else - elaborate a little on sending a mail based on this example?
I would like to use it for a friend to check the availability of his VPN host which runs on a private connection.

What are the minimum requirements to be able to make this work and just send a mail on a system without GUI? I guess:
1) finalizing your example - assume that the $hostname has to be defined
2) SMTP configuration
3) creating a cron job

Since this doesn't work for a service, what would be the way through a script?

TIA!
 
Old 07-30-2015, 02:19 AM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by Peterken View Post
What are the minimum requirements to be able to make this work and just send a mail on a system without GUI? I guess:
1) finalizing your example - assume that the $hostname has to be defined
2) SMTP configuration
3) creating a cron job
hostname needs to be defined and mail needs some more arguments. Namely -s "the subject of the mail". Just run the example and see what mail asks for. Also check the options for ping. -t should be the time out and -c be the count. Just double check. And while your at it use some absolute path to the binaries so you don't run into trouble when using cron.
working smtp configuration check
cronjob check


Quote:
Originally Posted by Peterken View Post
Since this doesn't work for a service, what would be the way through a script?
By some degree it can be done. I sometimes use telnet to see if services are alive. If it returns cryptic characters the service is a live. Also with the SSL upcome on most services telnet is lacking. Nother approach would be to use expect and parse the output of telnet.
But for checking on services i would use some of the tools metioned above. Way easier. Though the hand roll approach should be more rewarding.
 
  


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
[SOLVED] What is the best way/tool to monitor several services, and issue a restart command? abefroman Linux - Server 7 08-02-2013 03:12 AM
/etc/hosts & /etc/services files reverting to older versions after reboot. Tantalis Slackware 4 07-13-2009 05:59 PM
What is the Best Mail&Domain Management Tool for Freebsd dablew Linux - Server 0 04-27-2008 10:33 AM
What is the best tool to monitor services on linux? abefroman Linux - Software 6 04-11-2008 09:45 AM
Simple tool to monitor real-time bandwidth usage of all connected hosts on LAN? mattp52 Linux - Networking 5 02-13-2008 11:18 PM

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

All times are GMT -5. The time now is 04:07 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