Page 1 of 1

NCPA monitoring service name with spaces - help

Posted: Fri Feb 16, 2018 9:32 am
by browners80
Hello,

I am able to monitor the state of services with no spaces in thier name ie 'Netloggon'. Using the same command and entering a service name with spaces 'File Zilla' or 'Plug and Play' fails.

Example of same command working:

Code: Select all

./check_ncpa.py -H 10.0.0.100 -t 'MyToken' -P 5693 -M 'services' -q 'service=Netlogon,status=running'

File returned contained:
{
    "returncode":  0,
    "stdout":  "OK:  Netlogon is running"
}
OK: Netlogon is running
I have tried the following tests using various services with spaces:

Code: Select all

./check_ncpa.py -H 10.0.0.100 -t 'MyToken' -P 5693 -M 'service/FileZilla Server FTP server/running'

./check_ncpa.py -H 10.0.0.100 -t 'MyToken' -P 5693 -M 'services' -q 'service=FileZilla Server FTP Server,status=running'
Both get a return of:
File returned contained:

Code: Select all

{
       "returncode": 3,
       "stdout":   "UNKNOWN:  No services selected with 'service' value given"
}
UNKNOWN:  No services selected with 'service' value given
Have I got the syntax wrong or missed something obvious ?

Re: NCPA monitoring service name with spaces - help

Posted: Fri Feb 16, 2018 10:08 am
by kyang
The bottom one looks good.

Code: Select all

./check_ncpa.py -H 10.0.0.100 -t 'MyToken' -P 5693 -M 'services' -q 'service=FileZilla Server FTP Server,status=running'
This is what I have.

Code: Select all

[root@localhost libexec]# ./check_ncpa.py -H 192.168.3.242 -t 'mytoken1' -P 5693 -M 'services' -q 'service=Spooler,status=running'
OK: Spooler is running
Are you using the NCPA GUI to help you with active checks? The GUI can create it for you.

Re: NCPA monitoring service name with spaces - help

Posted: Fri Feb 16, 2018 12:25 pm
by browners80
I have just finished updating to the latest release to be sure there is no bugs involved. I see you are also successfully using a service with no spaces. Please as a test use the same command and try say 'Plug and Play'.

Let me know if it also fails for you.

Re: NCPA monitoring service name with spaces - help

Posted: Fri Feb 16, 2018 1:20 pm
by kyang
Do you actually have a service in windows for that?

I don't have one so I get the same error as you.
Capture.PNG
No services under this name.
cap2.PNG
This is what it should look like when I click "Reload"

Re: NCPA monitoring service name with spaces - help

Posted: Mon Feb 19, 2018 4:32 am
by browners80
I used the API viewer and noticed the 'View alternate Format' button. This gave me the exact command output required....

I wish I had known about this sooner. The correct command out it gave was:

Code: Select all

./check_ncpa.py -H 10.0.0.100 -t 'MyToken' -M 'services' -q 'service=FileZilla Server,status=running'
Good call on using the API browser. This will make future commands much easier to deal with.

Re: NCPA monitoring service name with spaces - help

Posted: Mon Feb 19, 2018 11:37 am
by kyang
Glad you were able to find out the correct name.

Yes, the GUI is definitely a great way to help you define the correct checks.

Did you have any more questions or are we okay to lock this up?