Ping Test set up for Nagios
Ping Test set up for Nagios
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
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:
You will need 1 host definition per projector.
An example host definition might look something like this:
I am sure you'll have questions - let us know how we can help you along the way. Thanks!
You can check to see if you have the check_ping or check_icmp plugin available to you:
Code: Select all
ls -l /usr/local/nagios/libexec
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
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
}
Re: Ping Test set up for Nagios
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.
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
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:
Add the following information to the file:
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.
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:
If all is good, restart nagios and the changes will be reflected in the Web GUI.
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
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
}
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
Code: Select all
cfg_file=
Code: Select all
cfg_dir=
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Code: Select all
service nagios restart