False escaping in the nscp-checks' names

Hi all,

longtime reader, new member.

I just realised that there is a false escape in the names of my nscp-* checks’ names. I don’t know where or when these come from.

2019-11-28 11_30_47-Icinga Web
You see the extra escapes? \nscp-.exe in the Director’s external commands list.

2019-11-28 11_31_14-Icinga Web
And here the command definition itself, where the line ‘command = [ “\nscp.exe”, “client” ]’ is escaped.

Any ideas why I have these and how to get rid of them?

Icinga 2.11.2, RHEL7, Director 1.7.1.


In case you’re wondering what consequences it has: yes. :slight_smile:

That’s the funny part, since I have 6 Windows systems at the moment and 5 of them works just fine:

Plugin Output

OK: ??\X:\pagefile.sys 0B (2.375GB), total 0B (2.375GB)

The sixth one in contrast doesn’t find the file scp.exe since the double escapes actually do escape the letter “n”:

Plugin Output

Command scp.exe client --log critical --module CheckSystem -b -q check_pagefile failed to execute

The file /usr/share/icinga2/include/command-nscp-local.conf has the line

object CheckCommand "nscp-local" {
        command = [ NscpPath + "\\nscp.exe", "client" ]

Since that’s the default content of this file (see github) the question is rather why the Director interprets the command this way.

Okay, I got it.

This was a server I couldn’t install NSCP on, because I got a notification from the MSI installer that the system needs a reboot. Since this is an important server and I had no downtime, I skipped the installation due to not having any nscp check back then anyway.

Today I finally managed to install NSCP (reboot didn’t help, but it turned out one can just choose “yes” and it will be installed without reboot nevertheless) but didn’t restart the Icinga service afterwards.

So in a nutshell: if NSCP is not installed, the Icinga 2 service doesn’t know the variable $NscpPath, and \nscp.exe doesn’t get appended to the path but the double “” symbols escape the “n” and scp.exe will be used.

After restarting the Icinga 2 service the check went OK/green since the whole path (including NscpPath) will be used and the escape is applied correctly.

Sorry for the confusion, TIL something again :slight_smile: