Page 1 of 1

how to monitor a 2nd server with nagios

Posted: Thu Mar 31, 2016 11:23 am
by LithiumKid1976
hi
i have installed nagios on a centOS 7 server. working fine.

im now looking to monitor a 2nd centOS7 server with nagios. it seems i need to install NRPE and nagios plugins on this server.
But i cant find any correct info on how to set it up.
can anyone point in the right direction on how to do this.

Thanks

Re: how to monitor a 2nd server with nagios

Posted: Thu Mar 31, 2016 11:32 am
by rkennedy
This document outlines how to do so pretty well.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Let us know if you run into any issues!

Re: how to monitor a 2nd server with nagios

Posted: Mon Apr 04, 2016 11:16 am
by LithiumKid1976
HI
Thanks for that.
Just have a quick question, on page5 of that handout
"Configuration of a nagios xi NRPE service check through the core config manager"

it says Navigate to
Configure, Core config manager........

I dont see that as an option, ie i cant locate "Core Config Manager"

Any suggestions on what im doing wrong?
thanks
D

Re: how to monitor a 2nd server with nagios

Posted: Mon Apr 04, 2016 11:22 am
by aneah
I've found these two documents were pretty good when I set up my installs (RHEL 6.7)
http://tecadmin.net/install-nrpe-on-centos-rhel/
http://sites.box293.com/nagios/guides/i ... centos-6-7

Re: how to monitor a 2nd server with nagios

Posted: Mon Apr 04, 2016 2:46 pm
by rkennedy
Thanks @aneah!

@LithiumKid1976 - you are doing the right thing, ignore that part of the instructions as those are geared towards Nagios XI (https://www.nagios.com/products/nagios-xi/) which is our more enterprise product.

What issue are you currently facing?

Re: how to monitor a 2nd server with nagios

Posted: Tue Apr 05, 2016 3:23 am
by LithiumKid1976
Hi
so i followed the document and everything up to page 5 works.
on server 1 i have nagios core running. on server 2 NRPE is installed. both seem to configured correctly.

how do i make server2 info appear on the nagios core (server1) homepage, where we are monitoring hosts...etc.

hope that makes sense.

Re: how to monitor a 2nd server with nagios

Posted: Tue Apr 05, 2016 9:33 am
by rkennedy
From server 1, can you run the following from the CLI? This is how we'll verify connectivity.

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H ipofserver2
If that's responding properly, then we'll need to add a check_nrpe command to the bottom of your commands.cfg -

Code: Select all

###############################################################################
# NRPE CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################

define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }
Now, you need to decide how you're going to manage your Nagios configuration files. You'll need to modify nagios.cfg and one of two things:

Code: Select all

cfg_dir=/usr/local/nagios/etc/servers
(this will make everything in the /usr/local/nagios/etc/servers/* register as a definition file in Nagios)

or

Code: Select all

cfg_file=/usr/local/nagios/etc/objects/server2.cfg
(this will only register /usr/local/nagios/etc/objects/server2.cfg)

Finally, you can setup a check to use the newly created command -

Code: Select all

## Default Linux Host Template ##
define host{
name                            server2
use                             generic-host
check_period                    24x7        
check_interval                  5       
retry_interval                  1       
max_check_attempts              10      
check_command                   check-host-alive
notification_period             24x7    
notification_interval           30      
notification_options            d,r     
contact_groups                  admins  
register                        0
}
define service{
use                     generic-service
host_name               server2
 service_description     CPU Load
check_command           check_nrpe!check_load
}