mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
239 stars 94 forks source link

check separate service - is it possible #674

Closed kucharst closed 4 years ago

kucharst commented 4 years ago

Issue and Steps to Reproduce

Hello,

I would like to ask if there is a possibility to check a separate service? I'm mainly interested to check by my nagios core server the RDP service (Termservice) placed on windows terminal server. I can easily check all services with some exceptions:

_alias_service_ex = checkServiceState CheckAll "exclude=RemoteRegistry" "exclude=WbioSrvc" "exclude=gupdate" "exclude=BITS" "exclude=MapsBroker" "exclude=OneSyncSvc_284643e4e" "exclude=SCardSvr"
`_``

But have no idea how to check just one service, this command doesn't work for me at all:

_aliasservice checkServiceState "service=Termservice"



it just showing all services, not the one i'm interested in.

### Details

* NSClient++ version: 0.5.2.35
* OS and Version: Windows Server 2016 Standard
* Checking with: check_nrpe, check_nt, ...

Thanks for any help.
Regards
Tomek
mintsoft commented 4 years ago

@kucharst I think the command you want is like:

check_service service=Termservice

checkServiceState is deprecated and doesn't have the same syntax.

kucharst commented 4 years ago

Thanks @mintsoft,

Unfortunately it didn't worked :( It just shows status of all services, not the one i want to check. :( I tried with and without quotes, setting warn and crit, but no changes.

_./check_nrpe -H rds_windows_server -c check_service service=Termservice_ CRITICAL: RemoteRegistry=stopped (auto), WbioSrvc=stopped (auto), delayed (gupdate=stopped (delayed), MapsBroker=stopped (delayed))

mintsoft commented 4 years ago

@kucharst The service=Termservice is an argument to the command, so either -a service=Termservice or add it into the nsclient.ini as an alias. I can't remember the exact format for check_nrpe but it's something like that

kucharst commented 4 years ago

Thank you so much for help and patience :) it works with an alias :)

Have a nice week!