PDA

Bekijk Volledige Versie : Nagios probleem; escalations.cfg



BertvArkel
03/01/08, 20:23
Beste,

ik wil van mijn windows monitoring af en nu ben ik bezig met de setup van Nagios maar ik krijg een error bij de setup kan iemand mij helpen ?



[root@fibnob-hilversum nagios]# nagios -v nagios.cfg

Nagios 2.10
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 10-21-2007
License: GPL

Reading configuration data...

Error: Could not find any host matching 'fibnob-hilversum'
Error: Could not expand hostgroups and/or hosts specified in service escalation (config file '/etc/nagios/escalations.cfg', starting on line 1)

***> 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.

[root@fibnob-hilversum nagios]#


nu heb ik zo de inhoud van : escalations.cfg



define serviceescalation{
host_name fibnob-hilversum
service_description SMTP
first_notification 2
last_notification 6
contact_groups admin
notification_interval 0
}



wie kan me helpen ?

ps. ik maak gebruik van deze handleiding: http://wiki.centos.org/HowTos/Nagios
(systeem: CentOS 4.5)

wonko
03/01/08, 20:36
en toon even de definitie van "fibnob-hilversum" (vermoedelijk in hosts.cfg)...

BertvArkel
03/01/08, 20:50
# Generic host definitions
define host{
name fibnob-hilversum ; Generic template name
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

# This creates a generic template that any host can use.
# Notifies never, checks 15 times before showing critical on CGI interface,

define host{
name basic-host
use generic-host
check_command check-host-alive
max_check_attempts 15
notification_interval 0
notification_period none
notification_options n
register 0
}

# This creates a generic host that your routers can use
# monitors host(s) 24x7, notifies on down and recovery, checks 15 times before going critical,
# notifies the contact_group every 30 minutes

define host{
name your-routers-host
use generic-host
check_command check-host-alive
max_check_attempts 15
notification_interval 30
notification_period 24x7
notification_options d,r
register 0
}

define host{
use basic-host
host_name mymachine1
alias mymachine1
address 192.168.100.101
contact_groups einsteins
# notification_options d,r #overrides the basic-host option
}

define host{
use your-routers-host
host_name router1
alias router1
address 192.168.100.100
contact_groups einsteins
}

wonko
03/01/08, 20:55
En lees nu even de volgende lijn


register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!

... en ga dan verder met het configureren van nagios.

Denk eraan dat templates handig zijn, dus je kan dit best even goed overdenken.

BertvArkel
03/01/08, 22:28
Nagios 2.10
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 10-21-2007
License: GPL

Reading configuration data...

Error: Could not find any host matching 'fibnob-hilversum'
Error: Could not expand hostgroups and/or hosts specified in service escalation (config file '/etc/nagios/escalations.cfg', starting on line 1)

***> 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.



en wat nu dan ?

file: escalations.cfg



define serviceescalation{
host_name fibnob-hilversum
service_description SMTP
first_notification 2
last_notification 6
contact_groups admin
notification_interval 0
}

wonko
03/01/08, 22:36
wat heb je aangepast?

BertvArkel
03/01/08, 22:37
wat jij zij...

wonko
03/01/08, 22:52
zet dan nog eens je hosts hier neer... de error is duidelijk, de host die jij opgeeft wordt niet gevonden.

DutchTSE
03/01/08, 22:56
Opzich is jou deel wel goed, het probleem zit hem in het feit dat je de hosttemplate de naam van je server hebt gegeven. Doe het als volgt:



# Generic host definitions
define host{
name basic-host ; Generic template name
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
max_check_attempts 15
notification_interval 30
notification_period 24x7
notification_options d,r
check_command check-host-alive
contact_groups XXXX
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

define host{
use basic-host
host_name fibnob-hilversum
alias fibnob-hilversum
address 127.0.0.1
}



Je maakt dus eerst een algemene template aan met daarin de instellingen die voor al je hosts moeten gelden, daarna maak je de daadwerkelijke hosts (servers) aan en die laat je de template gebruiken.



define serviceescalation{
host_name fibnob-hilversum
service_description SMTP
first_notification 2
last_notification 6
contact_groups admin
notification_interval 0
}

BertvArkel
03/01/08, 23:33
na het aanpassen wat jij zij krijg ik deze melding;



Nagios 2.10
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 10-21-2007
License: GPL

Reading configuration data...

Error: Template 'basic-host' specified in host definition could not be not found (config file '/etc/nagios/hosts.cfg', starting on line 38)

***> 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.

Xolphin
04/01/08, 01:49
na het aanpassen wat jij zij krijg ik deze melding;


Kun je het hele bestandje ergens neerzetten? De tekst die hierboven staat is goed, maar waarschijnlijk heb je ergens een fout gemaakt.

BertvArkel
04/01/08, 04:10
Ik laat mijn collega vanmiddag er wel naar kijken.

Dank jullie voor de hulp.

misschien kunnen jullie hier wat basic bestanden plaatsen zo als die er standaard bij ziiten en kijken of dat werkt...