On several Windows servers, I’m receiving outputs where the error message is: “UNKNOWN - Cannot parse JSON response body”.
More strangely, when I query for “check_cpu”, sometime I get the correct output and sometime I get the “UNKNOWN” error message.
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_cpu
UNKNOWN - Cannot parse JSON response body '{"header":{"source_id":""},"payload":[{"command":"check_cpu","lines":[{"message":"OK: CPU load is ok.","perf":[{"alias":"total 5m","int_value":{"critical":90,"unit":"%","value":3,"warning":80}},{"alias":"total 1m","int_value":{"critical":90,"unit":"%","value":2,"warning":80}},{"alias":"total 5s","int_value":{"critical":90,"unit":"%","value":4,"warning":80}}]}],"result":"OK"}]}disk_', error: [json.exception.parse_error.101] parse error at line 1, column 380: syntax error while parsing value - invalid literal; last read: '"OK"}]}d'; expected end of input
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_cpu
UNKNOWN - Cannot parse JSON response body '{"header":{"source_id":""},"payload":[{"command":"check_cpu","lines":[{"message":"OK: CPU load is ok.","perf":[{"alias":"total 5m","int_value":{"critical":90,"unit":"%","value":3,"warning":80}},{"alias":"total 1m","int_value":{"critical":90,"unit":"%","value":3,"warning":80}},{"alias":"total 5s","int_value":{"critical":90,"unit":"%","value":4,"warning":80}}]}],"result":"OK"}]}D', error: [json.exception.parse_error.101] parse error at line 1, column 380: syntax error while parsing value - invalid literal; last read: '"OK"}]}D'; expected end of input
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_cpu
UNKNOWN - Cannot parse JSON response body '{"header":{"source_id":""},"payload":[{"command":"check_cpu","lines":[{"message":"OK: CPU load is ok.","perf":[{"alias":"total 5m","int_value":{"critical":90,"unit":"%","value":4,"warning":80}},{"alias":"total 1m","int_value":{"critical":90,"unit":"%","value":7,"warning":80}},{"alias":"total 5s","int_value":{"critical":90,"unit":"%","value":3,"warning":80}}]}],"result":"OK"}]}D', error: [json.exception.parse_error.101] parse error at line 1, column 380: syntax error while parsing value - invalid literal; last read: '"OK"}]}D'; expected end of input
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_cpu
check_cpu OK: CPU load is ok. | 'total 5m'=4%;80;90 'total 1m'=7%;80;90 'total 5s'=3%;80;90
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_cpu
check_cpu OK: CPU load is ok. | 'total 5m'=4%;80;90 'total 1m'=8%;80;90 'total 5s'=2%;80;90
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_cpu
check_cpu OK: CPU load is ok. | 'total 5m'=4%;80;90 'total 1m'=8%;80;90 'total 5s'=5%;80;90
Other queries, I consistently get the “UNKNOWN” error message. Examples:
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_pagesize
UNKNOWN - Cannot parse JSON response body '{"payload":[{"command":"check_pagesize","lines":[{"message":"Unknown command(s): check_pagesize"}],"result":"UNKNOWN"}]}total*1Ç≤h@MBfffz@!ÇÖÖÖü@19å@;', error: [json.exception.parse_error.101] parse error at line 1, column 122: syntax error while parsing value - invalid literal; last read: '"UNKNOWN"}]}to'; expected end of input
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_memory
UNKNOWN - Cannot parse JSON response body '{"header":{"source_id":""},"payload":[{"command":"check_memory","lines":[{"message":"OK: committed = 2.577GB, physical = 2.431GB","perf":[{"alias":"committed","float_value":{"critical":4.2183002466335893,"maximum":4.6870002746582031,"minimum":0.00000000000000000,"unit":"GB","value":2.5772323608398438,"warning":3.7496002195402980}},{"alias":"committed %","float_value":{"critical":90', error: [json.exception.parse_error.101] parse error at line 1, column 385: syntax error while parsing object - unexpected end of input; expected '}'
C:\Program Files\ICINGA2\sbin>check_nscp_api.exe --password icinga -P 8443 -H localhost -q check_drivesize
UNKNOWN - Cannot parse JSON response body '{"header":{"source_id":""},"payload":[{"command":"check_drivesize","lines":[{"message":"OK All 2 drive(s) are ok","perf":[{"alias":"C:\\ used","float_value":{"critical":53.515719222836196,"maximum":59.461910247802734,"minimum":0.00000000000000000,"unit":"GB","value":17.924423217773438,"warning":47.569528197869658}},{"alias":"C:\\ used %","float_value":{"critical":90.000000000000000', error: [json.exception.parse_error.101] parse error at line 1, column 385: syntax error while parsing object - unexpected end of input; expected '}'
System information
C:\Program Files\ICINGA2\sbin>icinga2.exe -V
icinga2.exe - The Icinga 2 network monitoring daemon (version: v2.11.0-rc1-1-g2b891fd1e)
Copyright (c) 2012-2019 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
System information:
Platform: Windows
Platform version: 8 (Server)
Kernel: Windows
Kernel version: 6.2
Architecture: x86_64
Build information:
Compiler: MSVC 19.16.27032.1
Build host: WINBUILD2
NSClient++ (x64) - Product version: 0.5.2039
nsclient.ini
; in flight - TODO
[/settings/default]
; Undocumented key
password = icinga
; Undocumented key
allowed hosts = 127.0.0.1
; in flight - TODO
[/modules]
; Undocumented key
CheckDisk = enabled
; Undocumented key
WEBServer = enabled
; Undocumented key
CheckSystem = enabled