Pinterest Stumbleupon Whatsapp
Ads by Google

Whether you want to keep an eye on devices on your home network or wish to monitor the performance of your website, the open source Nagios monitoring tool should be your first port of call. Although you’ll need a Linux box, the Nagios software is quick to install and straightforward to configure.

But, it’s a bit of a waste of a PC. Having a full system setup and dedicated to checking whether other devices have gone offline wastes space, power and hardware. Fortunately, we have a solution to this, in the shape of the Raspberry Pi, the compact British-built mini-computer that has proved itself to be incredibly versatile Raspberry Pi Projects: A Car With Night Vision, Google Glass-like Translation, And More Raspberry Pi Projects: A Car With Night Vision, Google Glass-like Translation, And More We’ve previously looked at some excellent uses for this British minicomputer, but the fact is that it is just so versatile that there is always something amazing to talk about. Who would have thought that... Read More since its release in 2012. So popular, in fact, that a new version, the Raspberry Pi 2 5 Things You Can't Do With Raspberry Pi 2 5 Things You Can't Do With Raspberry Pi 2 With a quad core CPU and boasts of being able to run Windows 10 – is the Raspberry Pi 2 really all that? Here's 5 things the Raspberry Pi 2 still can't do. Read More has been released in 2015.

The Rabbit Hole of Nagios

Before we get started, a word of warning. Once you start playing around with Nagios on any platform (and the Raspberry Pi is no different) you’ll discover a vast selection of options and configurations that can be setup. With this tool, it is easy to monitor the state of a server or switch; it’s also very easy to find yourself falling down a rabbit warren of options, potentially setting too many checks (which may be counter-productive).

So before proceeding, keep this in mind. Start slowly with Nagios, adding additional checks on a daily or weekly basis, after you’ve confirmed whether the first ones worked successfully.


Prepare Your SD Card with NagiosPi

The Raspberry Pi has its own version of Nagios, the specially configured NagiosPi which is available from this Google Drive share.

Ads by Google

Your Raspberry Pi will need to be connected to your network, preferably by Ethernet cable to start with (you can configure Wi-Fi later Setting Up Wireless Networking on Your Raspberry Pi Setting Up Wireless Networking on Your Raspberry Pi Virtually every Raspberry Pi project will require a network connection, and considerable flexibility can be gained by ignoring the Ethernet port in favour of a wireless USB dongle. Read More ) so that you can use it as a headless device via SSH Setting Up Your Raspberry Pi For Headless Use With SSH Setting Up Your Raspberry Pi For Headless Use With SSH The Raspberry Pi can accept SSH commands when connected to a local network (either by Ethernet or Wi-Fi), enabling you to easily set it up. The benefits of SSH go beyond upsetting the daily screening... Read More , which is activated by default on NagiosPi.

When the image – which is around 1.5 Gb in size – should be extracted following download and written to a spare SD card How To Install An Operating System To Your Raspberry Pi How To Install An Operating System To Your Raspberry Pi Here's how to get a new OS installed and running on your Pi – and how to clone your perfect setup for quick disaster recovery. Read More  (over 4 Gb capacity) using ImageWriter (or if you’re on Windows, use Win32 Disk Imager; Mac OS X users can employ Pi Filler).


With the image written, pop the SD card into your Raspberry Pi and boot it up. You can login with the username/password combination of pi/raspberry, but it is worth changing these security credentials later Securing Your Raspberry Pi: From Passwords to Firewalls Securing Your Raspberry Pi: From Passwords to Firewalls Anyone can use Google to find the default username and password of your Raspberry Pi. Don’t give intruders that chance! Read More . Once signed in, enter sudo raspi-config and select Expand Filesystem to take advantage of the SD card’s full remaining capacity.

Configure NagiosPi With Your Computer

With NagiosPi setup, it’s time to configure the monitoring tool. Begin by opening your web browser and entering the IP address for your Raspberry Pi in the address bar. By default this will be something like 192.168.0.x if you use a DHCP router.


Your browser should display the NagiosPi console, with a collection of links in the top-left corner:

  • Nagios – displays the network entities configured in Nconf
  • Nconf – use this to add and manage items to be monitored
  • NagVis – provides a visualization of devices
  • PHPMyAdmin – gives direct access to the Nagios database
  • RaspControl – check the status on your Raspberry Pi.

Each of these requires a username and password to sign in, which is displayed alongside each link. You can edit the HTML file to hide these.


RaspControl gives you a good idea of what information can be gained from your Pi and other devices, although remote Linux hardware will need the NRPE (Nagios Remote Plugin Executor) installed on them individually so that NagiosPi can communicate with them.

Configure NagiosPi to Ping Your Website

As related above, NagiosPi can be used to monitor all sorts of network devices, with a collection of check options that can seem overwhelming at first. We recommend starting with a basic check, an automated, periodic PING.


You can get a good look at how the ping response (or lack of!) will be displayed by switching to the Nagios page, where those default network items (detected on your network by NagiosPi) are displayed. To add your own, click Nconf from the NagiosPi console and look in the left-hand column where you will find an item labeled Hosts. To the right of this click Add, and input the hostname, IP address and alias for the device you wish to monitor.

Click Submit when you’re done, then go to Services > Add. Here, set the Add additional services to host menu to check_ping and click Add. Scroll down and set the necessary delays (don’t make them too short) and click Submit, then in the menu find Generate Nagios Config. Click this, then Deploy to complete.

Monitoring Uptime and Status

muo-linux-nagiospi-nagiosWith your monitoring configured, switch to the NagiosPi window and select Services. Here you’ll see the device you added is being monitored alongside the others on your network. Each of these items can be clicked, as can the small icons that accompany each of them. By drilling down into each you discover more information about the device, and potentially get to the bottom of why it has gone offline.

This is the main screen that you should be using once your devices are setup in Nconf. Use itto keep an eye on your servers and network devices, and act accordingly when hardware goes offline.

Have you used Nagios previously? Does this new use for a Raspberry Pi interest you, and would you like to know more? Let us know in the comments.

Image Credits: Computer network Via Shutterstock

  1. Michael Cooper
    August 29, 2016 at 2:29 pm

    Hello Great little piece of software, how do I rediscover the devices, I have edit what was there by default and need it to see the new ones? Also how do I login via root at the console?


  2. Jeff Manross
    June 9, 2016 at 8:17 pm

    Updated text file for Nagios3 / Nconf / WebServer / Samba / GPIO / LCD / and more...


  3. Bob
    May 7, 2016 at 11:27 am

    I successfully compiled the latest Nagios from source. This way you don't have to flash a new card just to run Nagios. Use your existing environment.

    And here's a URL telling you how to move everything except what the Pi needs to boot onto an external drive. I used it to attach an old 3 Tb external USB drive. Not likely to run out of space any time soon!

    This will certainly elevate you to Mad Scientist status. Mwa-ha-ha-ha-ha.

  4. Joe
    March 24, 2016 at 3:17 pm

    Will this work on a RPi 3?

    • Christian Cawley
      March 24, 2016 at 7:13 pm

      NO reason why it shouldn't. I've had it running on a RPi B and a RPi 2

      • joe
        March 24, 2016 at 8:48 pm

        Sweet... Thanks of the response.

  5. Gary McLaughlin
    March 23, 2016 at 8:50 pm

    Excellent! I had a couple of RPi 2's laying around while I play with the new RPi 3.
    About 1 hour later, and I have a working implementation of NagiosPi running!
    I am able to monitor my local network, windows and Linux machines via the Nagios webpage.
    Very slick.
    Thanks for this nifty implementation on Raspbian!
    Keep up the good work.

    • Christian Cawley
      March 24, 2016 at 8:42 am

      Pleased you've made use of this, Gary, thanks.

  6. Steve
    December 23, 2015 at 6:58 pm

    I just bought a RPi Zero for playing around but have a client that wants me to setup monitoring his 25 sites... Pingdom would charge me $49/mo for this, or I can use my $5 Pi Zero + $15 in cables/accessories and save myself $550/year!


    • Christian Cawley
      March 24, 2016 at 8:41 am

      Great news, glad it works for you!

  7. Jeff Manross
    November 14, 2015 at 3:14 pm

    Here is a compiled list of stuff found on various site on the net in a step by step for Nagios on the Raspberry Pi.

  8. sadfasdf asdfasdf
    June 25, 2015 at 9:52 am

    Thanks very much for the guide. I am a complete newbie and have a couple questions.

    1. Should the video output of the PI be off during boot? I expected to see the typical start screen but saw none.

    2. You were spot on about start slow - I have never used Nagios/Nconf. I tried your website ping with google, but each time it gave me a deployment error in the default_collector? Is there a newbie guide for Nconf? I went to the documentation.... no real help there. Do you have some pointers or a tutorial you could point me to?


    • Christian Cawley
      June 30, 2015 at 7:29 pm

      if you're getting that error, you need to focus on setting the specifics for that ping instruction. This is the error I was getting at first. Go into Services, find the ping, and edit, filling in all parameters.

      • sadfasdf asdfasdf
        June 30, 2015 at 7:52 pm

        so that is what I tried to do originally - can you provide which parameters are a must? I followed what you had above, but must be missing something.

        Thanks for the help.

  9. fcd76218
    June 19, 2015 at 12:03 am

    "But, it’s a bit of a waste of a PC. "
    Not if one combines several of the RasPi projects MUO has written about in the past. Quickly scanning the list of projects, a PC can be a file server, a web server, a print server, a media center, a network monitor, a surveillance camera monitor, a wireless access point all at the same time without even breaking a sweat. One would probably need a few Pis to do all of that. In addition a PC can run a full-featured O/S rather than some specialized, cut-down version. Also, with a PC, there is no need to build case.

    Of course if one likes to tinker and have a dedicated RaspbveryPi for each project, that is a different story. :-) I wonder how a desk with 30-40 Pis and all the attendant wiring on it would look?

    • Jean-Francois Messier
      June 19, 2015 at 12:35 pm

      @fcd76218. you may be right that a desktop computer can do all those things. However, lets keep two things in mind: The RPi is for those who like to try, test, experiment, and play with different technologies. And second, The RPi is very cheap, compared to a laptop, or a desktop. It also consumes much less power, is much smaller and runs Linux.

      • fcd76218
        June 19, 2015 at 4:30 pm

        "The RPi is for those who like to try, test, experiment, and play with different technologies."
        I don't deny that. That's what I said in my last paragraph.

        "The RPi is very cheap, compared to a laptop, or a desktop"
        Not if one already has the laptop/desktop and has to purchase the RPi and accessories. One RPi may be cheap in comparison to a PC but a PC is powerful enough to perform multiple tasks. To match the multitasking of a PC, you would need several RPis, making the overall cost more comparable. OTOH, if one already has a box full of RPis and has to obtain the PC/laptop, then your point is valid.

        "(RPi) runs Linux"
        Do the Linux distros optimized for ARM processors have the same capabilities as Linux distros optimized for 32 and 64 bit Intel/AMD processors which PCs on?

Leave a Reply

Your email address will not be published. Required fields are marked *