Page 1 of 2

More NCPA help

Posted: Fri Mar 14, 2014 9:56 am
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.

Re: More NCPA help

Posted: Fri Mar 14, 2014 10:11 am
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...

Re: More NCPA help

Posted: Fri Mar 14, 2014 10:14 am
by BanditBBS
NCPA is 1.4 and check_ncpa.py I grabbed from the exchange which is 1.0.

Re: More NCPA help

Posted: Fri Mar 14, 2014 11:20 am
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

Re: More NCPA help

Posted: Fri Mar 14, 2014 11:24 am
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.

Re: More NCPA help

Posted: Fri Mar 14, 2014 1:18 pm
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?

Re: More NCPA help

Posted: Fri Mar 14, 2014 4:29 pm
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.

Re: More NCPA help

Posted: Wed Mar 19, 2014 12:40 pm
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

Re: More NCPA help

Posted: Wed Mar 19, 2014 1:21 pm
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

Re: More NCPA help

Posted: Wed Mar 19, 2014 1:29 pm
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