Icinga users working on the command line (like me) are used to create apply rules with "assign where" and "ignore where" conditions.
But if you use the graphical Icinga configuration tool (Icinga Director), this works a bit differently.
A simple example of an apply rule using both assign and ignore conditions:
apply Service "NTP" {
import "generic-service"
check_command = "nrpe"
vars.nrpe_command = "check_ntp"
vars.nrpe_arguments = [ "0.ch.pool.ntp.org", "30", "60" ]
assign where host.address && host.vars.os == "Linux"
ignore where host.vars.applyignore.ntp == true
}
This NTP service check (executed via the NRPE command in this example) is applied to all the hosts:
The NTP service check will however not be rolled out (ignored) on hosts which:
If you want to create the same apply rule from above in Icinga Director, you will notice there is a "Assign where" section, but no "Ignore where" section.
Does this mean the ignore condition cannot be defined? Kind of yes, but there's another way to set this.
Note: The ignore where condition is reserved by the Director for blacklisted hosts, using the DirectorOverrideTemplate.
The solution is to append the assign where condition to add a reversed condition, which can be added with the NOT operator.
To translate the NTP example from above, this means: Create a service check NTP and assign to hosts which:
In the graphical UI the apply rule will look like this:
The tricky part is how to get the AND/NOT conditions aligned, using the plus-icon and the fast-forward-icon. But after some playing around with these, you should be able to find out how to do it.
Hint: First append the AND condition with another field (plus-icon next to AND operator), then click on the fast-forward-icon next to the added empty field.
This results in the following apply rule, which can be seen in the "Preview" tab in the Director UI:
apply Service "NTP" {
import "svc_ntp_generic"
assign where host.address && host.vars.os == "Linux" && !(host.vars.applyignore.ntp)
import DirectorOverrideTemplate
}
No comments yet.
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder