More NCPA help

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

More NCPA help

Post by BanditBBS »

testing NCPA more here.

1.)I grabbed check_ncpa.py and attempted to do this:

Code: Select all

[clarkj@rn000002 libexec]$ ./check_ncpa.py -H wdcae-pinf05p -t thisisatest -M cpu --list
Usage: check_ncpa.py [options]

check_ncpa.py: error: no such option: --list
yet, in the documents it shows:
./check_ncpa.py -H ncpaserver -t brody -M cpu --list
Will return a tree representing all of the values you can monitor via NCPA under the cpu tree. To look at everything you could possibly monitor, simply omit the -M flag and its argument.
2.) My end goal here in this testing phase it to passively send drive checks back to nagios. Hopefully with different thresholds possible per drive and also automatically picking up new drives added to systems

3.) in the API, physical is miss-spelled phyical.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: More NCPA help

Post by lmiltchev »

What is the version of NCPA that you are using? It seems this works for me...

Code: Select all

[root@testbox libexec]# ./check_ncpa.py -H x.x.x.x -t mytoken -M cpu --list
cpu :
    count : 8
    idle : [[1019830.25, 1075268.375, 978552.9375, 1089140.75, 1011767.0625, 1082121.0, 984572.625, 1077651.5], u'ms']
    percent : lazy
    system : [[61082.5, 17942.75, 90000.9375, 7501.875, 56677.9375, 11611.625, 62382.0625, 13858.75], u'ms']
    user : [[18543.58984375, 6244.8916015625, 30901.89453125, 2813.025634765625, 31010.61328125, 5722.81884765625, 52500.6875, 7944.97509765625], u'ms']
Do you have any errors in the "ncpa_listener.log"?

Nice catch on the "phyical"! :) We will need to fix this...
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: More NCPA help

Post by BanditBBS »

NCPA is 1.4 and check_ncpa.py I grabbed from the exchange which is 1.0.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: More NCPA help

Post by lmiltchev »

Do you have any errors in the "ncpa_listener.log"?

Can you see the metrics in the web interface?

Code: Select all

https://<ip address>:5693/api/cpu
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: More NCPA help

Post by BanditBBS »

No errors

yes I can see the full api

The problem seems to be with check_ncpa.py as it says list isn't a valid option.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: More NCPA help

Post by BanditBBS »

I d/l this version http://exchange.nagios.org/directory/Pl ... pa/details which seems to be rather old now that I looked at the code.

This version https://github.com/NagiosEnterprises/nc ... ck_ncpa.py seems much newer and has the list option.

Why is the exchange not updated and why is the version on exchange labeled 1.0 and the github one labeled 0.1 yet the github is better.


Which should I be using, the github or even a different version?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: More NCPA help

Post by lmiltchev »

Just talked to Nick. The GitHub's version is newer. I updated the links. Let us know if the GitHub's version works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: More NCPA help

Post by BanditBBS »

lmiltchev wrote:Just talked to Nick. The GitHub's version is newer. I updated the links. Let us know if the GitHub's version works for you.

What are the requirements for running the latest version, I get this when running it:

Code: Select all

[clarkj@rn000002 libexec]$ ./check_ncpa.py -H wdcae-pinf05p -t thisisatest -M cpu --list
Traceback (most recent call last):
  File "./check_ncpa.py", line 13, in <module>
    import urllib.request, urllib.parse, urllib.error
ImportError: No module named request
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: More NCPA help

Post by sreinhardt »

check_ncpa is intended to be entirely self contained, provided python 3 on linux systems, with the notable exception of python-dateutil. Do you know if your default python installation is set to 2 or 3? You might also try it like:

Code: Select all

python3 check_ncpa.py -H wdcae-pinf05p -t thisisatest -M cpu --list
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: More NCPA help

Post by BanditBBS »

There's my issue, python2 is installed, not 3. Now I have to think long and hard if upgrading will break the few python scripts I have....hmmm
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked