Invalid performance data: u'All'

CMK version:1.6.0p6 RAW
OS version:CentOS 8

Error message:Invalid performance data: u’All’.

**Output of “cmk --debug -vvn hostname”: Certificates UNKN - Invalid performance data: u’All’. Output is: personal Certificates are valid! Excluded Certificates from monitoring are: SerialNumber=64000025CA119E5E74678A3FF50000000025CA, SerialNumber=6DA6C02F45A2668842768C79B637D8DF, SerialNumber=62A2F0D411973B914F94130C28EB6096, SerialNumber=29D667D8E4B344904A13CBB29C54EF0D, SerialNumber=C2BB1729E20C0FBA4B5E75408F75AE98,(?)
**

Hello everyones.
On the beginning I would like to apologize if I reproduced already discussed topic - similar one is here:

However I still do not understand this issue. On some of the Windows systems where I populated my own local plugin for monitoring PKI Certificates validity this is working fine. And today i just figure out that on few another examples this plugin is returning Unknown state because of the output mentioned abowe.
I have no idea what I have done wrong if this plugin is at same version on each other devices and there is no troubles with it there. (Same Windows OS same cmk Agent etc)

Could someone help my with that? Our customer is pushing hard for solution. Thank you very much for any help

PS. if I have to share the plugin here just let me know.
Best Regards
Adam

It looks like you are missing a dash - at the third place of the local check output line.

Hi Robert,
Thank you for your answer.

Missing dash? Sorry but I thought that output format is “exitcode” “serviceName” “description”. The most strange thing is that if check will go to Critical or Warning it is working good. Only when check will back to status OK I observe that issue.

Here is the part of the code with conditions definition and output printing:

######################################################################
#Sub loop for check criteria OK/Warning/Critical/UNKNOWN and feed output variables#
######################################################################
if ($nRemainDays -lt 0)
{
$strCritical = $strCritical + $objCertificate.SubjectName.Name.ToString() + " EXPIRED! " + $objCertificate.NotAfter.ToString() + " "
$bReturnCritical = $TRUE

} Elseif ( $nRemainDays -lt $nCritical)
{
$strCritical = $strCritical + $objCertificate.SubjectName.Name.ToString() + " WILL EXPIRE: " + $objCertificate.NotAfter.ToString() + " "
$bReturnCritical = $TRUE

} Elseif ( $nRemainDays -lt $nWarning)
{
$strWarning = $strWarning + $objCertificate.SubjectName.Name.ToString() + " WILL EXPIRE: " + $objCertificate.NotAfter.ToString() + " "
$bReturnWarning = $TRUE

} Elseif ($nRemainDays -gt $nWarning -or $nRemainDays -gt $nCritical)
{
$strOK = $strOK
$bReturnOK = $TRUE
} Else
{
$strUnknown = $strUnknown
$returnStateUnknown = $TRUE
}

##################################################################
#Print loop ServiceName, ReturnCode and Description output in check_mk format#
##################################################################

if ($bReturnCritical)
{
write-host “2” “Certificates” ($strCritical + $strWarning)
exit
}
elseif ($bReturnWarning)
{
write-host “1” “Certificates” $strWarning
exit
}
elseif ($bReturnOK)
{
write-host “0” “Certificates” “All Certificates are valid!” $excludedCRT
exit
}
else
{
write-host “3” “Certificates” $strUnknown
exit
}
}

Like I said, check works fine if condition is different than OK. I tried a few options like using " or ', put output to variables and operate only on variables like for example:

write-host $ReturnCode $serviceName $strOK

but without success. It’s strange because I have put dash in to the string and seems that cmk is taking first "word from the description field and than printing the output like here:

No, please read Local checks.

The line is “status name metrics output”.

1 Like

Hi Robert,
Well. That’s explain everything. Of course you had right. Once again thank you very much for your help and time. Seems I have to learn how to read documentation with better understanding :slight_smile:
I have rewrited my output to:

write-host 0 “Certificates” - $strOK $excludedCRT

And after that check looks good:

Topic can be closed. Once again, bigt thank you.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.