check_winservice does not handle exception of services

7 posts / 0 new
Last post
cdab-jenz
Offline
Last seen: 7 years 9 months ago
Joined: 05.10.2011 - 16:53
check_winservice does not handle exception of services

 When I run this command on a Windows 7 PC, I get the following output:

 

C:\Program Files\ICW\bin>check_winservice --state !running --startmode auto --v

--v --service !MMCSS,!sppsvc

 

Service state(s): !running

Service start modes: auto

Service(s): !MMCSS, !sppsvc

WQL string generated: select * from Win32_Service Where (Name<>'MMCSS' Or Name<>

'sppsvc' ) And (StartMode='auto' ) And (State<>'running' )

Number of services selected: 3

Selected services: clr_optimization_v4.0.30319_32, sppsvc, MMCSS

 

The plugin wrongly selects the services excluded. Is this a bug or am I doing something wrong?

cdab-jenz
Offline
Last seen: 7 years 9 months ago
Joined: 05.10.2011 - 16:53
Wrong SQL

 I dont know how this plugin works, but should it not be like this:

select * from Win32_Service Where (Name<>'MMCSS' AND Name<> 'sppsvc' ) And (StartMode='auto' ) And (State<>'running' )

Doing a select with OR will likly return the other services...

itefix
Offline
Last seen: 1 hour 7 min ago
Joined: 01.05.2008 - 21:33
Thanks for your feedback. As

Thanks for your feedback. As you've pointed it out, there is a logical glitch. I am working on it. The new version will be able to group negated instances in an ANDed group before ORing.

MWhiteLSG
Offline
Last seen: 7 years 9 months ago
Joined: 10.10.2011 - 22:13
same problem

I wish to negate three services from a check. without that capability checking non-running automatic services is useless. Please let us know when updated version is available,and please add syntax example to wiki page to eliminate trial and error

itefix
Offline
Last seen: 1 hour 7 min ago
Joined: 01.05.2008 - 21:33
 An updated

 An updated check_winservice is now available from the download page. It handles multiple negated values in a proper manner now. I have also updated manpage with an example showing use of multiple negated values. If you run the plugin with two -v switches, you can get detailed information about how it will work.Hope it helps.

MWhiteLSG
Offline
Last seen: 7 years 9 months ago
Joined: 10.10.2011 - 22:13
same problem with event logs?

i seem to have a similar problem with negating multiple events. sometimes i use event codes like !1111 on terminal services, and sometimes certain servers have special events that are unimportant that I would like to exclude. whenever i need more than one type of negation or multiple of the same time I get unexpected results (more notifications instead of less)

cdab-jenz
Offline
Last seen: 7 years 9 months ago
Joined: 05.10.2011 - 16:53
After the fix it works fine

After the fix it works fine to exclude multiple services, thanks!

But I have found another issue, I can not exclude this service: SQLAgent$SQLEXPRESS, and I guess it has to do with the $ sign included in the name, as $ARG$ is used as parameters in nagios.

Could this be fixed aswell?