Software

Monitor your server with Monitorix

While it's important to get a remote view of your servers with tools like Nagios, it's not always easy to get a full "local" view of things like CPU load and network service demand. Vincent Danen introduces Monitorix to fill in the gaps of your monitoring needs.

Monitoring information on servers has become even easier with Monitorix. A lot of server monitoring is done remotely, such as with Nagios. While it is important to be able to get a remote view with the likes of Nagios (i.e., to see if the server is responding or whether the SMTP port is responding normally), it can be challenging to get a more "local" view. Monitorix, on the other hand, allows for the monitoring of CPU load, temperature, network device activity, network service demand, and more.

RPM packages are provided for Red Hat, Fedora, and CentOS. Other supported platforms include Debian, Gentoo, Slackware, and FreeBSD to some extent. Although not explicitly supported, the Monitorix RPM packages will work on a Mandriva system, provided the install is done via urpmi to grab the required dependencies along with it:

# urpmi monitorix-1.2.1-1.noarch.rpm

Once you have installed Monitorix, modify the /etc/monitorix.conf configuration file. There are a number of things that can be configured here, including how things are displayed, what to monitor, and what operating system is being used. One of the most important things to configure is the $OSTYPE variable, which can be Linux-RHFC, Linux-Debian, Linux-Gentoo, Linux-Slack, Linux-Generic, or FreeBSD. Further down in the configuration you can see why this is important as the $OSTYPE tells Monitorix where to find certain files and logs.

Monitorix comes in two parts: the collection agent and the Web interface. To start the collection agent, use the supplied initscript:

# service monitorix start

By default, the Monitorix files are located in /var/www/html/monitorix/ for the RPM install. Browsing to http://server/monitorix/ will provide a number of MRTG-style graphs that display all kinds of information. It includes:

  • CPU and memory usage information
  • Kernel usage
  • Disk IO activity and usage
  • Network traffic and usage
  • Network service demand for SMTP, SSH, FTP, telnet, Samba, and VirusMail
  • Fax services

Monitorix includes graphs for network port traffic, namely SMTP, HTTP, POP3, SSH, FTP, among others. It also indicates how many users are using the system and where they've connected from (telnet/ssh, Samba, or Netatalk). Finally, it also displays device interrupt activity.

All of this is default, of course, and you can choose via the configuration file what you would like to monitor and what you would rather ignore.

Monitorix gives a nice overview of what the system is experiencing at any given time, from the server side, updated in real-time. For a complete diagnostic picture, using Monitorix with a remote monitoring agent like Nagios is fantastic. And considering how easy it is to set up, compared to other similar solutions, Monitorix is a great pick.

Get the PDF version of this tip here.

Delivered each Tuesday, TechRepublic's free Linux and Open Source newsletter provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

About

Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.

12 comments
pgit
pgit

I'm not getting a graphic interface. I just see a list of the files...

edmicman1
edmicman1

How often is the polling? Specifically, we're looking for a tool to monitor network bandwidth, both internal, and going in and out of our WAN. We've tried a trial of PRTG, hooked up to SNMP ports to our routers, and it polls in pretty much realtime. The linux-based free alternatives I've played with in the past couldn't seem to do any faster than once every 5 minutes. Some of them I could hack around with cron to schedule multiple polling to try and get a little faster, but it still seemed like I couldn't get any data faster than once every minute. Can this do real time bandwidth monitoring, or can something else out there that's FOSS?

csmith.kaze
csmith.kaze

Wasn't too hard either. Just make sure you follow the README.[i]distro[/i] before you go installing.

Gis Bun
Gis Bun

Is there something equivalent and free on the Windows side?

Neon Samurai
Neon Samurai

Monitorix is a very nice system status app. I've not been using it as much recently but for a while it was going on every server or workstation I setup around the house and it remains on the production servers. My only issue has been loosing the images (graphs are rendered as images) when accessing it through https. I have to look into that further though. (edit); it's a pre-coffee monday. The blow original post refers to Monit not Monitorix. I had a server a while back with a flaky version of proftp that liked to randomly halt itself. Waking up each morning to an nmap and "hm.. wonder how long the users have been without port 21" wasn't much fun but monitorix has been keeping that machine going like a champ. I won't build a server without it now. Now, if only I could get it to monitory PHP support. Apache runs rock solid but PHP likes to crash itself from time to time requiring an apache restart. That machine's days are numbered.. Debian makes it all better.

Neon Samurai
Neon Samurai

Are you viewing it through a browser and is it through http or https? http://localhost/monitorix is usually all it needs to display once installed.

Neon Samurai
Neon Samurai

You'll first be presented with a page to select daily, weekly or monthly statistics which will then load a long page of graphs. The graph images are updated around every second or so if I remember correctly. It's definitely faster than every five minutes but slow enough to allow the browser page to reload.

vdanen
vdanen

Absolutely. And you can use the exact same software too. http://www.cygwin.com/ Will take a bit of work, and I suspect just using Linux might be easier, but it's there if you want to give it a go. And no, I don't know of anything equivalent to Monitorix, but Cygwin is almost necessary to make Windows moderately useful. =)

pgit
pgit

http, in a number of browsers; same thing. I see the files as download links. Obviously something wrong in my httpd.conf.

pgit
pgit

Mandriva 2008.1 (KDE) It's odd because there's a web server running and it can render PHP, html etc on other sites it serves no problem. It installed to .../www/cgi-bin/monitorix btw. I copied to the doc root and still no go. I added /cgi-bin/ to the path, no go. Restarted the server, rebooted... nope. I'll try it on a different machine... it has to be me.

Neon Samurai
Neon Samurai

sounds like a dependency is missing. What distribution are you running it on off hand? I had a similar symptom with a different webapp after installing PHP but not enabling it so all the url://file.php tried to download rather than the server knowing it needed to render them in html.