Posts by MarcusCaepio

Please read about the latest changes and upgrade.
Please note that your newly registered account needs to be manually activated by an admin. Just be patient, you cannot post to any forum before this happens. This is thanks to the unfortunate event of spammers recently. More details here.

    well, watching in the docs, it is a bug imho:

    • Zones cannot interfere with other zones and influence each other. Each checkable host or service object is assigned to one zone only.

    But here we have influence between sat and master zone.

    So let's say, I want to bring this setup running like:

    Master: still just for config and web2, notifications, etc... No active checking

    Sats: check the Clients and get their config from master

    Clients: checked via NRPE

    How and where would you suggest defining the host and service objects?


    ...and in addition a zone for each client controled by the satellites.

    A zone for EVERY client? Seriously, who should admin this? That is much more effort you have to do compared to checking it by NRPE / SSH.

    In my single icinga2 instance, where I use NRPE I just need 3 lines for a host to add and check it with a bunch of checks, thanks to my templates. I don't See the sense of having a zone for each client. At most one more zone for all Clients makes sense for me. And since there are 2 Sats, the checks should run loadbalanced and not pinned to one specific sat.


    Known problem.

    Fix it by filter the apply rules by the zone needed:

    Sorry to say that this hard, but imho this makes the whole zones concept obsolete. Is this a bug ? If no, why the zone for global-templates, when services are rolled out globally, doesn't matter where they are stored in my file tree?

    Hi all,

    so, what I want to build, explained as short as possible (names and IPs are changed)

    1 Master - Used to write and spread configs only, has icingaweb2 running and later also will run grafana , assigned to zone master. The master should not do checks actively.

    2 Sat - They should work as Checker in HA/LB, so they are both in a zone called satellite. parent is the master zone, where they get their config from.

    X clients - they are the monitored server.

    Ubuntu 16.04.2

    Icinga2 : r2.6.2-1

    Icingaweb2: 2.4.1

    So I build 3 Zones: global, master, satellite.

    The config above is also on sat 1 and sat 2. Both are signed with the master.

    Now in master zone I defined one host and several services:

    Also I defined in satellite zone my 2 sat server and a ping check:

    My global zone consists of global templates and commands only, as suggested in Icinga2 doc:

    1. :/etc/icinga2/zones.d/global-templates# ls -l
    2. total 24
    3. drwxr-xr-x 2 root root 4096 Feb 17 11:30 commands
    4. drwxr-xr-x 2 root root 4096 Feb 17 11:35 hostgroups
    5. drwxr-xr-x 2 root root 4096 Feb 17 11:33 servicegroups
    6. drwxr-xr-x 2 root root 4096 Feb 17 12:17 templates
    7. -rw-r--r-- 1 root root 906 Feb 13 23:20 timeperiods.conf
    8. -rw-r--r-- 1 root root 284 Feb 17 11:51 users.conf

    Problem 1:

    Every Server gets every service assigned.

    Master has the disk etc included ping, which is only defined in sat zone and the sat server have all master checks.


    Master should not get the ping check because it is only defined in sat zone and sat server should only get the ping check and not the disk, load, etc out of master zone.

    Problem 2:

    How do I have to assign clients (server which are the really monitored ones) to my 2 "Checker" Satelites, when I want to use Icinga2 agent (Linux only)?

    Thanks in advance!

    1. why are you using an own check command for ping, when there is already a check command for ping in the ITL?…plugin-check-command-ping

    2. you are not giving any parameters in your check command, thats why it fails.

    Solution: delete your check command, edit in your service check_command = "check_ping" to "ping" so the service will use the ITL command.

    By the way: Your host check "hostalive" is already a ping check ;)

    Info to ITL:…2#icinga-template-library

    just want to monitor weather the cron was successfully completed or not, which as to be displayed on webUI

    This is exactly what the tutorial I posted, does. You modify your cronjob with the adding of the exitcode and the plugin checks this exit code. The tutorial is for nagios, but all nagios plugins are compatible with icinga2. You just have to write the service command.



    I have checked the links, but ip and port was missing.

    Because the plugin has to be executed local on the monitored host. Same procedure as check_disk for example.

    You have to copy the plugin to the destination server and have to trigger it via nrpe/ssh or whatever you are using to trigger plugins locally.

    Werden die Container immer zur gleichen Zeit runter gefahren? Wenn ja, ScheduledDowntime mit assign rule definieren. Ist weniger Arbeit als über die Api zu pushen. Diese Methode nutze ich nur, wenn ich Downtimes habe die wegen diversen Abhängigkeiten keine feste Zeit haben.

    Dafür habe ich mir dann dementsprechend ein Script gebaut, welches durch den jeweiligen Job, der die Downtime verursacht, getriggert wird.


    ganz spontan als workaround:

    Bei deiner default notification rule packe am Ende "ignore where == " Dein Log Service Name"

    Dann schreibe eine assign rule für den check mit Intervall = 0 und eventuell vllt. Sogar die passenden states mit assign where == "Dein Log Service Name"


    When I see it right, you want to assign a service to different hosts using a servicegroup, right?

    This is not necessary. The assign rules in icinga2 allow you to assign services very flexible (that's why I love it so much).

    Taking your example with a tcp check, I would like to show you, how I check TCP.

    First of all: Because a host could have more than only one TCP Check, I defined the service with the "for" function. So I can generate X TCP Checks for a Host:

    1. apply Service "TCP:" for ( tcp => config in host.vars.tcp ) {
    2. import "generic-service"
    3. check_command = "tcp"
    4. vars += config
    5. assign where host.vars.tcp
    6. }

    As you can see, my assign rule is just "assign where host.vars.tcp"

    In the Host Object definition, I now define the parameters for my TCP Check:

    1. object Host "lalala" {
    2. ....
    3. ....
    4. ....
    5. vars.tcp["3601"] = {                
    6.     tcp_port = 3601
    7. }
    8. # ["3601"] is part of the service name. Because the Service is called "TCP:" in the service definition, the "3601" is added to it. So in Icingaweb2 the Service is shown as "TCP:3601"

    Up to the tcp_port value, which is a required value, I use the default values of the check which are given in the ITL. You can also edit more parameters for this Service Instance if you want. The options are:

    So as you can see it is not necessary anymore, to bound Hosts to several Groups and then assign Services to it. You can assign services with to any given Host Parameter.

    Hope it helps you.



    Jeder Satellite muss natürlich auch gewartet werden, das ist deutlicher Aufwand, vorallem wenn man eventuell kein Config management hat.

    Nicht bei Top Down.

    Config auf dem Master und dieser Verteilt dann.

    Vielleicht so ein Ansatz hier?

    Anbei noch ein Link…ed#distributed-monitoring