itproject
Goto Top

Nagios Core - Service Status - Unknown

Hallo zusammen,

ich habe ein Problem mit meinem neu aufgesetzten Nagios Server.

Ich muss erstmals beichten, ich bin ein absoluter Nagios beginner.
Nagios ist bei mir auf einem Debian - Squeeze (ohne GUI) installiert.

z.B. ich setze auf meinem Nagios System folgenden Befehl ab:

#/usr/lib/nagios/plugins/check_nrpe -p 5666 -H 192.168.1.1 -c check_load
--> OK - load average: 0.00, 0.03, 0.11|load1=0.000;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.110;5.000;20.000;0;

Also manuell scheint es auf dem Remote Linux Host (192.168.1.1) zu funktionieren.

In meiner Hosts.cfg steht folgender Eintrag:

define host{
use linux-box ; Inherit default values from a template
host_name hostname ; The name were giving to this server
alias Ubuntu 11.04 ; A longer name for the server
address 192.168.1.1 ; IP address of the server
}

define service{
use generic-service
host_name hostname
service_description CPU Load
check_command check_nrpe!check_load
}

In meinem Nagios Webfrontend bekomme ich unter meinem Host(192.168.1.1)/Services folgende Meldung

Current Status:
UNKNOWN
(for 0d 0h 10m 13s)
Status Information: check_nt: Argumente konnten nicht ausgewertet werden
Usage:check_nt -H host -v variable [-p port] [-w warning] [-c critical][-l params] [-d SHOWALL] [-t timeout]


Dazu passend, einen Ausschnitt aus der commands.cfg:


  1. 'check_nt' command definition
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 5666 -v $ARG1$ $ARG2$
}

  1. 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 5666 -s nagios -v $ARG1$ $ARG2$
}


Ich hoffe ihr könnt mir weiterhelfen face-smile
Wenn ich auf dem Nagios Server den Befehl lokal absetze bekomme ich einen wunderbaren response.
Das ganze mit Scheuleder im Nagios Core frontend leider "UNBEKANNT" ... ich finde leider nicht heraus weshalb.


Viele Grüße und Dankeschön!

ITproject

Content-Key: 172714

Url: https://administrator.de/contentid/172714

Printed on: April 19, 2024 at 12:04 o'clock

Member: ThomasH.
ThomasH. Sep 07, 2011 at 11:45:22 (UTC)
Goto Top
Mahlzeit.

Status Information: check_nt: Argumente konnten nicht ausgewertet werden

Du willst eine Linux Kiste abfragen, richtig? check_nt ist doch für Windows Systeme, wenn ich mich nicht irre.

MfG Th.
Member: Deepsys
Deepsys Sep 07, 2011 at 11:50:55 (UTC)
Goto Top
Hi,

das stimmt aber was vorne und hinten nicht:
Du setzt manuell ein check_nrpe ab, im nagios aber ein check_nt!!
Ich vermute der Fehler liegt in der commands.cfg, dort ist unter dem command_name check_nrpe das Kommando für check_nt hinterlegt!

Und das erwarte auch 2 Argumente, dein Service übergibt aber nur eines ...

Guck dir das doch noch mal in dieser Richtung an face-smile

VG
deepsys
Member: itproject
itproject Sep 07, 2011 at 13:23:18 (UTC)
Goto Top
Hallo zusammen,

also mein erster Fehler scheint behoben, ich habe tatsächlich check_nt anstatt check_nrpe in meine commands.cfg geschrieben =)

Nun gibt es einen weiteren interessanten Fehler.

Current Status:
CRITICAL
(for 0d 0h 16m 13s)
Status Information: (Return code of 127 is out of bounds - plugin may be missing)

Das deutet ja wohl auf ein Fehlendes Plugin seitens Linux-Client (192.168.1.1) hin.

Habe mir das angesehen:

ursprünglich habe ich dort per "apt-get install nagios-nrpe-server" alle (glaube ich) nötigen Plugins dafür installiert.

Weiter habe ich rechte auf /usr/local/nagios dem user Nagios erteilt.

In die /etc/nagios/nrpe_local.cfg habe ich folgendes geschrieben:

allowed_hosts=192.168.1.2 (nagios host)
command[check_load]=/usr/lib/nagios/plugins/check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4.0

Allerdings steht in der "normalen" nrpe.cfg" um einiges mehr drinnen, wie port, user uvm.

Danke schon einmal im voraus für eure Hilfe!

Viele Grüße

Itproject
Member: Deepsys
Deepsys Sep 07, 2011 at 17:27:21 (UTC)
Goto Top
N'Abend,

tut mir leid da kann ich dir nicht weiterhelfen, da ich nur Windows Server überwache.

Allerdings denke ich das du auf dem Client nicht alles für den nrpe-server brauchst, sondern nur das Plugin selber.
Suche doch mal mit "aptitude search nrpe" auf dem Client nach einem anderen Paket.

VG
Deepsys
Member: itproject
itproject Sep 09, 2011 at 09:34:43 (UTC)
Goto Top
Hallo,

"plugin may be missing" war richtig. An dieser stelle war tatsächlich kein Plugin gelegen.

Nach der Angabe des Ritigen Pfades bekomme ich wieder den Status "unknown" diesmal allerdings bezüglich unten stehender Meldung (Anscheinend gibt das Plugin auf dem NRPE Server keine Werte zurück, warum, das weiß ich leider auch nicht o.O) :

(No output returned from plugin)
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.12
Last Modified: 03-10-2008
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required

Usage: check_nrpe -H <host> [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

Options:
-n = Do no use SSL
-u = Make socket timeouts return an UNKNOWN state instead of CRITICAL
<host> = The address of the host running the NRPE daemon
[port] = The port on which the daemon is running (default=5666)
[timeout] = Number of seconds before connection times out (default=10)
[command] = The name of the command that the remote daemon should run
[arglist] = Optional arguments that should be passed to the command. Multiple
arguments should be separated by a space. If provided, this must be
the last option supplied on the command line.
-h,--help Print this short help.
-l,--license Print licensing information.
-n,--no-ssl Do not initial an ssl handshake with the server, talk in plaintext.

Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here. Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin. This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.

Jemand so etwas schon mal gehabt?

in meiner nrpe.cfg auf dem NRPE Server (Nagios Client) steht:

command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20

Auf dem Nagios Server steht in meiner hosts.cfg steht als Define Service folgender Eintrag:

define service{
use generic-service
host_name remoteserver
service_description CPU Load
check_command check_nrpe!check_load
}

Jemand noch eine Idee ??

Vielen Dank ;)

Grüße
ITproject
Member: itproject
itproject Sep 09, 2011 at 13:12:19 (UTC)
Goto Top
LÖSUNG:


VORHER(Service Status Unknown):

  1. 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -v $ARG1$ $ARG2$


NACHHER(Funktionierend):

  1. this command runs a program $ARG1$ with no arguments
define command {
command_name check_nrpe_1arg
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

Nun geht es (lag aber nicht am Port) Es scheint beim Zielsystem (Debian 5, Lenny) Schwierigkeiten damit zu geben, habe ich aus einem Anderen Forum erlesen können.
Lösung ausprobiert und Tatsache, es geht ;)

Danke trotzdem für die Hilfe!!

Viele Grüße ITproject