New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.3.131 and check_service - services with brackets are not correctly detected #131

Closed
box293 opened this Issue Mar 19, 2015 · 16 comments

Comments

Projects
None yet
4 participants
@box293

box293 commented Mar 19, 2015

I have a service called GxEvMgrC(Instance001)

It is stopped.

Command:
check_nrpe -H win2008r2-01 -c check_service -a 'service=GxEvMgrC(Instance001)'

Output:
OK: All 1 service(s) are ok.|

This is not correctly detecting that the service is stopped.

In the legacy check, this works:

Command:
check_nrpe -H win2008r2-01 -c CheckServiceState -a ShowAll GxEvMgrC\(Instance001\)

Output:
CRITICAL: GxEvMgrC(Instance001): stopped|'GxEvMgrC(Instance001)'=1;0;4

However it does not work in the new check_service:

Command:
check_nrpe -H win2008r2-01 -c check_service -a 'service=GxEvMgrC\(Instance001\)'

Output:
Failed to open service: GxEvMgrC\(Instance001\)|
@Grejeru

This comment has been minimized.

Show comment
Hide comment
@Grejeru

Grejeru Mar 19, 2015

Try,

check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC(Instance001)”

I’ve had similar problem checking for MSSQL$EXPRESS service

On 19 Mar 2015 at 01:18:49, Troy Lea (notifications@github.com) wrote:

I have a service called GxEvMgrC(Instance001)

It is stopped.

Command:
check_nrpe -H win2008r2-01 -c check_service -a 'service=GxEvMgrC(Instance001)'  

Output:
OK: All 1 service(s) are ok.|

This is not correctly detecting that the service is stopped.

In the legacy check, this works:

Command:
check_nrpe -H win2008r2-01 -c CheckServiceState -a ShowAll GxEvMgrC\(Instance001\)  

Output:
CRITICAL: GxEvMgrC(Instance001): stopped|'GxEvMgrC(Instance001)'=1;0;4

However it does not work in the new check_service:

Command:
check_nrpe -H win2008r2-01 -c check_service -a 'service=GxEvMgrC\(Instance001\)'  

Output:
Failed to open service: GxEvMgrC\(Instance001\)|

Reply to this email directly or view it on GitHub:
#131

Grejeru commented Mar 19, 2015

Try,

check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC(Instance001)”

I’ve had similar problem checking for MSSQL$EXPRESS service

On 19 Mar 2015 at 01:18:49, Troy Lea (notifications@github.com) wrote:

I have a service called GxEvMgrC(Instance001)

It is stopped.

Command:
check_nrpe -H win2008r2-01 -c check_service -a 'service=GxEvMgrC(Instance001)'  

Output:
OK: All 1 service(s) are ok.|

This is not correctly detecting that the service is stopped.

In the legacy check, this works:

Command:
check_nrpe -H win2008r2-01 -c CheckServiceState -a ShowAll GxEvMgrC\(Instance001\)  

Output:
CRITICAL: GxEvMgrC(Instance001): stopped|'GxEvMgrC(Instance001)'=1;0;4

However it does not work in the new check_service:

Command:
check_nrpe -H win2008r2-01 -c check_service -a 'service=GxEvMgrC\(Instance001\)'  

Output:
Failed to open service: GxEvMgrC\(Instance001\)|

Reply to this email directly or view it on GitHub:
#131

@box293

This comment has been minimized.

Show comment
Hide comment
@box293

box293 Mar 19, 2015

Thanks for the suggestion but it does not work for either:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC\(Instance001\)"

Output:
Failed to open service: GxEvMgrC\(Instance001\)|

OR

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC(Instance001)"

Output:
OK: All 1 service(s) are ok.|

This is incorrect as the service is stopped.

Same with $ sign service, it is stopped:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher\$UWCX01"

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$UWCX01"

Output:
Failed to open service: MSSQLFDLauncher|

box293 commented Mar 19, 2015

Thanks for the suggestion but it does not work for either:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC\(Instance001\)"

Output:
Failed to open service: GxEvMgrC\(Instance001\)|

OR

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC(Instance001)"

Output:
OK: All 1 service(s) are ok.|

This is incorrect as the service is stopped.

Same with $ sign service, it is stopped:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher\$UWCX01"

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$UWCX01"

Output:
Failed to open service: MSSQLFDLauncher|
@Grejeru

This comment has been minimized.

Show comment
Hide comment
@Grejeru

Grejeru Mar 19, 2015

Hm,

I have:
$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a ShowAll $ARG1$

and ARG1 is:
CheckServiceState!MSSQL"$$"SQLEXPRESS SQLWriter

So maybe similar?
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC”(“Instance001”)” or with double (( and ))?

On 19 Mar 2015 at 01:30:22, Troy Lea (notifications@github.com) wrote:

Thanks for the suggestion but it does not work for either:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC\(Instance001\)"  

Output:
Failed to open service: GxEvMgrC\(Instance001\)|

OR

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC(Instance001)"  

Output:
OK: All 1 service(s) are ok.|

This is incorrect as the service is stopped.

Same with $ sign service, it is stopped:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher\$UWCX01"  

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$UWCX01"  

Output:
Failed to open service: MSSQLFDLauncher|

Reply to this email directly or view it on GitHub:
#131 (comment)

Grejeru commented Mar 19, 2015

Hm,

I have:
$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a ShowAll $ARG1$

and ARG1 is:
CheckServiceState!MSSQL"$$"SQLEXPRESS SQLWriter

So maybe similar?
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC”(“Instance001”)” or with double (( and ))?

On 19 Mar 2015 at 01:30:22, Troy Lea (notifications@github.com) wrote:

Thanks for the suggestion but it does not work for either:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC\(Instance001\)"  

Output:
Failed to open service: GxEvMgrC\(Instance001\)|

OR

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC(Instance001)"  

Output:
OK: All 1 service(s) are ok.|

This is incorrect as the service is stopped.

Same with $ sign service, it is stopped:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher\$UWCX01"  

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$UWCX01"  

Output:
Failed to open service: MSSQLFDLauncher|

Reply to this email directly or view it on GitHub:
#131 (comment)

@box293

This comment has been minimized.

Show comment
Hide comment
@box293

box293 Mar 19, 2015

Double $$ doesn't work, turns it into 7109:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$$UWCX01"

Output:
Failed to open service: MSSQLFDLauncher7109UWCX01|

Double brackets don't work:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC((Instance001))"

Output:
Failed to open service: GxEvMgrC((Instance001))|

These are things that just need to be ironed out with the newer check_service command

box293 commented Mar 19, 2015

Double $$ doesn't work, turns it into 7109:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$$UWCX01"

Output:
Failed to open service: MSSQLFDLauncher7109UWCX01|

Double brackets don't work:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC((Instance001))"

Output:
Failed to open service: GxEvMgrC((Instance001))|

These are things that just need to be ironed out with the newer check_service command

@Grejeru

This comment has been minimized.

Show comment
Hide comment
@Grejeru

Grejeru Mar 19, 2015

Troy look that I didn't had all service in "" but only dollar signs.

Pozdrawiam / Kind Regards,

Sebastian Szary

Dnia 19 Mar 2015 o godz. 01:49 Troy Lea notifications@github.com
napisał(a):

Double $$ doesn't work, turns it into 7109:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$$UWCX01"

Output:
Failed to open service: MSSQLFDLauncher7109UWCX01|

Double brackets don't work:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC((Instance001))"

Output:
Failed to open service: GxEvMgrC((Instance001))|

These are things that just need to be ironed out with the newer
check_service command


Reply to this email directly or view it on GitHub
#131 (comment).

Grejeru commented Mar 19, 2015

Troy look that I didn't had all service in "" but only dollar signs.

Pozdrawiam / Kind Regards,

Sebastian Szary

Dnia 19 Mar 2015 o godz. 01:49 Troy Lea notifications@github.com
napisał(a):

Double $$ doesn't work, turns it into 7109:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="MSSQLFDLauncher$$UWCX01"

Output:
Failed to open service: MSSQLFDLauncher7109UWCX01|

Double brackets don't work:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service="GxEvMgrC((Instance001))"

Output:
Failed to open service: GxEvMgrC((Instance001))|

These are things that just need to be ironed out with the newer
check_service command


Reply to this email directly or view it on GitHub
#131 (comment).

@box293

This comment has been minimized.

Show comment
Hide comment
@box293

box293 Mar 19, 2015

Sorry I should have read that better. Still did not help, service is stopped in all these examples:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC"("Instance001")"

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC"(("Instance001"))"

Output:
Failed to open service: GxEvMgrC((Instance001))|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC'('Instance001')'

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC'(('Instance001'))'

Output:
Failed to open service: GxEvMgrC((Instance001))|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher'$'UWCX01

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher"$"UWCX01

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher'$$'UWCX01

Output:
Failed to open service: MSSQLFDLauncher$$UWCX01|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher"$$"UWCX01

Output:
Failed to open service: MSSQLFDLauncher7507UWCX01|

box293 commented Mar 19, 2015

Sorry I should have read that better. Still did not help, service is stopped in all these examples:

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC"("Instance001")"

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC"(("Instance001"))"

Output:
Failed to open service: GxEvMgrC((Instance001))|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC'('Instance001')'

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=GxEvMgrC'(('Instance001'))'

Output:
Failed to open service: GxEvMgrC((Instance001))|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher'$'UWCX01

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher"$"UWCX01

Output:
OK: All 1 service(s) are ok.|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher'$$'UWCX01

Output:
Failed to open service: MSSQLFDLauncher$$UWCX01|

Command:
check_nrpe -H win2008r2-01 -c check_service -a service=MSSQLFDLauncher"$$"UWCX01

Output:
Failed to open service: MSSQLFDLauncher7507UWCX01|
@Grejeru

This comment has been minimized.

Show comment
Hide comment
@Grejeru

Grejeru Mar 19, 2015

What command You have aliased as check_service? Is it CheckServiceState? Try switching to it maybe?

Grejeru commented Mar 19, 2015

What command You have aliased as check_service? Is it CheckServiceState? Try switching to it maybe?

@box293

This comment has been minimized.

Show comment
Hide comment
@box293

box293 Mar 20, 2015

check_service is not an alias, these are new commands that have been added with the 0.4.2.x and 0.4.3.x releases.

http://docs.nsclient.org/reference/windows/CheckSystem.html#check-service

They have new arguments that are different to the legacy check. I'm trying out these new checks and identifying bugs that need resolving.

CheckServiceState is the "legacy" check.

http://docs.nsclient.org/reference/windows/CheckSystem.html#checkservicestate

box293 commented Mar 20, 2015

check_service is not an alias, these are new commands that have been added with the 0.4.2.x and 0.4.3.x releases.

http://docs.nsclient.org/reference/windows/CheckSystem.html#check-service

They have new arguments that are different to the legacy check. I'm trying out these new checks and identifying bugs that need resolving.

CheckServiceState is the "legacy" check.

http://docs.nsclient.org/reference/windows/CheckSystem.html#checkservicestate

@mickem

This comment has been minimized.

Show comment
Hide comment
@mickem

mickem Mar 24, 2015

Owner

Just to clarify, nagios escapes $ so the double $$ is a nagios(TM) feature...

I can verify that it seems () are not working, I will look into it and report back when I know whats amiss...

Owner

mickem commented Mar 24, 2015

Just to clarify, nagios escapes $ so the double $$ is a nagios(TM) feature...

I can verify that it seems () are not working, I will look into it and report back when I know whats amiss...

@mickem mickem self-assigned this Mar 24, 2015

@mickem mickem added the bug label Mar 24, 2015

@mickem mickem added this to the 0.4.3 milestone Mar 24, 2015

@mickem

This comment has been minimized.

Show comment
Hide comment
@mickem

mickem Mar 24, 2015

Owner

Found it...

The problem is that the new version does not use the description only the service name (now know as key).

A work around is to use the followin:

check_service "filter=desc like 'NSClient++ (x86)'"

But I will add support for checking the direct name as well in the next build

Owner

mickem commented Mar 24, 2015

Found it...

The problem is that the new version does not use the description only the service name (now know as key).

A work around is to use the followin:

check_service "filter=desc like 'NSClient++ (x86)'"

But I will add support for checking the direct name as well in the next build

@mickem

This comment has been minimized.

Show comment
Hide comment
@mickem

mickem Mar 24, 2015

Owner

Will be fixed in next build

Owner

mickem commented Mar 24, 2015

Will be fixed in next build

@mickem mickem closed this Mar 24, 2015

@box293

This comment has been minimized.

Show comment
Hide comment
@box293

box293 May 8, 2015

When you say next build, do you mean 0.4.4 ?

box293 commented May 8, 2015

When you say next build, do you mean 0.4.4 ?

@mickem

This comment has been minimized.

Show comment
Hide comment
@mickem

mickem May 8, 2015

Owner

No next nightly build... Add this is old that would be in the newly released 0.4.3.143

Owner

mickem commented May 8, 2015

No next nightly build... Add this is old that would be in the newly released 0.4.3.143

@box293

This comment has been minimized.

Show comment
Hide comment
@box293

box293 May 11, 2015

I am still having the same problem.
I have installed 0.4.3.143 on a fresh system.

Command:
check_nrpe -H 10.25.254.142

Output:
I (0.4.3.143 2015-04-29) seem to be doing fine...

I have two services that are stopped, they both have special characters in their names:
GxEvMgrC(Instance001)
MSSQLFDLauncher$UWCX01
These are defined in the REG_SZ key DisplayName

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service='GxEvMgrC(Instance001)'

Output
OK: All 1 service(s) are ok.

That is an incorrect status because the service is stopped.

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service='GxEvMgrC\(Instance001\)'

Output:
Failed to open service GxEvMgrC\(Instance001\): 123: The filename, directory name, or volume label syntax is incorrect.

I though escaping the brackets would help but it generated a different error.

Trying the other service:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service=MSSQLFDLauncher$UWCX01

Output:
Failed to open service MSSQLFDLauncher: 1060: The specified service does not exist as an installed service.

So the $ sign didn't pass through. I'll try to escape it:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service=MSSQLFDLauncher\$UWCX01

Output:
OK: All 1 service(s) are ok.

That is an incorrect status because the service is stopped.

I'll try two $ signs:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service=MSSQLFDLauncher$$UWCX01

Output:
Failed to open service MSSQLFDLauncher6654UWCX01: 1060: The specified service does not exist as an installed service.

That didn't work, turned the two dollar signs into 6654.

I'll try enclosing the service name in quotes:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service='MSSQLFDLauncher$UWCX01'

Output:
OK: All 1 service(s) are ok.

That is an incorrect status because the service is stopped.

box293 commented May 11, 2015

I am still having the same problem.
I have installed 0.4.3.143 on a fresh system.

Command:
check_nrpe -H 10.25.254.142

Output:
I (0.4.3.143 2015-04-29) seem to be doing fine...

I have two services that are stopped, they both have special characters in their names:
GxEvMgrC(Instance001)
MSSQLFDLauncher$UWCX01
These are defined in the REG_SZ key DisplayName

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service='GxEvMgrC(Instance001)'

Output
OK: All 1 service(s) are ok.

That is an incorrect status because the service is stopped.

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service='GxEvMgrC\(Instance001\)'

Output:
Failed to open service GxEvMgrC\(Instance001\): 123: The filename, directory name, or volume label syntax is incorrect.

I though escaping the brackets would help but it generated a different error.

Trying the other service:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service=MSSQLFDLauncher$UWCX01

Output:
Failed to open service MSSQLFDLauncher: 1060: The specified service does not exist as an installed service.

So the $ sign didn't pass through. I'll try to escape it:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service=MSSQLFDLauncher\$UWCX01

Output:
OK: All 1 service(s) are ok.

That is an incorrect status because the service is stopped.

I'll try two $ signs:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service=MSSQLFDLauncher$$UWCX01

Output:
Failed to open service MSSQLFDLauncher6654UWCX01: 1060: The specified service does not exist as an installed service.

That didn't work, turned the two dollar signs into 6654.

I'll try enclosing the service name in quotes:

Command:
check_nrpe -H 10.25.254.142 -c check_service -a service='MSSQLFDLauncher$UWCX01'

Output:
OK: All 1 service(s) are ok.

That is an incorrect status because the service is stopped.

@bvi1998

This comment has been minimized.

Show comment
Hide comment
@bvi1998

bvi1998 May 31, 2016

Hi,
How was this resolved? I am trying the following which does not work:
/usr/lib64/nagios/plugins/check_nrpe -u -H x.x.x.x -c check_service -a service="filter=desc like 'BTSSvc$BizTalkFTPSend'"

Thanks!

bvi1998 commented May 31, 2016

Hi,
How was this resolved? I am trying the following which does not work:
/usr/lib64/nagios/plugins/check_nrpe -u -H x.x.x.x -c check_service -a service="filter=desc like 'BTSSvc$BizTalkFTPSend'"

Thanks!

@mickem

This comment has been minimized.

Show comment
Hide comment
@mickem

mickem Aug 22, 2016

Owner

If you run from nagios you need to escape the $ by using $$ so try the command from command line first to be sure it is not an escape issue

Owner

mickem commented Aug 22, 2016

If you run from nagios you need to escape the $ by using $$ so try the command from command line first to be sure it is not an escape issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment