Koozali.org formerly Contribs.org

Nagios NRPE configuration

Offline Bud

  • *
  • 487
Nagios NRPE configuration
« on: April 29, 2012, 09:22:04 AM »
Please guys i need some help again  :D

I have 5 x SME 8 Servers and need to monitor them using Nagios (On another Distro  :sad: )

My question is all i want to do is install the NRPE Contrib on the SME 8 Servers, however when i get to " Allow the central Nagios server to access the NRPE service " as per the link http://wiki.contribs.org/Nagios_NRPE i cannot get the NRPE to install or configured on any of the SME 8 Servers

Please can you explain what i am doing wrong or what need to do to get NRPE Installed on the Remote SME Servers.

Any help greatly appreciated

Offline Stefano

  • *
  • 10,779
  • Skype account: maghissimo
    • Smeserver italian community
Re: Nagios NRPE configuration
« Reply #1 on: April 29, 2012, 09:35:42 AM »
you forgot to tell us the meaning of "i cannot get the NRPE to install or configured on any of the SME 8 Servers"

please remember that no one has a crystal ball so if you need help you must help us to understand your issue..

please report here the exact error message, thank you
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Offline Bud

  • *
  • 487
Re: Nagios NRPE configuration
« Reply #2 on: April 29, 2012, 01:10:39 PM »
Stefano thanks for your reply

Sorry, what i want to know is that i followed the how to install as per link http://wiki.contribs.org/Nagios_NRPE for the SME 8 Servers.
When i get to the area where it says: 
========================
NRPE configuration
Create a the NRPE configuration file /etc/nagios/nrpe.cfg. Use the nrpe.cfg provided by this conrib as a starting point. Add the IP address of your central Nagios server to the variable allowed_hosts. Use the local IP of the central Nagios server if you check the server over the local network or over a VPN, otherwise use the WAN IP.
========================

There is No file called nrpe.cfg in /etc/nagios/ on the SME 8 Servers
I need to understand how to configure the nrpe.cfg file for the SME 8 Servers. Must i also forward port 5666/tcp to the SME 8 servers

Also what do i do in:
========================
Allow the central Nagios server to access the NRPE service

Add the IP address of the your central Nagios to Local Networks in the server-manager.

Configure the TCP wrapper. This is required for SSL connections to the NRPE.
=======================
The Remote Nagios Server is using DynDNS

Sorry for the Noob Questions  :)


Offline Stefano

  • *
  • 10,779
  • Skype account: maghissimo
    • Smeserver italian community
Re: Nagios NRPE configuration
« Reply #3 on: April 29, 2012, 09:28:21 PM »
bud, please, re-read carefully here
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Offline Bud

  • *
  • 487
Re: Nagios NRPE configuration
« Reply #4 on: April 30, 2012, 05:21:34 AM »
Stafano thanks for your reply  :)

I do know about the solution you pointed to - thank you mmccarn

However that was when i was going to use SME 8 with the " Nagios Server " Contrib as the " Nagios Server Monitoring Solution "

Now the client is using another distro with Nagios to monitor the 5 x SME Servers

Are you saying that I also need to install rhe " Nagios Server " contrib on all SME Servers including the " NRPE Contrib "in order for the NRPE " Client " to work on those servers?

Sorry i was under the impression that all i needed to do was install the " NRPE Client " Contrib on the SME Servers in order for Nagios ( which is on a different distro ) to monitor the SME Servers.

Please confirm



Re: Nagios NRPE configuration
« Reply #5 on: May 09, 2012, 07:10:45 AM »
NRPE SME8 Installation
Configure the dag repositoy

The following command will configure the dag repository on SME Server.

/sbin/e-smith/db yum_repositories set dag repository \
Name 'Dag - EL5' \
BaseURL 'http://apt.sw.be/redhat/el5/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled


After adding it to the database we have to update the changes to the configuration file:

signal-event yum-modify

/usr/bin/yum --enablerepo=dag install \
 nagios-plugins \
 nagios-plugins-setuid \
 perl-Config-Tiny \
 perl-Class-Accessor


Copy nrpe rpm's and install

yum localinstall nagios-3.2.1-5.el5.rf.i386.rpm
yum localinstall nagios-nrpe-2.5.2-1.el5.rf.i386.rpm
yum localinstall nagios-plugins-nrpe-2.5.2-1.el5.rf.i386.rpm


vim /etc/nagios/nrpe.cfg

allowed_hosts=127.0.0.1,62.249.247.18


cd /etc/rc7.d

cp -s /etc/init.d/nrpe S95nrpe


port forward 5666 to localhost


vim /etc/e-smith/templates/etc/hosts.allow/nrpe

{
$OUT="nrpe: " . ($nrpe{HostsAllow} ? $nrpe{HostsAllow} : "127.0.0.1 62.249.247.18" );
}


 expand-template /etc/hosts.allow
 service nrpe restart

Re: Nagios NRPE configuration
« Reply #6 on: May 09, 2012, 02:52:08 PM »
vim /etc/e-smith/templates/etc/hosts.allow/nrpe

That should be:

mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow
vim /etc/e-smith/templates-custom/etc/hosts.allow/nrpe

Re: Nagios NRPE configuration
« Reply #7 on: May 27, 2013, 07:54:26 AM »
Hi All

I know this is an old thread but Garys instructions are excellent and still relevant for installing Nagios as a client only configuration.

Just expanding on the section in the instructions

Quote
Copy nrpe rpm's and install

yum localinstall nagios-3.2.1-5.el5.rf.i386.rpm
yum localinstall nagios-nrpe-2.5.2-1.el5.rf.i386.rpm
yum localinstall nagios-plugins-nrpe-2.5.2-1.el5.rf.i386.rpm

The locations of the rpm's to download (at least as at now) before installing them are:

http://pkgs.repoforge.org/nagios/nagios-3.2.1-5.el5.rf.i386.rpm

http://pkgs.repoforge.org/nagios-nrpe/nagios-nrpe-2.5.2-1.el5.rf.i386.rpm

http://pkgs.repoforge.org/nagios-nrpe/nagios-plugins-nrpe-2.5.2-1.el5.rf.i386.rpm

I also made a few minor changes and included Charlie's comments in my blog post.

http://howden.net.au/thowden/2013/05/sme-server-as-a-nagios-nrpe-client-only/

cheers
Tony

Re: Nagios NRPE configuration
« Reply #8 on: May 27, 2013, 05:36:31 PM »
That should be:

mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow
vim /etc/e-smith/templates-custom/etc/hosts.allow/nrpe

But why create a custom template when all you need to do is set a db property?

config setprop nrpe HostsAllow '127.0.0.1 a.b.c.d'

Re: Nagios NRPE configuration
« Reply #9 on: May 27, 2013, 05:40:55 PM »
Actually, I see you do need a custom template here. But I would still use a custom template and a database property:

{
  $OUT="nrpe: ";
  $OUT .= $nrpe{HostsAllow} || "127.0.0.1";
}

and then:

config setprop nrpe HostsAllow '127.0.0.1 a.b.c.d'

to allow the remote access.

Re: Nagios NRPE configuration
« Reply #10 on: May 29, 2013, 01:18:39 AM »
Hi Charlie

Quote
Actually, I see you do need a custom template here. But I would still use a custom template and a database property

I have not researched this, but I have always assumed (dangerous, I know) that the database entries were for the developers and that my dabbling with custom-templates was more for the server admin to allow for modifications.

I like the custom templates as I can 'see' what's going on, while the database entries are hidden. Is there any documentation that helps to enlighten me on this? I am interpreting your comments to say that there are cases when templates are 'needed' rather than optional, and times when database entries are 'required' in addition to templates, which also puzzles me as I would have thought one-or-the-other.

Specifically with this configuration, it is working without a database entry. How does the DB entry help?

Thanks.

Tony




Re: Nagios NRPE configuration
« Reply #11 on: May 29, 2013, 04:37:55 AM »
If you don't want to use the configuration db, then all your custom template needs to contain is:

127.0.0.1 62.249.247.18