Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

$

HOME › LINUX

Turn Your Raspberry Pi into a


Network Monitoring Tool
Network monitoring software Nagios is quick to
install and straightforward to configure –but a waste
of a full PC. Raspberry Pi to the rescue.
BY CHRISTIAN CAWLEY
JUN 18, 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.

ARTICLE CONTINUES BELOW ADVERTISEMENT

Ad
Power Quality analyzer - Power Quality monitoring
Industry or utility company? Use our Class-A Power Quality
management system!

unipower.se VISIT SITE

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 has been released in 2015.

ARTICLE CONTINUES BELOW ADVERTISEMENT

Ad Power Quality analyzer - Power Quality


monitoring
VISIT SITE

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

ARTICLE CONTINUES BELOW ADVERTISEMENT

Power Quality analyzer

Power Quality monitoring

Industry or utility company? Use our Class-


A Power Quality management system!
unipower.se

OPEN

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.

muo-rpi-apps-card

Prepare Your SD Card with


NagiosPi
The Raspberry Pi has its own version of Nagios,
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) so that
you can use it as a headless device via SSH,
which is activated by default on NagiosPi.

ARTICLE CONTINUES BELOW ADVERTISEMENT

Equipos IoT - Somos fabricantes


Acceso remoto las 24 hs en donde te encuentres, desde ABRIR
tu smartphone o PC. etherpower.net

When the image – which is around 1.5 Gb in size –


should be extracted following download and
written to a spare SD card (over 4 Gb capacity)
using ImageWriter (or if you're on Windows, use
Win32 Disk Imager; Mac OS X users can employ
Pi Filler).

muo-linux-nagiospi-expandfs

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. Once signed in, enter
sudo raspi-config and select Expand Filesystem
to take advantage of the SD card's full remaining
capacity.

ARTICLE CONTINUES BELOW ADVERTISEMENT

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.

muo-linux-nagiospi-webconsole

Your browser should display the NagiosPi


console, with a collection of links in the top-left
corner:

Nagios – displays the network entities


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.

ARTICLE CONTINUES BELOW ADVERTISEMENT

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.

muo-linux-nagiospi-rasp-control

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

ARTICLE CONTINUES BELOW ADVERTISEMENT

muo-linux-nagiospi-nconf-add

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.

ARTICLE CONTINUES BELOW ADVERTISEMENT

Monitoring Uptime and


Status
muo-linux-nagiospi-nagios

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

ARTICLE CONTINUES BELOW ADVERTISEMENT

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.

8 Ways a Raspberry Pi Can Help


You Learn Online Security Skills
Want to know more about online security? The
Raspberry Pi is the perfect tool to get you started, as
shown in these DIY projects.

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!

Image Credits: Computer network Via Shutterstock

! " #
Why You Should Avoid
Lenovo PCs: 7 Security Risks
to Consider %
Think your Lenovo laptop is safe
and secure? Think again! Various…
security risks and vulnerabilities
have plagued Lenovo PCs.
RELATED TOPICS

LINUX RASPBERRY PI LAN

Christian Cawley
1431 Articles Published)

Deputy Editor for Security, Linux, DIY, Programming,


and Tech Explained. He also produces The Really…
Useful Podcast and has extensive experience in
More From Christian Cawley &
desktop and software support. A contributor to Linux
Format magazine, Christian is a Raspberry Pi tinkerer,
ADVERTISING
Lego lover and retro gaming fan.

ABOUT THE AUTHOR

SUBSCRIBE TO OUR NEWSLETTER


Join our newsletter for tech tips, reviews, free
ebooks, and exclusive deals!
your@email.com

SUBMIT

ON THE WIRE

Microsoft Reveals Actual Target of


SolarWinds Cyberattack

5 Mind-Boggling AI Photo Editors to


Transform Pictures Without
Knowing Image Editing
How to Install and Set Up Your Own
Mumble Server

ADVERTISING

10 Hidden iOS 14 Features You


Won't Want to Miss

Apple Patents System for


Apple Patents System for
Controlling Drones

How to Save on Your Digital Game


Purchases

READ NEXT

Why Charging Your Phone


Overnight Is Bad
Keeping Your Code Clean With
Prettier

4 Ways to Share Nintendo Switch


Media to Your Phone or Computer

Microsoft Still Really Wants You to


Upgrade to Windows 10
Apple Could Settle With Company
in Pear-Shaped Logo Standoff

Modder Makes Miniscule Mario


Machine

Microsoft Reveals SolarWinds


Attackers Accessed Source Code
10 Jobs You Never Knew Were
Performed by AI

How to Stream HBO Max on Roku

Write For Us Home Contact Us Terms Privacy

Copyright About Us Fact Checking Policy Corrections Policy

Ethics Policy Ownership Policy Partnership Disclaimer

Copyright © 2021 www.makeuseof.com

You might also like