List of variables accessible from notification commands

I know how I can create the arguments for my notification check commands, but I fail to find a place where I can see all the standard variables (i.e. not custom vars) a notification command can access.

Is there a way to list them?

So I can see which $host.$, $service.$, $notification.*$, etc. are available? I know of inspect, but things like “Check execution time” or “Check latency” are listed in the web view, but I can’t find them with inspect.

Hi & welcome,

take a look into the docs :wink: Object Types - Icinga 2

An other way instead of the inspect could be to use the api. Api - Icinga 2 You get a json with vars from a host or service object.

Thanks, I know that page, but I can’t find the mentioned properties there. Also I think it’s unclear how to access them via the variable nomenclature.

For example it seems that I can access $notification.type$ but not $notification.number$. But $notification_number$ works… So I don’t really understand when an subobject dot notation is used and when an underscore is used.

Also some statistic fields are not there, the TOTAL* envs from icinga1/nagios, if you know what I mean… I’m thinking if it would not be a great option to allow to send all objects that are relevant to a notification to a notification script as json objects. This would also help with the definition of notification commands in director, which is, sorry the language, a pain in the a**.

Hmm… I understand. I never tried this with the notification vars. Maybe others have more ideas. And/Or maybe @theFeu can bring light into the darkness

I would suggest looking into our runtime macros :slight_smile: