We had some hosts defined in conf.d and was monitoring DNS for these
machines using the services.conf as follows.
apply Service "dns" {
import "generic-service"
check_command = "dns"
assign where host.name
ignore where host.name == "localhost" /* for upgrade safety */
ignore where host.address == "127.0.0.1" /* for upgrade safety */
vars.dns_lookup = "$host_name$"
vars.dns_expected_answers = "$host.address$"
vars.dns_server = "172.30.0.1"
}
We then moved the machines over to remote client sending configuration to
master and changes the services.conf to the below config, because we could
not find a reliable way to get the $host.address$ from the remote client.
apply Service "dns" {
import "generic-service"
check_command = "dns"
assign where host.name
ignore where host.name == "localhost" /* for upgrade safety */
vars.dns_lookup = "$host_name$"
vars.dns_server = "172.30.0.1"
}
This did not remove the check. It still checks the dns and fails as before.
The Object information for the service is :
Object 'prd-qua-za-puppet.dc.compnay.com!dns' of type 'Service':
% declared in '/etc/icinga2/conf.d/services.conf', lines 27:1-27:19
* __name = "prd-qua-za-puppet.dc.compnay.com!dns"
* action_url = ""
* check_command = "dns"
% = modified in '/etc/icinga2/conf.d/services.conf', lines 30:3-30:23
* check_interval = 60
% = modified in '/etc/icinga2/conf.d/templates.conf', lines 28:3-28:21
* check_period = ""
* command_endpoint = ""
* display_name = "dns"
* enable_active_checks = true
* enable_event_handler = true
* enable_flapping = false
* enable_notifications = true
* enable_passive_checks = true
* enable_perfdata = true
* event_command = ""
* flapping_threshold = 30
* groups = [ ]
* host_name = "prd-qua-za-puppet.dc.compnay.com"
% = modified in '/etc/icinga2/conf.d/services.conf', lines 27:1-27:19
* icon_image = ""
* icon_image_alt = ""
* max_check_attempts = 3
% = modified in '/etc/icinga2/conf.d/templates.conf', lines 27:3-27:24
* name = "dns"
% = modified in '/etc/icinga2/conf.d/services.conf', lines 27:1-27:19
* notes = ""
* notes_url = ""
* retry_interval = 30
% = modified in '/etc/icinga2/conf.d/templates.conf', lines 29:3-29:22
* templates = [ "dns", "generic-service" ]
% = modified in '/etc/icinga2/conf.d/services.conf', lines 27:1-27:19
% = modified in '/etc/icinga2/conf.d/templates.conf', lines 26:1-26:34
* type = "Service"
* vars
* dns_lookup = "$host_name$"
% = modified in '/etc/icinga2/conf.d/services.conf', lines 36:2-36:32
* dns_server = "172.30.0.1"
% = modified in '/etc/icinga2/conf.d/services.conf', lines 38:2-38:31
* volatile = false
* zone = ""
As you can see there is no dns_expected_answers vars.
Any ideas why the check still uses this var in the check
--
-- <X-Clacks-Overhead: GNU Terry Pratchett>
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users