NCPA monitoring service name with spaces - help

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
browners80
Posts: 6
Joined: Wed Nov 15, 2017 6:51 am

NCPA monitoring service name with spaces - help

Post 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 ?
kyang

Re: NCPA monitoring service name with spaces - help

Post 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.
browners80
Posts: 6
Joined: Wed Nov 15, 2017 6:51 am

Re: NCPA monitoring service name with spaces - help

Post 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.
kyang

Re: NCPA monitoring service name with spaces - help

Post 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"
You do not have the required permissions to view the files attached to this post.
browners80
Posts: 6
Joined: Wed Nov 15, 2017 6:51 am

Re: NCPA monitoring service name with spaces - help

Post 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.
kyang

Re: NCPA monitoring service name with spaces - help

Post 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?
Locked