CFG Host Definition problems
Posted: Mon Mar 23, 2020 1:56 pm
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!
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!