Has anyone encountered the followng problem and found a solution for it?
2.0b4 complains about ‘max_attempts’ (!) and ‘notification_interval’ not correctly set when I use a template defining these (and other) variables.
E.g. my template is:
define host {
name unix-host
use generic-host
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups unix-admins,unix-sms
register 0
}
and one of the host-definitions is for example:
define host {
use unix-host
host_name dot
alias Dot Oracle
address 14w.x.y.z
parents d01-7
}
what’s the service definition? to me it looks more like a service definition problem…
Luca
I doubt that it is a service problem as I only changed hosts.cfg (started to use templates). Also the error-message is:
Error: Invalid max_attempts value for host 'dot’
Error: Could not register host (config file ‘/usr/local/nagios/etc/hosts.cfg’, starting on line 228)
But in case I’m wrong, the service-definitions for dot are:
define service {
use unix-template-load
host_name dot
notification_period workhours
}
define service {
use unix-template
host_name dot
service_description LOGS
max_check_attempts 1
notification_period workhours
check_command check_smartlog!dot
}
define service {
use unix-template-ping
host_name dot
notification_period workhours
}
define service {
use unix-template-procs
host_name dot
notification_period workhours
}
define service {
use unix-template-ssh
host_name dot
}
define service {
use unix-template-users
host_name dot
notification_period workhours
}
define service {
use unix-template-zombies
host_name dot
notification_period workhours
}
define service {
use unix-template
host_name dot
service_description A1000
max_check_attempts 1
normal_check_interval 60
retry_check_interval 15
notification_period workhours
check_command check_nrpe!check_A1000
}
are you sure the error isn’t in the template definition? i don’t see it here and i don’t see max_attempts anywhere here…
Luca
Edited Tue Oct 11 2005, 12:52AM ]
That’s what so strange about it: max_attempts is not a valid nagios keyword so I don’t understand why it complains about it. Furthermore: the template is copy & paste of a regular host-definition minus some fields.
the template unix-host uses generic-host could you post this too?
Luca
define host {
name generic-host
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
register 0
}
duh… ok, brutal way comes to mind…
move all files to another directory… and get them one by one back in with a single host and a single service… and see if it works…
or could it possibly be taking in files from another directory?
Luca