Saturday, May 25th 2013, 4:19pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to Monitoring-Portal.
Although this is a german monitoring forum, please don't hesitate to post in English. Nearly everybody here understands you and will answer in English as well.
If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form to register here or read more information about the registration process. If you are already registered, please login here.

Chrizzel

Beginner

Posts: 9

Number of monitoring servers: Nein

Nagios Version: 3.4.1

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 10

Number of services: 50

OS: SLES10 SP4

Plugin Version: 2.12

1

Wednesday, July 4th 2012, 11:25am

[SOLVED] NRPE als Daemon - Connection refused by host

Hallo allerseits,

ich bin neu in diesem Forum und möchte mich ganz kurz vorstellen. Ich heiße Christian und beschäftige mich seit ca. 2,5 Wochen mit dem Thema Nagios.
Ich fahre einen Nagios-Server 3.4.1 auf einem SLES10 SP4 und habe bis dato 5 SLES10 SP4 Remotehosts über NRPE an diesem dranhängen. Bis jetzt habe ich ausschließlich xinetd als Schnittstelle benutzt, da ich es praktisch fand, dass der NRPE-Dienst nicht pausenlos läuft und nur angeschmissen wird, wenn er auch benötigt wird. Dies funktioniert auch genauso wie ich es mir wünsche:

Source code

1
2
Nagiosserver # /usr/local/nagios/libexec/check_nrpe -H <IP des Remotehosts 1>
NRPE v2.13


Ich habe jedoch bei einem 6ten Server das Problem, das ich hier kein xinetd habe und auch nicht bekomme. Deshalb versuche ich gerade NRPE als Daemon zu starten, bzw. habe ich schon:

Source code

1
2
Remoteserver 6 # ps aux | grep nrpe
nagios   25895  0.0  0.0   4540   584 ?    	Ss   10:48   0:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d


Source code

1
2
Nagiosserver # ps aux | grep nrpe
nagios	4000  0.0  0.0   9040   984 ?    	Ss   10:46   0:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d


Wenn ich nun NRPE prüfe, kommt Folgendes:

Source code

1
2
Remoteserver 6 # /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.13



Source code

1
2
Nagiosserver # /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.13


Source code

1
2
Nagiosserver # /usr/local/nagios/libexec/check_nrpe -H <IP des Remotehosts 6>
Connection refused by host


Meine Frage nun, ist es möglich, NRPE über beide Schnittstellen (xinetd und als Daemon) anzusprechen? Wenn ja, an was könnte mein Problem liegen. Ich komme einfach nicht drauf. Vielen Dank für eure Hilfe!

Configs:

Source code

1
2
Remoteserver 6 # cat /etc/services |grep nrpe
nrpe        	5666/tcp   # NRPE


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Remoteserver 6 # cat etc/nrpe.cfg | grep [a-z] | grep -v ^#
log_facility=daemon
pid_file=/var/run/nrpe.pid
server_port=5666
server_address=<IP localhost>
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=<IP Nagiosserver,IP localhost>
dont_blame_nrpe=0
debug=0
command_timeout=60
connection_timeout=300
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200


Folgende Befehle habe ich auf dem Remotehost zur Installation von NRPE ausgeführt:

Source code

1
2
3
4
5
6
7
8
9
10
11
tar xvfz nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
cp init-script.suse /etc/init.d/nrpe
echo "nrpe 5666/tcp # NRPE" >> /etc/services
vi /usr/local/nagios/etc/nrpe.cfg
/etc/init.d/nrpe start


Liebe Grüße,
Christian

This post has been edited 2 times, last edit by "Chrizzel" (Jul 4th 2012, 2:42pm)


pitchfork

Administrator

Posts: 18,460

Location: Kassel

Occupation: Sysadmin SAP / Linux / AIX

Number of monitoring servers: 2

Hobbies: Motorrad fahren, wenns die Zeit erlaubt :-)

Nagios Version: 3.2.3 ( OMD )

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 360

Number of services: 6700

OS: Debian 6.0

Plugin Version: 1.4.x

Other Addons: SNMPTT, NagTrap, check_mk, PNP-0.6.x. Thruk

2

Wednesday, July 4th 2012, 12:00pm

dem check_nrpe (client ) ist es vollkommen egal ob der nrpe Deamon ( server ) über xinetd, oder als standalone Deamon läuft.
+++ PNP Developer +++ PNP 0.6.21 ist online ! +++
Hilfreiche Infos gefunden? Dann schnell ein paar Cent flattrn
OMD - Open Monitoring Distribution

Posts: 7,238

Gender: male

Number of monitoring servers: 2

Nagios Version: 3.2.1

Icinga Version: Icinga 1.7.x

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: >70

Number of services: >200

OS: SLES11

Plugin Version: 1.4.15

Other Addons: NRPE 2.6, NSCA 2.7, PNP 0.4.14 / 0.6.18

3

Wednesday, July 4th 2012, 12:11pm

Auf Remoteserver 6 in config.log nach Fehlermeldungen gucken, ansonsten in der nrpe.cfg das Debugging aktivieren, den Daemon anschließend neu starten und nochmal probieren. Anschließend die Logs auf dem Remoteserver kontrollieren.

dnsmichi

Super Moderator

Posts: 5,990

Birthday: May 30th 1983 (29)

Gender: male

Location: Nürnberg

Occupation: Consultant / Developer beim besten Arbeitgeber der Welt @netways

Number of monitoring servers: Icinga: 4x dev, 10++ prod, Icinga2: 2x dev

Nagios Version: s/nagios/icinga/

Icinga Version: 1.9.1 / GIT

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 1000+

Number of services: 15000+

OS: RHEL, Debian, SUSE

Plugin Version: 1.4.16

IDO-Version: 1.9.1 / GIT MySQL/Postgresql/Oracle

Other Addons: Icinga Web, PNP, check_multi, inGraph, EventDB, LConf

4

Wednesday, July 4th 2012, 12:52pm

remoteserver 6? is das ein ipv6 host?
+++ Icinga / LConf Developer +++ Senior Consultant at []NETWAYS> +++
+++ Icinga 1.9 || Icinga 2 +++ Icinga Support || IRC +++

Chrizzel

Beginner

Posts: 9

Number of monitoring servers: Nein

Nagios Version: 3.4.1

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 10

Number of services: 50

OS: SLES10 SP4

Plugin Version: 2.12

5

Wednesday, July 4th 2012, 1:36pm

dem check_nrpe (client ) ist es vollkommen egal ob der nrpe Deamon ( server ) über xinetd, oder als standalone Deamon läuft.

Alles klar, danke.
Gedacht habe ich es mir auch. Mich hat nur gewundert, dass es über den Daemon nicht funktioniert hat und ich wollte nix unversucht lassen.

-----------------------------------

Auf Remoteserver 6 in config.log nach Fehlermeldungen gucken, ansonsten in der nrpe.cfg das Debugging aktivieren, den Daemon anschließend neu starten und nochmal probieren. Anschließend die Logs auf dem Remoteserver kontrollieren.

Sieht soweit ganz gut aus (inkl debug=1):

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
<Remoteserver 6> # /etc/init.d/nrpe restart
Caught SIGTERM - shutting down...
Cannot remove pidfile '/var/run/nrpe.pid' - check your privileges.
Daemon shutdown
Added command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
Added command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
Added command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
Added command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
Added command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
INFO: SSL/TLS initialized. All network traffic will be encrypted.
Starting up daemon
Listening for connections on port 5666
Allowing connections from: 10.13.179.207,127.0.0.1


-----------------------------------

remoteserver 6? is das ein ipv6 host?

Ja.

pitchfork

Administrator

Posts: 18,460

Location: Kassel

Occupation: Sysadmin SAP / Linux / AIX

Number of monitoring servers: 2

Hobbies: Motorrad fahren, wenns die Zeit erlaubt :-)

Nagios Version: 3.2.3 ( OMD )

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 360

Number of services: 6700

OS: Debian 6.0

Plugin Version: 1.4.x

Other Addons: SNMPTT, NagTrap, check_mk, PNP-0.6.x. Thruk

6

Wednesday, July 4th 2012, 1:38pm

IPv6 only oder dualstack?
+++ PNP Developer +++ PNP 0.6.21 ist online ! +++
Hilfreiche Infos gefunden? Dann schnell ein paar Cent flattrn
OMD - Open Monitoring Distribution

Chrizzel

Beginner

Posts: 9

Number of monitoring servers: Nein

Nagios Version: 3.4.1

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 10

Number of services: 50

OS: SLES10 SP4

Plugin Version: 2.12

7

Wednesday, July 4th 2012, 1:53pm

IPv6 only oder dualstack?

Entschuldigung, hatte mich verkuckt. Ist doch nur IPv4:

Source code

1
inet Adresse:10.13.137.151

Chrizzel

Beginner

Posts: 9

Number of monitoring servers: Nein

Nagios Version: 3.4.1

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 10

Number of services: 50

OS: SLES10 SP4

Plugin Version: 2.12

8

Wednesday, July 4th 2012, 1:54pm

EDIT: Alle anderen Maschinen sind auch IPv4!

pitchfork

Administrator

Posts: 18,460

Location: Kassel

Occupation: Sysadmin SAP / Linux / AIX

Number of monitoring servers: 2

Hobbies: Motorrad fahren, wenns die Zeit erlaubt :-)

Nagios Version: 3.2.3 ( OMD )

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 360

Number of services: 6700

OS: Debian 6.0

Plugin Version: 1.4.x

Other Addons: SNMPTT, NagTrap, check_mk, PNP-0.6.x. Thruk

9

Wednesday, July 4th 2012, 1:57pm

Gut.

Also teste mal mit "netstat -tulpen" ( als root ) ob Port 5666 überhaupt offen ist.

was sagt "iptables -L -v" ?
+++ PNP Developer +++ PNP 0.6.21 ist online ! +++
Hilfreiche Infos gefunden? Dann schnell ein paar Cent flattrn
OMD - Open Monitoring Distribution

Chrizzel

Beginner

Posts: 9

Number of monitoring servers: Nein

Nagios Version: 3.4.1

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 10

Number of services: 50

OS: SLES10 SP4

Plugin Version: 2.12

10

Wednesday, July 4th 2012, 2:00pm

netstat -tulpen

Das hatte ich auch schon überprüft, ist offen:

Source code

1
2
<Remoteserver 6> # netstat -tulpen | grep nrpe
tcp        0      0 127.0.0.1:5666          0.0.0.0:*               LISTEN      1000       338280     27753/nrpe

Source code

1
2
3
4
5
6
7
8
9
<Remoteserver 6> # iptables -L -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

pitchfork

Administrator

Posts: 18,460

Location: Kassel

Occupation: Sysadmin SAP / Linux / AIX

Number of monitoring servers: 2

Hobbies: Motorrad fahren, wenns die Zeit erlaubt :-)

Nagios Version: 3.2.3 ( OMD )

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 360

Number of services: 6700

OS: Debian 6.0

Plugin Version: 1.4.x

Other Addons: SNMPTT, NagTrap, check_mk, PNP-0.6.x. Thruk

11

Wednesday, July 4th 2012, 2:16pm


tcp 0 0 127.0.0.1:5666 0.0.0.0:* LISTEN 1000 338280 27753/nrpe

+++ PNP Developer +++ PNP 0.6.21 ist online ! +++
Hilfreiche Infos gefunden? Dann schnell ein paar Cent flattrn
OMD - Open Monitoring Distribution

Chrizzel

Beginner

Posts: 9

Number of monitoring servers: Nein

Nagios Version: 3.4.1

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 10

Number of services: 50

OS: SLES10 SP4

Plugin Version: 2.12

12

Wednesday, July 4th 2012, 2:22pm


tcp 0 0 127.0.0.1:5666 0.0.0.0:* LISTEN 1000 338280 27753/nrpe


OH GOTT, VIELEN VIELEN DANK!
Warum ich da nicht selber drauf gekommen bin...
Das war die Localhost IP. Hab jetzt die richtige in die nrpe.cfg eingefügt und prompt hat's geklappt.
VIELEN DANK nochmal! :thumbsup:

<Nagiosserver> # /usr/local/nagios/libexec/check_nrpe -H <IP Remotehost 6>
NRPE v2.13

Ps: Wo schließe ich den Thread?

pitchfork

Administrator

Posts: 18,460

Location: Kassel

Occupation: Sysadmin SAP / Linux / AIX

Number of monitoring servers: 2

Hobbies: Motorrad fahren, wenns die Zeit erlaubt :-)

Nagios Version: 3.2.3 ( OMD )

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 360

Number of services: 6700

OS: Debian 6.0

Plugin Version: 1.4.x

Other Addons: SNMPTT, NagTrap, check_mk, PNP-0.6.x. Thruk

13

Wednesday, July 4th 2012, 2:30pm

Ps: Wo schließe ich den Thread?


ersten Beitrag editieren und ein [SOLVED] im Titel einfügen
+++ PNP Developer +++ PNP 0.6.21 ist online ! +++
Hilfreiche Infos gefunden? Dann schnell ein paar Cent flattrn
OMD - Open Monitoring Distribution