Page 1 of 1

Migrating check_xi_service_nsclient to check_xi_ncpa

Posted: Mon Sep 20, 2021 7:38 am
by Aldo Lanfranconi
Hello, I have a Nagios XI version 5.4.9
I am Migrating to Nagios XI version 5.8.6

I used the NSclient on remote hosts, now with the new server I am using NCPA client.

I did have a few windows server hosts on where I check multiple service state together, like this:

Code: Select all

check_xi_service_nsclient!token!SERVICESTATE!-l 'ServiceName1','ServiceName2' -d SHOWALL!!!!!

but now, with the command check_xi_ncpa I can´t figureout how to do it

Code: Select all

check_xi_ncpa!-t 'token' -P 5693  -M 'services' -q 'service=ServiceName1,status=running'
how do I check multiple windows service state under 1 reference name?

Re: Migrating check_xi_service_nsclient to check_xi_ncpa

Posted: Mon Sep 20, 2021 1:05 pm
by benjaminsmith
Hi,

You'll find an example command on the page below

https://support.nagios.com/kb/article/s ... e_services

For example:

Code: Select all

/check_ncpa.py -H 192.168.254.113 -t welcome -M services -q service=Spooler,service=EventLog,status=running,status=stopped
Let us know if that works. If not please post the full check command and output to the thread so we can help troubleshoot. Thanks, Benjamin

Re: Migrating check_xi_service_nsclient to check_xi_ncpa

Posted: Thu Sep 23, 2021 8:08 am
by Aldo Lanfranconi
Hi, thanks for your response.

I have a Server that I want to monitor 2 grouped MSSQL services on.
I did added the server using the wizard and I just put a SQL service, now I want to modify that check so that it checks the status of two SQL services:

If I edit the SQL service check command the wizard configured it like this:

Code: Select all

-t 'token' -P 5693  -M 'services' -q 'service=MSSQL$$InstanceName,status=running'
so, looking at the documentation there are a few differences, on my command some parte are with ' ', and the word after -M is services instead service

I can't get it to work, below are the tests I did.


Added the new servicename to the wizard configured command

Code: Select all

-t 'token' -P 5693  -M 'services' -q 'service=MSSQL$$InstanceName,SQLAgent$InstanceName,status=running'
UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.
remove quotation marks

Code: Select all

-t token -P 5693  -M services -q service=MSSQL$$InstanceName,SQLAgent$InstanceName,status=running
UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.
remove added new service

Code: Select all

-t token -P 5693  -M services -q service=MSSQL$$InstanceName,status=running
UNKNOWN: No services found for service names: MSSQL
added quotation marks arround servicename

Code: Select all

-t token -P 5693  -M services -q service='MSSQL$$InstanceName',status=running
OK: MSSQL$InstanceName is running
added the new servicename

Code: Select all

-t token -P 5693  -M services -q service='MSSQL$$InstanceName,SQLAgent$InstanceName',status=running
UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.
added the new servicename with split quotation marks

Code: Select all

-t token -P 5693  -M services -q service='MSSQL$$InstanceName','SQLAgent$InstanceName',status=running
UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.
remove the s to the command -M services (a per documentation)

Code: Select all

-t token -P 5693  -M service -q service='MSSQL$$InstanceName',status=running
UNKNOWN: The node (service) requested does not exist. You may be trying to access the 'services' node.
I don´t know what else to do.

Re: Migrating check_xi_service_nsclient to check_xi_ncpa

Posted: Thu Sep 23, 2021 2:41 pm
by Aldo Lanfranconi
OK, got it

This command WORKS

Code: Select all

-t token -P 5693  -M services -q service='servicename1',service='servicename2',status=running
Thanks a lot for your help!

Re: Migrating check_xi_service_nsclient to check_xi_ncpa

Posted: Thu Sep 23, 2021 2:45 pm
by benjaminsmith
Hi @Aldo Lanfranconi,

Your welcome and glad that's working!

We'll close this out but feel free to open another if you have any new questions.

--Benjamin