Hi there,
i noticed a strange behaviour with my config files.
First i have this CFG-File to monitor some windows machines:
define host {
use windows-server
host_name myServer
alias myServer
address IP
}
define service {
use generic-service
host_name myServer
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}
Second one with modified "check_ncpa" (from the example in the Documentation):
define host {
host_name myServer
address IP
check_command check_ncpa!-t 'TOKEN' -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts nagiosadmin
notification_interval 60
notification_period 24x7
notifications_enabled 1
register 1
}
define service {
host_name myServer
service_description CPU Usage
check_command check_ncpa!-t 'TOKEN' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
Till today we have used "check_nt" with "NSClient++". So because "NSClient++" ist very old and did not get updates we decided to use "NCPA" from Nagios on out Clients and check with "check_ncpa". So i replaced the "check_nt" commands with the matching "check_ncpa" commands, but after that the service will not restart and exited with an error. When i change the mian nagios.cfg to laod the old config with "check_nt" used the service is starting without any problems. Strange thing...
Then i check the Documentation. There is mentioned that the red marked fields are needed! but that is a little bit wrong, because i can start it without using all the required parameters, like this config. This config start without any problem. Only "hostname", "address" and "max_check_attempts" is needed, but the Documentation mentions a lot more..
define host {
host_name myServer
address IP
#check_command check_ncpa!-t 'TOKEN' -P 5693 -M system/agent_version
max_check_attempts 5
#check_interval 5
#retry_interval 1
#check_period 24x7
#contacts nagiosadmin
#notification_interval 60
#notification_period 24x7
#notifications_enabled 1
#register 1
}
So what are the problems here? Why did my first modifief config not start but my second one? And what about the required fields problem?
Thanks a lot!
CFG Host Definition problems
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: CFG Host Definition problems
This is because you are using templates to layer configs, i.e. use windows-server. These options are required however they don't need to exist in each layer of the configs/templates as they build a final config. If the final config is missing a directive then yes it will fail.Opa114 wrote: Then i check the Documentation. There is mentioned that the red marked fields are needed! but that is a little bit wrong, because i can start it without using all the required parameters, like this config. This config start without any problem. Only "hostname", "address" and "max_check_attempts" is needed, but the Documentation mentions a lot more..
What was the error?Opa114 wrote:So i replaced the "check_nt" commands with the matching "check_ncpa" commands, but after that the service will not restart and exited with an error.
Did you put the check_ncpa command definition in your configs as well? I did not see this in your configs.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: CFG Host Definition problems
oh yeah i found the mistake. I had forgotten to create the host group windows-servers. I accidentally deleted this group.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: CFG Host Definition problems
Great!Opa114 wrote:oh yeah i found the mistake. I had forgotten to create the host group windows-servers. I accidentally deleted this group.
Locking thread