Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What tools do you use to monitor a Ubuntu web server? More specifically, I'd like to monitor server uptime, resource usage (RAM, CPU, bandwidth, etc.), Apache, MySQL and PHP.

share|improve this question
    
askubuntu.com/questions/169033/… –  Qasim Jun 16 '13 at 1:18

8 Answers 8

up vote 16 down vote accepted

Nagios is my favorite tool for monitoring. It can monitor web servers,services,hosts and so on. It is highly customizable and there are lot plugins available for various purpose.

Some features of nagios:

  • Monitor network services (SMTP, POP3, HTTP, NNTP, PING, etc.)
  • Monitor host resources (processor load, disk usage, etc.)
  • Allow for simple plugin design
  • Do parallelized service checks
  • Define a network host hierarchy using
  • Contact administrators when service or host problems occur
  • Define event handlers to be run during service or host events for proactive problem resolution
  • Automated log file rotation
  • Support the implementation of redundant monitoring hosts
  • Offer an optional web interface for viewing current network status, notification and problem history, log file, etc

Here is an online demo: http://nagioscore.demos.nagios.com/

share|improve this answer
1  
+1 for nagios: it is a mature and powerful software, and you will find a lot of tutorial on how to use it. –  crncosta Nov 23 '10 at 14:40
1  
Nagios is the de facto standard for monitoring services. –  Nanne Nov 21 '12 at 20:08

If you need a quick and simple information, ubuntu has a tool called landscape-sysinfo

This will print out: system load, hard-disk usage, memory usage, no of processes, and ip addresses of you box

Just enter in your console:

landscape-info
share|improve this answer

munin and its plugins are all you need.

It checks resources (like the others do) but unlike them, it's completely non-interactive. It writes out a batch of HTML files and graphs each time it updates. You can automatically zip these up and email them to you (the script would have to be your work but it would be simple) or you can make them available through Apache et al (just bind a virtualhost's root to /var/www/munin/).

The huge advantage over other (interactive) avenues is it's not a security risk. Running Webmin (as one example) means there's a process running that people can communicate with. That's an attack vector into your system. And being a fairly popular application means it's well targeted by people that script-hack servers.

It might be a bit "tinfoil hat" but security really is much easier to work with when you've only got a couple of vectors to cover.

share|improve this answer
    
You also forgot to mention that it does have the ability to page you when things get outside normal thresholds. Note that munin DOES have an attack vector, as the munin-node daemon listens on a port and could be exploitable. However, that is a lot less likely than compromises of webmin. –  SpamapS Nov 26 '10 at 7:17

It depends on the needs. But this is my monitoring stack

  1. Nagios: I use nagios as a centralized monitoring system to check the health of each servers. It alerts me if somethings goes wrong. For example, I have alerts set for situations like if my response time to a API goes beyond a threshold value.
  2. Monit: If something goes totally crazy, monit takes care of it. Suppose any component of my stack goes down. It alerts me and also bring it up for me.
  3. Logstash: Any suspicious activity recorded in my logs, it lets me know.
  4. SeaLion: Now all the above lets me know if there was a problem with my stack. But what caused the problem, I debug with SeaLion. Earlier I use to log the outputs of system profiling tools like sar, top, uptime, iostat, vmstat, netstat etc in files. But managing that huge logs was becoming impossible for me. SeaLion execute all these commands and show it in a beautiful timeline format. Also to mention that installation is so damn easy and simple.

SeaLion output

share|improve this answer
    
SeaLion is a great free tool for recording stuff happening on a server! –  kouton May 10 at 13:06
    
@stylusbrook is there any option to setup SeaLion server in intranet, like NagiOS server. why we trust on that SeaLion remote server ? –  Rahul Patil Jun 30 at 5:50

http://packages.ubuntu.com/serverstat

It's some PHP scripts that drives rrdtools and doesn't require MySQL like cacti.

share|improve this answer

I like to use a package that most people will probably use called Webmin

It's a web based program that allows you to monitor almost any server stats, it allows you to change power options (like shutdown, restart). You can add users, start/stop services and almost anything you would need to do for a server. I recommend you give it a try!

Here is a good tutorial to install it

It says Jaunty, but should work with any version of Ubuntu :)

Webmin is considered highly insecure, however.

share|improve this answer
    
Webmin isn't so much for monitoring a server as it is for configuring,one. Unfortunately, it can be extremely invasive, and so I don't recommend people use it. –  SpamapS Nov 26 '10 at 7:19
    
hmm, I agree that it is mostly used for configuring servers.. but I have been using it some time now for monitoring as well. used along side Monit (to immediately bring services back up). not mentioning it's very useful RDP protocol and full system backup, it has a module for sending emails, SMS, or pages (in order to alert the administrator of anything that isn't cooperating). as for being invasive: how so? It uses it's own embedded server.. it can be locked down using certificates, by host address, or two factor authentication. and you can remove webmin at anytime without breaking anything –  RapidWebs Jul 6 at 22:55

If you need something that scales (in other words, you may end up monitoring multiple webservers, dns servers, etc), then I recommend Cacti.

It has steeper-than-most learning curve, but I've used it in the past to collect 800+ statistics every minute from various sources. The collection process, since it's threaded, completes in about 40 seconds.

It uses RRDtool to graph the sources. It's web based and it's in the repositories.

share|improve this answer
    
i tied getting my head arond it, but the plugins and all were jsut too much. might revisit it if I need some mongoDB stats. –  theTuxRacer Nov 23 '10 at 9:36
    
Yep, it's a little daunting to begin with, but stick to the basics and work up, you'll be surprised at its power and (eventually) general friendliness. –  Scaine Nov 23 '10 at 20:01

For a live view i would login using ssh and then run htop (for cpu, mem) and nload for network load.

both htop and nload are available in the Ubuntu repositories.

share|improve this answer

protected by fossfreedom Oct 5 '13 at 6:35

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.