3

I'm looking for open-source software or other solution to install on my linux server that will keep me up to date on the server's performance and status by email.

I envision something like this:

  • I receive regular (daily or so) email updates with the server's status. (disk and memory usage, performance, load, etc.)
  • When something important happens like an attack is detected by fail2ban, something is failing, a reboot is necessary after an automated update or something similar I receive an email.
  • Real-time statistics from web- or command line interface.

I've always had email notifications from my Windows server, but with Linux I am yet to come across such an option.

Thanks in advance!

Pylsa
  • 205
  • 1
  • 3
  • 9

4 Answers4

3

I use logwatch for monitoring servers, it doesn't do performance logging by default though, it's very simple to configure. Nagios will do very precise availability and performance monitoring, it also can send e-mails when some thresholds are met.

Hubert Kario
  • 6,351
  • 6
  • 33
  • 65
3

There are a number of widely available, well-supported, and open source systems to monitor your server health in near-real-time. Check out the following in combination with logwatch:

Ganglia - http://ganglia.sourceforge.net/

Munin - http://munin-monitoring.org/

Monit - http://mmonit.com/monit/

There are other systems that will perform specific checks on machine health and alert you immediately as well. Nagios is very user-extensible and you can write a plugin to monitor almost anything.

Nagios - http://www.nagios.org/

Zabbix - http://www.zabbix.com/

OpenNMS - http://www.opennms.org/

Sam Halicke
  • 6,122
  • 1
  • 24
  • 35
2

If you will be monitoring more then one system, setting up Nagios will provide what you are asking, for a single system it is probably overkill.

It isn't exclusive to Linux either, it will handle Windows servers, routers, switches, printers, etc.

There are a ton of different plugins available to interact with various systems to get detailed information out of them along with supporting purely SNMP based items.

An example is with our Dell servers, we load NSClient++ on the machines with the check_openmanage plugin so that Nagios can get details on power supplies, cpus, memory, disk controllers, drives, fans, etc.

Also see my answer about some other monitoring where I put some more information about Nagios.

Regarding the email, Nagios is event based, when something happens it sends a notification based on the rules of time of day, degree of issue, etc. As far as I know, there isn't a daily recap email, you just login to the web interface and look at the status' in real time. There may be some options or an extension available to do so though. Nagios is a heavily used monitoring suite and so there is a lot of 3rd party work done for it.

Additional Information:

The core Nagios server is licensed under GPL as are many of the plugins released for public use. There are some commercial add-ons also available and a commercial support available from Nagios.

Nagios is typically run on a single independent machine. It could be run on a shared server but depending on what kind of outage to that server, you may not get the alerts that something happened.

There are more advanced configurations of Nagios to have local information collectors that report back to a centralized Nagios system and double monitoring so that loss of a monitoring server can be reported along with other issues during that period of time.

You can execute probes on a linux server locally using NRPE. For windows I recommend NSClient++, there is also an NRPE_NT but I've found NSClient++ more stable and they can run the same probes.

NConf is a very useful web based configuration utility for Nagios. NConf doesn't update the Nagios configuration live but rather generates a tgz of the config files to extract into the nagios directory. I tossed a simple bash script into my home directory so after I generate the configs I run it, see below.

#!/bin/bash
tar -xzvf /var/www/localhost/htdocs/nconf/output/NagiosConfig.tgz -C /etc/nagios
/etc/init.d/nagios restart
ManiacZX
  • 1,646
  • 13
  • 16
  • I will be monitoring 4 servers at a time so yes, this might work... Is this free to use as a business solution? – Pylsa Oct 05 '10 at 18:26
  • @BloodPhilia as far as I have seen yes. The Nagios Core is released under GPL. Anything beyond could be licensed differently as there are Web UIs, configuration management tools, probes, etc built by 3rd parties to add to Nagios' functionality. – ManiacZX Oct 05 '10 at 18:33
  • Thanks for the quick reply, I think Nagios will be the way to go for me... Have you used this system? – Pylsa Oct 05 '10 at 18:35
  • nagios is free unless you want paid support – warren Oct 05 '10 at 21:24
  • @BloodPhilia yes I use Nagios to monitor two racks of equipment at two datacenter locations, about 30 restaurant POS systems and various other customer sites. It is very versatile, I monitor status of RAID arrays, VPN tunnels, credit card processing software, mail services, SSL certificate expirations, etc. – ManiacZX Oct 05 '10 at 22:50
  • Very nice! From what I can tell, it's a single server that checks connectivity and receives additional status inputs from Nagios software that is installed on e.g. a server? – Pylsa Oct 06 '10 at 13:32
  • @BloodPhilia You will run Nagios on a single machine. For probes such as ping, snmp requests, http content checks, etc there is no software required on the machine it is checking as it is checking to make sure the services that the server is offering are operating. For things like log monitoring, windows event viewer, if a task is running, disk space, raid status, etc is when you need to put NRPE or NSClient++ on the machine so that Nagios can probe for information not publicly accessible. – ManiacZX Oct 06 '10 at 18:06
  • An absolute winner! Thanks a MILLION! :D NConf works like charm as well! – Pylsa Oct 07 '10 at 11:09
  • @BloodPhilia yes, I manage one nagios server by the text files and one by NConf. I'm migrating as much as I can to the NConf one, it makes adding new items a cinch as if you hadn't seen yet, under the advanced there is a choice for clone. Any time a new server, router, firewall, etc needs to be monitored, I just clone an existing one then modify to my needs. – ManiacZX Oct 07 '10 at 18:59
  • I added a permanent alias to my shell: `nagrel='/path/to/nconf/ADD-ONS/deploy_local.sh; /etc/init.d/nagios restart;'` – Pylsa Oct 08 '10 at 16:46
1

i have one small code which send you cpu load like wise i'm developing for memory and network usage you try following link for the same

http://studyhat.blogspot.com/2010/09/cpuload-and-send-email-to-admin.html

http://studyhat.blogspot.com/2010/09/memory-use-by-which-process-centos-rhel.html

http://studyhat.blogspot.com/2009/10/linux-memory-use.html

may be help you above links

Thanks :)

Rajat
  • 3,329
  • 21
  • 29