Turn Your Raspberry Pi into a Network Monitoring Tool

Christian Cawley 18-06-2015

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 has proved itself to be incredibly versatile since its release in 2012, helping people build everything from smart TVs to light-sensing smart switches. So popular, in fact, that a new version, the 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.


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 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 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 on a Raspberry Pi Here's how to install an OS on your Raspberry 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 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 it to keep an eye on your servers and network devices, and act accordingly when hardware goes offline.

If you’re then ready for another project, you can then use a Raspberry Pi not only to keep you online, but to help keep you safe. You can also use Raspberry Pi to host your own website.

Keep in mind that Raspberry Pi can not only work as a network monitoring tool, but also as a camera system, weather station, farming bot, and more 8 Fun Rugged Raspberry Pi Projects to Build for the Outdoors Looking for some outdoors Raspberry Pi projects? These 8 activities use a Raspberry Pi in your garden, underwater, or in the sky! Read More !

Image Credits: Computer network Via Shutterstock

Related topics: LAN, Raspberry Pi.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

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

  1. Brandon
    June 26, 2020 at 4:10 pm

    Hello, I am a complete beginner. I am having issues trying to get the OS to boot from the sd card, I am on a raspberry pi 3b+ and when I slot in the new card with Navios installed it acts like there is nothing there. please help me with this issue

    *note, the SD that I am using is identical in every way shape and form to he one that has successfully booted raspbian for a year

  2. Bruno
    August 13, 2017 at 8:06 pm

    Hallo to all,

    I have a question or in other words, I have a problem with NConfig. I do all steps, which are written in this text.
    At the main point "Configure NagiosPi to Ping Your Website", i cant monitor my chosen Host.
    I have add host, and after them the point with add/services, I choose -> check_ping and added some values like max check attempts, interval retry, notification interval...and so on... and at least the Generate Nagios Config. Then I clicked Deploy to complete. But Unfortunately, I cant connect with the host, because I get the massage monitored by [not monitored].!! And thats the problem. At on other row, I get the massage for example monitored by [default nagios]. I need some help. please contact me here, If you know the answer.

    • Bruno
      August 14, 2017 at 5:17 pm

      Its finished. Please ignore my last comment. Thank you.

  3. FuzzyWuzzy
    August 3, 2017 at 11:29 am

    Can I make this on my Raspberry Pi 3 B model?

  4. brad
    July 15, 2017 at 12:58 am

    Just starting to look at raspberry pi to see if it could solve the problem of the ages. Network latency. I know there are a number of vendors looking at service chaining that is supposed to provide the between hop timing but, the first 2 we looked at are not ready for prime time.

    What I am looking for and think maybe raspberry pi could help is hop by hop latency.

    The security gear between a desktop and the remote web server is getting unmanageable. Thinking to have a pi at the desktop, load balancer, proxy, IPS, malware box, DLP, FW, and router. When the users calls and says the network is slow I need to piece together all the gear. Of course this is not even including the switches, routers, etc.

    What I would like to have is a network trace that traverses all the gear and stitch that together to be able to isolate a bottleneck. Keeping in mind it could be a combination of devices that causes the issue.

    Have run span ports to networking monitors but, looking for a clear view into the network that will flag window size issues, resets, etc.

    In some cases I have a user that is downloading a file and gets 600 Kbps when I can go over the network and get an 8 MB download from the same site.

    Wondering if I could setup some raspberry pi with network monitor that all report back to give view of the entire path out the door. Would be incredibly valuable to see what is happening.

    Even if I can't get that the raspberry pi looks like a great toy.

  5. Michael
    October 30, 2016 at 1:34 pm

    Hello, tried all the steps and I got problem which when I click "Generate Nagios config" I got error of "Deployment not possible due to errors in configuration". Any help, guys?

    • Michael
      October 31, 2016 at 3:16 am

      And I can't find main configuration file which should be located at "/usr/local/nagios/etc/nagios.cfg". There is no nagios folder in "/usr/local/".

    • Christian Cawley
      October 31, 2016 at 1:51 pm

      Hi Michael, are you using NagiosPi? And which Raspberry Pi version are you using?

      • Michael
        November 2, 2016 at 1:48 pm

        Yes, I'm using NagiosPi which I downloaded from the link stated in the article. I'm using Raspberry Pi 2 model B.

        • Michael Weber
          December 7, 2016 at 5:09 pm

          Ahh...Raspberry Pi 2 model B. Thanks.
          I have seen a couple of guides where they did not mention, what version they used and I have that specific model.

          My weekend is saved.
          Thanks :)

      • Michael
        November 2, 2016 at 1:52 pm

        Yes, i'm using NagiosPi which I downloaded from the link in the article above. I'm using Raspberry Pi model B.

  6. 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?


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

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


  8. 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.

  9. 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.

  10. 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.

  11. 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!

  12. 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.

  13. Anonymous
    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.

      • Anonymous
        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.

  14. Anonymous
    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?

    • Anonymous
      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.

      • Anonymous
        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?