Page 1 of 1
Ping Test set up for Nagios
Posted: Thu Jul 02, 2015 10:59 am
by mkhan01
I was hoping I could get help with setting up ping test with Nagios Core for monitoring projectors that are connected to the network. The projectors have static I.P.s and my nagios is installed on a OVM on a linux server. The version of linux running on my OVM is Oracle Linux 7, and Nagios Core is up to date. I'm not necessarily quite sure on which plugins to install to set up the ping test. The end game would be to have ping test set up so I can know when a projector is disconnected from network and I would receive an email notification for it.
Re: Ping Test set up for Nagios
Posted: Thu Jul 02, 2015 11:04 am
by jolson
Great - I recommend that you look into our
Object Configuration Overview guide. After understanding the different pieces that make Nagios work, you will need to create a host definition.
You can check to see if you have the check_ping or check_icmp plugin available to you:
Good things to note:
If you don't have any Nagios Plugins, you can install them in the following way:
Code: Select all
cd /tmp
wget https://github.com/nagios-plugins/nagios-plugins/archive/master.tar.gz -O nagiosplugins.tar.gz
tar xzf nagiosplugins.tar.gz
cd nagios-plugins-master/
./tools/setup
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
You will need 1 host definition per projector.
An example host definition might look something like this:
Code: Select all
define host {
host_name projector-1.something.local
use generic-service ; this is a template
address 192.168.x.x ; IP Address of the projector
check_command check_ping!200.0,20%!600.0,60%
check_period 24x7
notification_interval 60
notification_period 24x7
register 1
}
I am sure you'll have questions - let us know how we can help you along the way. Thanks!
Re: Ping Test set up for Nagios
Posted: Mon Jul 06, 2015 10:43 am
by mkhan01
I checked to see if I had either the check_ping or check_icmp plugin, and I have check_ping. Based on what was said, I assume having either would be fine and no need to install another plug in.
I need help with defining a host, I'm stuck on the point where I would define a projector as a host.
Re: Ping Test set up for Nagios
Posted: Mon Jul 06, 2015 11:04 am
by jolson
No problem.
When you're defining a host, it'll be under a simple text file. You can store this file where you'd like, but I recommend sticking it under /usr/local/nagios/etc/ somewhere. By default, you should have a few listed in /usr/local/nagios/etc/objects - I'll use that directory for the sake of example.
Create the host file:
Code: Select all
vi /usr/local/nagios/etc/exampleprojector.cfg
Add the following information to the file:
Code: Select all
define host{
use linux-server ; Inherit default values from a template
host_name proj1firstfloor ; The name we're giving to this projector
alias ProjectorM400 ; A longer name associated with the projector
address 192.168.1.30 ; IP address of the projector
}
Read up on templates to understand what the 'use' field is used for -
https://beginlinux.com/server/nagios/ob ... nce-nagios
By default, the above definition will include a ping check. The linux-server template automatically applies this check to your host.
After the configuration is done, we need to make nagios aware of this new host. We can do that in the following file.
Code: Select all
vi /usr/local/nagios/etc/nagios.cfg
You have two settings that you can use:
-or-
After you have defined your host, run a quick check to make sure everything looks fine:
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If all is good, restart nagios and the changes will be reflected in the Web GUI.