Performance data of check_nscp_api are not registered in IcingaWeb2

Good morning everybody,

I am currently trying to get an OS check running on a windows agent using the check_wmi plugin of th nscp client and check_nscp_api. The executed command on the agent looks as follows:

'C:\Program Files\ICINGA2\/sbin/check_nscp_api' '--password' 'password' '-H' 'localhost' '-a' 'query=Select Version,Caption from win32_OperatingSystem' '-a' 'warn=Version not like '\''10.0'\''' '-a' 'crit=Version not like '\''10'\''' '-q' 'check_wmi'
and generates the following output when run locally via Powershell:
check_wmi Microsoft Windows Server 2016 Standard, 10.0.14393 | 'Version'=10014393;10;10

As you can see, there are performance data embedded into the output string, but for some reason they don’t show up in Icingaweb2 for the corresponding services.

Is there a known way to troubleshoot missing performance data? When googling I only came across missing performance data in databases due to wrong configuration or malformed performance data in the output string, but this is not the case here.


Digging this up as I stumbled across this yesterday.
I was implementing a cpu check and didn’t get any perf data in Icinga Web 2 with the following check:

 'C:\Program Files\ICINGA2\/sbin/check_nscp_api' '--password' 'abc' '-H' 'localhost' '-a' 'show-all' '-a' 'warning='\''load>40'\''' '-a' 'critical='\''load>30'\''' '-q' 'check_cpu'

Even though the same check returns perf data when run on the server manually:

./check_nscp_api --password abc -H localhost -q  check_cpu -a show-all -a warning=load>40 -a critical=load>60
check_cpu OK: 5m: 14%, 1m: 16%, 5s: 26% | 'total 5m'=14%;40;60 'total 1m'=16%;40;60 'total 5s'=26%;40;60

I have just now switched the check to a simple

 'C:\Program Files\ICINGA2\/sbin/check_nscp_api' '--password' 'abc' '-H' 'localhost' '-q' 'check_cpu'

without any arguments, which then uses the commands default. This then has the perf data also shown in Icinga Web 2.

So I assume that check_nscp_api seems to somehow override the default completely when specififying args in the check command. I will test if adding a perf-syntax=${core} ${time} to the check command yields the same result and report back.

Adding the $ escape argument for the perf-syntax does not help either:

still no perfdata.

The graph shows the following:
left side with the three lines:
using just check_cpu in nscp_api_query. No values in nscp_api_arguments

middle, red line:
added perf-syntax=${core} ${time} to nscp_api_arguments. This resulted in the perdata to be displayed as ${time} as label for all values.

right side, no line:
added the correctly $-sign escaped string perf-syntax=$${core} $${time} to nscp_api_arguments, as well as the warningand critical arguments.
This results in no perfdata at all.

Last try:
only added the correctly $-sign escaped string perf-syntax=$${core} $${time} to nscp_api_arguments and removed the warn and crit stuff.

This works, but now I can’t set thresholds…

really last try:

changed then args for warn and crit to warning= load > 80 and critical= load > 90 and that did the trick.
Seems like the single quotes ' surrounding the warning and critical filter where the problem.

Long story short:

Don’t use single quotes in the nscp_api_arguments field.