Am 09.02.2015 um 17:38 schrieb Dustin Funk:
Hi,
i have a question about config handling for icinga2 agent based checks
(icinga2 version 2.2.3).
I wanna use both cases
- local config and
- remote check execution
I'm not sure why you would want that. That generates headaches.
The question is how to handle both cases. My problem is that 'node
update-config' handles both and creates also files for clients which can
not be administrated by update-config (the clients which usees remote
check execution).
I did the following:
1) run the wizard for become a secure connection between both hosts
2) delete host.conf on client (because for the client check execution
should be used)
3) activate the accept_commands on clients api.conf
4) wrote manually the configuration on the master (objects: host,
endpoint and zone) and saved it e.g. in conf.g
5) run icinga2 node list
At node list output i see that the new client is registered but only one
line is listet (only the node, no host, no service).
At this point all works fine.
6) run update-config (because there are more clients configured with
local config)
update-config creates now a zone, endpoint and host object (restart
icinga2 isn't possible because double definitions).
The definitions from update-config are the following:
repository.d/hosts/
object Host "monitoring-test.fem.tu-ilmenau.de" {
import "satellite-host"
check_command = "cluster-zone"
}
repository.d/endpoint/
object Endpoint "monitoring-test.fem.tu-ilmenau.de" {
}
repository.d/zones/
object Zone "monitoring-test.fem.tu-ilmenau.de" {
endpoints = [ "monitoring-test.fem.tu-ilmenau.de" ]
parent = "master"
}
My workaround atm is to edit the three files in the repository.d.
- the zone-file is identical
- the host file is full commented out and is defined in a file in conf.d
- add attribute "host" on the endpoint file
I like the idea to play all zone and endpoint configurations in
repository.d. But for clients with remote check execution the object
host is created wrong and in the endpoint the ip/FQDN/dns is missing.
It wasn't made for that, which is why we are not using nor refencing it
in the documentation.
But when there is no way that update-config create only endpoint and
zone in the right way i prefer to create it by myself and blacklist the
host. But blacklisting not works:
# icinga2 node list
Node 'monitoring-test.fem.tu-ilmenau.de' (last seen: Mon Feb 9 01:32:01
2015)
# icinga2 node blacklist list
(empty)
# icinga2 node blacklist add --host monitoring-test.fem.tu-ilmenau.de
--zone monitoring-test.fem.tu-ilmenau.de
# icinga2 node blacklist list
Listing all blacklist entries:
blacklist filter for Node: 'monitoring-test.fem.tu-ilmenau.de' Host:
'monitoring-test.fem.tu-ilmenau.de' Service: ''.
But now update-config doesn't ignore the host (which is understandable).
Is there a better way for blacklisting?
That's a known bug in 2.2.x: https://dev.icinga.org/issues/8211
Kind regards,
Michael
--
Michael Friedrich, DI (FH)
Application Developer
NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]
** CeBIT 2015 - 16.-20. März 2015 - http://www.netways.de/cebit **
** OSDC 2015 - April - osdc.de **
** Puppet Camp Berlin 2015 - April - netways.de/puppetcamp **
** OSBConf 2015 - September - osbconf.org **
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users