NCPA Active System API - Unable to find meaningful checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

NCPA Active System API - Unable to find meaningful checks

Post by onegative »

G 'Day Nagios Support,

I suspect a coding problem with regard to NCPA Active checks calling the API against the System. Please observe the following calls, results and ncpa_listener.log

Note the "for i" loop

Code: Select all

$ for i in node uptime system machine version time release timezone processor agent_version
> do
> /usr/local/nagios/libexec/check_ncpa.py -H 128.208.215.20 -P 3181 -t myTokenName -M "system/${i}" -v
> done
Note the results for each call

Code: Select all

Connecting to: https://128.208.215.20:3181/api/system/node/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Node was ['dcom-nagiosxi-p1.mcis.washington.edu']"
}
OK: Node was ['dcom-nagiosxi-p1.mcis.washington.edu']
Connecting to: https://128.208.215.20:3181/api/system/uptime/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Uptime was 409 days 18 hours 35 minutes 45 seconds | 'uptime'=35404545.00s;;;"
}
OK: Uptime was 409 days 18 hours 35 minutes 45 seconds | 'uptime'=35404545.00s;;;
Connecting to: https://128.208.215.20:3181/api/system/system/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: System was ['Linux']"
}
OK: System was ['Linux']
Connecting to: https://128.208.215.20:3181/api/system/machine/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Machine was ['x86_64']"
}
OK: Machine was ['x86_64']
Connecting to: https://128.208.215.20:3181/api/system/version/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Version was ['#1 SMP Thu Aug 3 08:15:31 EDT 2017']"
}
OK: Version was ['#1 SMP Thu Aug 3 08:15:31 EDT 2017']
Connecting to: https://128.208.215.20:3181/api/system/time/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Time was 1540567799.24 | 'time'=1540567799.24;;;"
}
OK: Time was 1540567799.24 | 'time'=1540567799.24;;;
Connecting to: https://128.208.215.20:3181/api/system/release/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Release was ['3.10.0-693.1.1.el7.x86_64']"
}
OK: Release was ['3.10.0-693.1.1.el7.x86_64']
Connecting to: https://128.208.215.20:3181/api/system/timezone/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Timezone was ('PST', 'PDT')"
}
OK: Timezone was ('PST', 'PDT')
Connecting to: https://128.208.215.20:3181/api/system/processor/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Processor was ['x86_64']"
}
OK: Processor was ['x86_64']
Connecting to: https://128.208.215.20:3181/api/system/agent_version/?token=myTokenName&check=1
File returned contained:
{
    "returncode": 0,
    "stdout": "OK: Agent_version was ['2.1.5']"
}
OK: Agent_version was ['2.1.5']
Note the /usr/local/ncpa/var/log/ncpa_listener.log

Code: Select all

2018-10-26 08:29:58,340 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:58,346 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:58] "GET /api/system/node/?token=myTokenName&check=1 HTTP/1.1" 200 235 0.012732
2018-10-26 08:29:58,528 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:58] "GET /api/system/uptime/?token=myTokenName&check=1 HTTP/1.1" 200 264 0.018365
2018-10-26 08:29:58,706 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:58,713 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:58] "GET /api/system/system/?token=myTokenName&check=1 HTTP/1.1" 200 206 0.016014
2018-10-26 08:29:58,883 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:58,889 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:58] "GET /api/system/machine/?token=myTokenName&check=1 HTTP/1.1" 200 208 0.011424
2018-10-26 08:29:59,059 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:59,065 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:59] "GET /api/system/version/?token=myTokenName&check=1 HTTP/1.1" 200 236 0.011403
2018-10-26 08:29:59,242 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:59] "GET /api/system/time/?token=myTokenName&check=1 HTTP/1.1" 200 234 0.013347
2018-10-26 08:29:59,406 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:59,412 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:59] "GET /api/system/release/?token=myTokenName&check=1 HTTP/1.1" 200 227 0.009685
2018-10-26 08:29:59,582 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:59,588 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:59] "GET /api/system/timezone/?token=myTokenName&check=1 HTTP/1.1" 200 213 0.011794
2018-10-26 08:29:59,762 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:59,773 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:59] "GET /api/system/processor/?token=myTokenName&check=1 HTTP/1.1" 200 210 0.016912
2018-10-26 08:29:59,955 22701 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:29:59,961 22701 INFO 172.16.97.10 - - [2018-10-26 08:29:59] "GET /api/system/agent_version/?token=myTokenName&check=1 HTTP/1.1" 200 213 0.015778
So I thought...yes the check_ncpa.py by default will set the query argument to "check=1" and after reviewing the script it does indeed set that query argument as such.
So my assumption here is that we should therefore pass additional switch to modify that query argument as described in the documentation so for example I modify accordingly and pass the following command.

Code: Select all

$ /usr/local/nagios/libexec/check_ncpa.py -H 128.208.215.20 -P 3181 -t myTokenName -M 'system/agent_version' -v -q "check=0"
That did indeed pass the query argument but it did not replace it as expected...it merely added the query argument so it ends up looking as follows.

Code: Select all

2018-10-26 08:53:01,578 3343 INFO Did not receive normal values. Unable to find meaningful check.
2018-10-26 08:53:01,582 3343 INFO 172.16.97.10 - - [2018-10-26 08:53:01] "GET /api/system/agent_version/?token=myTokenName&check=1&check=0 HTTP/1.1" 200 234 0.008094
So that seems to indicate that I cannot override the default query argument "check=1" which is why I believe we are seeing the Did not receive normal values. Unable to find meaningful check....but that does not appear to be the case because even if I go and edit the check_ncpa.py and modify the default "check=1" to "check=0" I still see the message.

So what does all of this mean? Not sure but I can see from my testing the the uptime and time API nodes do not send that message.

Maybe this is all insignificant in terms of the actual values being return but it still shows some type of coding issue unless this message is merely indicating that there is no way of using a threshold against it?

I guess you guys probably hate seeing my topics but I am really trying to understand some of the different aspects of the NCPA and how it operates...much of the documentation lacks specifics and this helps me and I hope others understand the quirks of its operation.

Please let me know what you think and as always many thanks for your help,
Danny
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA Active System API - Unable to find meaningful check

Post by lmiltchev »

I can confirm that I am seeing the same messages in my ncpa_listener.log. They don't seem to be causing any issues as far as I can tell. Nevertheless, I forwarded the info to our developers. Thank you for reporting this issue on the forum! You could also post it on GitHub if you wish:

https://github.com/NagiosEnterprises/ncpa/issues
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked