Invoke-IcingaCheckCertificate some fields "Unable to fetch function body through API"

I want to implement the check “Invoke-IcingaCheckCertificate”. In powershell this is the following call

Invoke-IcingaCheckCertificate -CertStore ‘LocalMachine’ -CertStorePath ‘My’ -CertSubject ‘*’ -Trusted -WarningEnd ‘30d:’ -CriticalEnd ‘10d:’

In the past I always have the required fields defined and could then use them in the Icinga director as custom fields. However, some required fields say " /* Unable to fetch function body through API */". While searching I came across some articles which I didn’t understand.

Is it possible to configure the check in the director with the parameter certstore?

I usually download that:
https://raw.githubusercontent.com/Icinga/icinga-powershell-plugins/master/config/director/Invoke-IcingaCheckCertificate.json

and import it via director baskets.
I tried it today and it works with icinga director 1.10.2


Ok thanks I have the director 1.9.1. I try it with the newer version.

The newer version will only change the message, but the “function body” will still not be visible inside the Director.
See here: Feature Request / Readability Improvement · Issue #2557 · Icinga/icingaweb2-module-director · GitHub

You can still use everything that you have defined there, like variables and so on. It’s just a displaying issue.

If you import the basket into the Director like @moreamazingnick said, the whole DSL code willbe visible.

This issue only applies when importing commands into the Director that where configured in the configuration files.

1 Like