PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : nagios rdiff Plugin



Huhn Hur Tu
28.12.10, 15:02
Hallo,
ich kämpfe schon eine Weile mit dem Rdiff Plugin für Nagios3 unter Debian Lenny.
Eintrag in /etc/nagios3/commands.cfg



check rdiff-backup
define service{
use local-service
host_name localhost
service_description rdiff-backup
check_command check_rdiff!/rdiff-web/root!8!10!500!24
}


/etc/nagios-plugins/config/rdiff


#check rdiff-backup
define command{
command_name check_rdiff
command_line sudo $USER1$/check_rdiff -r $ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$ -p $ARG5$
}


Und bei einem Restart noelt Nagios


Restarting nagios3 monitoring daemon: nagios3
/etc/init.d/nagios3: line 64: kill: (10520) - No such process

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Error: Template 'local-service' specified in service definition could not be not found (config file '/etc/nagios3/commands.cfg', starting on line 90)

***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

errors in config! failed!
failed!


Ich muss zugeben dass ich von nagios nicht viel Ahnung habe.

Gruss Stefan

cane
28.12.10, 15:43
use local-service

Du inludierst in /etc/nagios3/commands.cfg das Template "local-service" das es aber nicht gibt / das Nagios nicht finden kann.

Warum hast Du dieses Include verwendet?

mfg
cane

Huhn Hur Tu
28.12.10, 15:57
Weil es hier stand!


https://wiki.archlinux.org/index.php/Nagios#Plugin_check_rdiff


Gruss Stefan

cane
28.12.10, 18:34
Dann schau dir mal an welche Templates Du hast oder ob local-service irgendwo difiniert ist aber nicht eingebunden wird.

EDIT: Poste mal bitte deine /etc/nagios/objects/templates.cfg

mfg
cane

Huhn Hur Tu
29.12.10, 09:13
So im Anhang habe ich mal die command.cfg und die template.cfg, die ich aber erst aus /usr/share/doc/nagios3-common/examples/template-object
holen musste.

Gruss Stefan

cane
29.12.10, 12:21
So im Anhang habe ich mal die command.cfg und die template.cfg, die ich aber erst aus /usr/share/doc/nagios3-common/examples/template-object
holen musste.

Gruss Stefan

Das heißt in deinem Nagios Config Verzeichnis fehlte die template.cfg?

Im von dir referenzierten Link wurdest Du angewiesen alle Configs zu kopieren:


# cp /etc/nagios/cgi.cfg.sample /etc/nagios/cgi.cfg
# cp /etc/nagios/resource.cfg.sample /etc/nagios/resource.cfg
# cp /etc/nagios/nagios.cfg.sample /etc/nagios/nagios.cfg
# cp /etc/nagios/objects/commands.cfg.sample /etc/nagios/objects/commands.cfg
# cp /etc/nagios/objects/contacts.cfg.sample /etc/nagios/objects/contacts.cfg
# cp /etc/nagios/objects/localhost.cfg.sample /etc/nagios/objects/localhost.cfg
# cp /etc/nagios/objects/templates.cfg.sample /etc/nagios/objects/templates.cfg
# cp /etc/nagios/objects/timeperiods.cfg.sample /etc/nagios/objects/timeperiods.cfg

Bitte prüf mal ob Du da was vergessen hast...

mfg
cane

Huhn Hur Tu
29.12.10, 12:53
Jetzt hab ich mal alle Dateien kopiert.
Der "local service" ist aber schon in templates.cfg definiert wenn ich das richtig gesehen habe.


4.0K -rw-r--r-- 1 root root 1.9K 2009-06-30 11:24 apache2.conf
12K -rw-r--r-- 1 root root 11K 2009-07-02 11:37 cgi.cfg
4.0K -rw-r--r-- 1 root root 3.6K 2010-12-29 08:40 commands.cfg
4.0K -rw-r--r-- 1 root root 2.2K 2010-12-29 12:49 contacts.cfg
4.0K -rw-r--r-- 1 root root 26 2010-12-28 10:00 htpasswd.users
8.0K -rw-r--r-- 1 root root 5.3K 2010-12-29 12:34 localhost.cfg
8.0K -rw-r--r-- 1 root root 6.8K 2010-12-29 12:35 mrtg.cfg
44K -rw-r--r-- 1 root root 42K 2009-07-02 11:37 nagios.cfg
4.0K -rw-r--r-- 1 root root 3.1K 2010-12-29 12:48 printer.cfg
4.0K -rw-r----- 1 root nagios 1.3K 2009-06-30 11:24 resource.cfg
4.0K drwxr-xr-x 2 root root 4.0K 2010-12-28 15:03 stylesheets
4.0K -rw-r--r-- 1 root root 3.3K 2010-12-29 12:48 switch.cfg
12K -rw-r--r-- 1 root root 11K 2010-12-29 08:38 templates.cfg
4.0K -rw-r--r-- 1 root root 3.2K 2010-12-29 12:48 timeperiods.cfg
4.0K -rw-r--r-- 1 root root 4.0K 2010-12-29 12:48 windows.cfg

cane
29.12.10, 13:03
Und - funktioniert es jetzt?

Lag die datei denn vorher schon in /etc/nagios/objects/ ?

mfg
cane

Huhn Hur Tu
29.12.10, 14:08
Nein die Datei lag vorher in /usr/share/doc/nagios3-common/examples/template-object.
Wenn ich statt local-service generic-service verwende startet auch Nagios.
Ich muss jetztt noch das Plugin anschauen was das noch von mir will, bin aber gerade etwas busy, melde mich aber deswegen wieder.

Gruss Stefan

cane
29.12.10, 18:29
Okay, viel Erfolg :-)

mfg
cane

Huhn Hur Tu
30.12.10, 15:56
Das umstellen von local-service auf generic-service hats gebracht, ich hatte dann auch noch das falsche repository angegeben:-)

Jetzt funzts

Gruss Stefan