I have services defined that load and work just fine, for example this works like a champ:
Code: Select all
define host {
use linux-server
host_name myhost
alias myhost
address a.b.c.d
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
}
define service {
use generic-service
host_name myhost
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service {
use generic-service
host_name myhost
service_description SSH
check_command check_ssh
notifications_enabled 0
}
then nagios will fail to reload with errors. I can run all these commands find on both the nagios core server as well as the monitored node.
Code: Select all
define service {
use generic-service
host_name myhost
service_description Disk Space
check_command check_disk -w 10% -c 2% -p /
notifications_enabled 0
}
define service {
use generic-service
host_name myhost
service_description HTTP-80
check_command check_http -I a.b.c.d -p 80 -w 3 -c 5 -t 7
notifications_enabled 0
}
define service {
use generic-service
host_name myhost
service_description Processes
check_command check_procs -w 1000 -c 2000
notifications_enabled 0
}
define service {
use generic-service
host_name myhost
service_description Swap
check_command check_swap -w 50% -c 10%
notifications_enabled 0
}
define service {
use generic-service
host_name myhost
service_description Users
check_command check_users -w 10 -c 20
notifications_enabled 0
}Code: Select all
Checking objects...
Error: Service check command 'check_disk -w 10% -c 2% -p /' specified in service 'Disk Space' for host 'myhost' not defined anywhere!
Error: Service check command 'check_http -I a.b.c.d -p 80 -w 3 -c 5 -t 7' specified in service 'HTTP-80' for host 'myhost' not defined anywhere!
Error: Service check command 'check_procs -w 1000 -c 2000' specified in service 'Processes' for host 'myhost' not defined anywhere!
Error: Service check command 'check_swap -w 50% -c 10%' specified in service 'Swap' for host 'myhost' not defined anywhere!
Error: Service check command 'check_users -w 10 -c 20' specified in service 'Users' for host 'myhost' not defined anywhere!
{...}
Total Warnings: 0
Total Errors: 5
***> One or more problems was encountered while running the pre-flight check...
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
nagios.service: control process exited, code=exited status=8
Reload failed for LSB: Starts and stops the Nagios monitoring server.
Rob