RE: NRPE: getting mad!

"Rice, Clifford E." <[email protected]>
Newsgroups gmane.network.netsaint.user
Message-ID <[email protected]>
Martin,
    I have a configuration using Nagios, where I use nrpe as well to check our Solaris and Linux boxen.
The Solaris boxen run 2.8 as well.  The only difference is that our Nagios server is a Sun box. On
the other sun boxen where we run nrpe, I've made an entry in /etc/services for nrpe

----------------------------------------------------------------------
Sun Client box config
-------------------------------------------------------------------------
like this

...
nrpe    5666/tcp                          #NRPE
-----------------------------------------------------------
The other difference is that I'm not using inetd to run nrpe.  I have a run script
in /etc/rc2.d which has

#!/bin/sh
/usr/local/bin/netsaint/libexec/nrpe -d /usr/local/netsaint/libexec/nrpe.cfg

Sun's inetd seemed not to play nice with nrpe here...
------------------------------------------------------------------------------------------

Below is the nrpe.cfg file on the Sun Client box as well.  
####################################################
# Sample NRPE Config File 
# Written by: Ethan Galstad ([email protected])
# 
# Last Modified: 03/30/2000
####################################################



# PORT NUMBER
# Port number we should wait for connections on.
# This must be a non-priveledged port (i.e. > 1024).

server_port=5666



# SERVER ADDRESS
# Address that nrpe has to bind to in case there are
# more as one interface and we do not want nrpe to bind
# (thus listen) on all interfaces.

server_address=89.20.32.202



# ALLOWED HOST ADDRESSES
# This is a comma-delimited list of IP address of hosts that are allowed
# to talk to the NRPE daemon.
#
# Note: The daemon only does rudimentary checking of the client's IP
# address.  I would highly recommend adding entries in your /etc/hosts.allow
# file to allow only the specified host to connect to the port
# you are running this daemon on.

#
#  Houuam is the Netsaint server
#

allowed_hosts=127.0.0.1,89.20.32.74,89.20.32.200



# DEBUGGING OPTION
# This option determines whether or not debugging
# messages are logged to the syslog facility. 0=off, 1=on

debug=1



# COMMAND DEFINITIONS
# Command definitions that this daemon will run.  Definitions
# are in the following format:
#
# command[<command_name>]=<command_line>
#
# When the daemon receives a request to return the results of <command_name>
# it will execute the command specified by the <command_line> argument.
#
# Unlike NetSaint, the command line cannot contain macros - it must be
# typed exactly as it should be executed.
#
# Note: Any plugins that are used in the command lines must reside
# on the machine that this daemon is running on!  The examples below
# assume that you have plugins installed in a /usr/local/netsaint/libexec
# directory.

command[check_users]=/usr/local/netsaint/libexec/check_users 5 10
command[check_load]=/usr/local/netsaint/libexec/check_load 5 10 15 20 25 30
command[check_disk1]=/usr/local/netsaint/libexec/check_disk 90 95 /dev/dsk/c0t0d0s0 
command[check_disk2]=/usr/local/netsaint/libexec/check_disk 90 95 /dev/dsk/c0t0d0s3 
command[check_disk3]=/usr/local/netsaint/libexec/check_disk 90 95 /dev/dsk/c0t0d0s4 
command[check_disk4]=/usr/local/netsaint/libexec/check_disk 90 95 /dev/dsk/c0t0d0s6 
command[check_disk5]=/usr/local/netsaint/libexec/check_disk 90 95  /dev/dsk/c0t0d0s5  
command[check_disk6]=/usr/local/netsaint/libexec/check_disk 90 95  /dev/vx/dsk/san1/STUB0A  
command[check_disk7]=/usr/local/netsaint/libexec/check_disk 90 95  /dev/vx/dsk/san1/STUB0B  
command[check_disk8]=/usr/local/netsaint/libexec/check_disk 90 95  /dev/vx/dsk/san1/HOME  
command[check_zombie_procs]=/usr/local/netsaint/libexec/check_procs 5 10 Z
command[check_total_procs]=/usr/local/netsaint/libexec/check_procs 150 200 
command[check_rpc]=/usr/local/netsaint/libexec/check_rpc 90 95 nfs 
---------------------------------------------------------------------------------------------------


Hope this helps.  So... perhaps trying the following may help.

1. add nrpe to /etc/services
2. try running it standadlone
3. Of course make sure you have the check_disk, etc. scripts on your client. (:
4. I included my nrpe.cfg file.  There may be something there as well amiss, like 
   wrong IP for the client , or wrong IP for the server.  Ummm I've done both of those when
   ftping nrpe.cfg over to a new box.

Cliff


Linux -- The Choice of the GNU Generation
http://www.debian.org


-----Original Message-----
From: Martin Mielke (THALES) [mailto:[email protected]]
Sent: Tuesday, October 08, 2002 9:19 AM
To: Netsaint-Users
Subject: [netsaint] NRPE: getting mad!


Dear all,

I need to monitor some services remotely on some Solaris systems from a
Linux box using NetSaint 0.0.7, which works pretty fine to locally check
services on the NetSaint host.

The NRPE behaviour is pretty diferent, depending on which system it's being
executed, all with Solaris 8 installed, and I'm getting mad...

On the NetSaint host, this are the entries for each host in hosts.cfg:

* Sun Ultra-10:
---
service[ultra10]=PING;0;24x7;3;5;1;sun-admins;240;24x7;1;1;0;;check_ping!100
.0,20%!500.0,60%
service[ultra10]=NRPE;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_tcp!5666
service[ultra10]=RemoteUsers;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_n
rpe!check_users
service[ultra10]=SysLoad;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_nrpe!
check_load
service[ultra10]=DiskUsage;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_nrp
e!check_disk
---

For this host, every remote check works correctly.


* SunBlade 2000:
---
service[sunblade2000]=PING;0;24x7;3;5;1;sun-admins;240;24x7;1;1;0;;check_pin
g!100.0,20%!500.0,60%
service[sunblade2000]=NRPE;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_tcp
!5666
service[sunblade2000]=RemoteUsers;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;ch
eck_nrpe!check_users
service[sunblade2000]=SysLoad;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_
nrpe!check_load
service[sunblade2000]=DiskUsage;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;chec
k_nrpe!check_disk
---

For this one, only PING and NRPE return an "OK"... for the rest I get, for
example:
---
[1034088450] SERVICE ALERT:
sunblade2000;RemoteUsers;UNKNOWN;SOFT;1;CHECK_NRPE: Error receiving data
from host
---


* SunBlade 1000:
---
service[sunblade1000]=PING;0;24x7;3;5;1;sun-admins;240;24x7;1;1;0;;check_pin
g!100.0,20%!500.0,60%
service[sunblade1000]=NRPE;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_tcp
!5666
service[sunblade1000]=RemoteUsers;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;ch
eck_nrpe!check_users
service[sunblade1000]=SysLoad;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;check_
nrpe!check_load
service[sunblade1000]=DiskUsage;0;24x7;3;5;1;sun-admins;120;24x7;1;1;0;;chec
k_nrpe!check_disk
---

This system will cause me a big headache :P
Only PING works.
For NRPE I get:

---
[1034087372] SERVICE NOTIFICATION:
netsaint;sunblade1000;NRPE;CRITICAL;notify-by-email;Connection refused by
host
---

Which is quite odd because I can telnet this machine from the NetSaint host:
---
# telnet sunblade1000 5666
Trying 192.168.x.y...
Connected to sunblade1000.
Escape character is '^]'.

NRPE - NetSaint Remote Plugin Executor
Copyright (c) 1999-2001 Ethan Galstad ([email protected])
Version: 1.2.5
Last Modified: 12-23-2001
License: GPL

Usage: -i <-i | -d> <config_file>

Options:
  -i      Run as a service under inetd or xinetd
  -d      Run as a standalone daemon

Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running NetSaint.  It can run as a service
under inetd (read the docs for info on this), or as a standalone
daemon if you wish. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.

Connection closed by foreign host.
---

I get the same results when I issue a 'telnet localhost 5666' or when nrpe
is executed with the -d switch (standalone mode), after having commented out
the proper entry in /etc/inetd.conf

For all these systems, /etc/system looks like this:
----
...
nrpe            5666/tcp                        # NRPE
----

And /etc/inetd.conf:

---
...
nrpe            stream  tcp             nowait  netsaint
/usr/local/netsaint/nrpe -i /usr/local/netsaint/nrpe.cfg
---

The nrpe binary and plugins where compiled on the remote hosts, as described
on the NRPE-README file.
On all those systems I created a 'netsaint' user and its files are owned by
netsaint.other.

Could someone please shed some light? because I'm lost... surely I'm
overseeing something obvious 8-)


Thanks a lot in advance!

Martin

--
Martin Mielke - [email protected]
THALES Information Systems - http://www.thales-is.com/
[ echo "\$0&\$0">_;chmod +x _;./_ ]



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Netsaint-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/netsaint-users


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.