how to monitor a 2nd server with nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
LithiumKid1976
Posts: 16
Joined: Wed Mar 09, 2016 5:43 am

how to monitor a 2nd server with nagios

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to monitor a 2nd server with nagios

Post 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!
Former Nagios Employee
LithiumKid1976
Posts: 16
Joined: Wed Mar 09, 2016 5:43 am

Re: how to monitor a 2nd server with nagios

Post 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
User avatar
aneah
Posts: 12
Joined: Mon Apr 04, 2016 8:55 am
Location: Norman, OK

Re: how to monitor a 2nd server with nagios

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to monitor a 2nd server with nagios

Post 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?
Former Nagios Employee
LithiumKid1976
Posts: 16
Joined: Wed Mar 09, 2016 5:43 am

Re: how to monitor a 2nd server with nagios

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to monitor a 2nd server with nagios

Post 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
}
Former Nagios Employee
Locked