Merubah Raspberry menjadi Network Monitoring Tool

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 since its release in 2012. So popular, in fact, that a new version, the Raspberry Pi 2 has been released in 2015.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 MoreWe’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

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) so that you can use it as a headless device via SSH, which is activated by default on NagiosPi.Setting Up Wireless Networking on Your Raspberry Pi Setting Up Wireless Networking on Your Raspberry PiVirtually 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
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).
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.Securing Your Raspberry Pi: From Passwords to Firewalls Securing Your Raspberry Pi: From Passwords to FirewallsAnyone can use Google to find the default username and password of your Raspberry Pi. Don’t give intruders that chance!READ MORE

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

Posting Komentar

0 Komentar