Can I tune the Icinga API eventstream? - it is "bursty"

Hi,

we are successfully using the icinga2 API eventstream for dashboarding. In testing we made a “clock” check which ran every second. When we put it on the dashboard it only updated every 5 seconds or so.
Looking into the mechanics we found that the eventstream only woke up every 5 seconds or so, can we change this to something quicker, e.g. every half second?

cheers,
Woody

2 Likes

Hello Woody!

You mean: The stream actually yielded mathematically speaking 1 event/s, but only every 5s, so 5/5s?

Best,
A/K

Thanks AK,

This was a busy server, I didn’t confirm that events were dropped or not, I suspect not, I think the “clock” just updated like:

10:00
…… (no change for a few seconds)
10:01,2,3,4,5

Similarly if you just curl the event stream and eyeball it, you see a repeated gaps of 5 seconds

(below perl code is just timestamping each line and printing it, uniq -c is counting the number of messages stamped with that timestamp)

You can see a gap of 5 seconds between times - I have just typed in “5 second gap” below to highlight where.

cheers,
Woody

woody@willie:~$ curl -ksu $AUTH -H accept:application/json -X POST https://localhost:5665/v1/events -d '{ "queue": "woody", "types": [ "CheckResult" ] }' | perl -MTime::HiRes -nle'$t = Time::HiRes::time; print sprintf "%0.1f : %s", $t, $_' | cut -d : -f 1 | uniq -c 
     10 1693377562.7 
      3 1693377562.8 
      4 1693377562.9 
      4 1693377563.0 
      8 1693377563.1 
      8 1693377563.2 
     12 1693377563.4
--- 5 second gap ---
    314 1693377568.4 
      4 1693377568.5 
     10 1693377568.6 
      9 1693377568.7 
      4 1693377568.8 
      5 1693377568.9 
     15 1693377569.0 
--- 5 second gap ---
    148 1693377574.0 
    182 1693377574.1 
      2 1693377574.2 
      3 1693377574.3 
      8 1693377574.4 
      8 1693377574.6 
      3 1693377574.7 
      7 1693377575.0 
--- 5 second gap ---
    387 1693377580.0 
      5 1693377580.1 
      9 1693377580.3 
      6 1693377580.4 
      6 1693377580.5 
      9 1693377580.6 
      2 1693377580.7 
      3 1693377580.8 
      8 1693377580.9 
      6 1693377581.0 
     13 1693377581.1 
      8 1693377581.2 
      7 1693377581.3 
      3 1693377581.4 
      3 1693377581.5 
      3 1693377581.6 
      5 1693377581.7 
      8 1693377581.8 
      4 1693377581.9 
--- 5 second gap ---
     65 1693377586.9 
^C
woody@willie:~$

What’s your Icinga version?

Hi AK,

That instance is currently running r2.14.0-1, it currently has around 2000 hosts and 6000 services with check frequency typically between 2-5 minutes.

:~# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.14.0-1)

Copyright (c) 2012-2023 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later https://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: Debian GNU/Linux
Platform version: 11 (bullseye)
Kernel: Linux
Kernel version: 5.10.0-23-amd64
Architecture: x86_64

Build information:
Compiler: GNU 10.2.1
Build host: runner-hh8q3bz2-project-575-concurrent-0
OpenSSL version: OpenSSL 1.1.1n 15 Mar 2022

Thanks,
Matt

r2.14.0-1 as Matt said