vpdose
(Volker Dose)
September 30, 2020, 1:19pm
1
Hi guys,
I would like to use a time-dependent threshold for some checks, like it is described for Icinga 2 core here:
https://icinga.com/docs/icinga2/latest/doc/08-advanced-topics/
-> Time Dependent Thresholds
This looks pretty easy in a configuration file, but can I use a function for an Icinga Director attribute/field?
Best regards
Volker
1 Like
dgoetz
(Dirk Götz)
October 1, 2020, 2:39pm
2
The director does only allow to use functions instead of strings in the command definition for the arguments. So yes it can be done, but has to be done differently.
I have no access to one of the customer environments were I did this in the past at the moment, but if needed I can try to create an example.
vpdose
(Volker Dose)
October 1, 2020, 3:26pm
3
Hi Dirk,
any hint would be great.
One question, as you did such stuff in the past: is this a peformance killer?
Best regards
Volker
dgoetz
(Dirk Götz)
October 1, 2020, 4:06pm
4
Here is the example I came up with. Not exactly what I have used at the customer but similar to the one in the docs.
First I created a wrapper command timedependent-load
which imports load
.
Then I could override the arguments with a bit of DSL.
Afterwards simply create a service that uses the command and if not already existing you need to create the timeperiod.
1 Like
vpdose
(Volker Dose)
October 5, 2020, 6:12am
5
Hi Dirk,
thanks for your reply, I think, I got it.
Best regards
Volker