Skip to main content

Hello All

I want to monitor separately different processes running as services in windows with centreon, those processes runs all with the same executable.

How can i acheive this?

 

Thank you

Hello

If they are running as services, you can monitor the services by their name, using the service template for windows services and tweaking the filters

It will depend on which method you use to monitor your widows


Hello,

I do monitor the executables with this command

/usr/lib/nagios/plugins/check_centreon_snmp_process_detailed 

I also have a nsclient++ on a specific serveur for specific cmd’s

 

Tx for you reply


ok, you would need nsclient for services, as snmp on windows for services is kind of bugged

you want to use either one of these service templates (depending on NRPEor Restapi for nsclient communication, both works the same )

 

you add a service on your host with this template, you need to add one for each services if you need individual monitoring

 

then you want to leave the default value of the macro of the service you created, but you need to change the one called “SERVICE”

 

 

replace the * by the short system name of your service

(you can get that from your services.msc console, double clic on the service, and you get the information “ServiceName” exemple here 

)


Thank you

I’ll take a look into this tomorrow morning, tx again, will get back to you


I don’t find thoses templates in my centreon version :x


Ha, they come with the plugin pack (connector) 

 

you need to have the free IT-100 or any business edition to get the connectors, if you are using open source and don’t have any packages, you wll need to recreate the command

 

here is the command line parameters you need, i have ommited the part where you put the path to the command and all the hostname and here what comes after the “-c” you should have if you are already running some custom CMD with nsclient :

-c check_service -a "filter=$_SERVICEFILTER$" "service=$_SERVICESERVICE$" "exclude=$_SERVICEEXCLUDE$" "ok=$_SERVICEOK$" "warning=$_SERVICEWARNING$" "critical=$_SERVICECRITICAL$" 'top-syntax=$_SERVICETOPSYNTAX$' 'detail-syntax=$_SERVICEDETAILSYNTAX$' $_SERVICEEXTRAOPTIONS$

if you create a command with that, and create a service template, you should get the same macro of my previous screenshot

(and you will need to input the default value manually on your template)


Thank you very much for this


Hello again, i still have a question 

Actually nsclient is only installed on one of the windows serveur from wich i query my nas like this

So like this i’ll query the service on the hostname where nsclient is installed , can’t i from this host query another server?

Or do i need to install nsclient on the target server mandatory?


I understand your problem, from nsclient natively no. this agent run locally with “system” privileges, and does not provides functions to check other windows server.

your examle with log is still running locally a check from nsclient that can see files (network or local makes no difference)

what you need is a custom command,

if you can code a bit of batch that query the service with “sc” (command in cmd) that can ask another server a service status

sc \\anotherserver query servicename

and then parse the output, and then make your batch (or program) exit the correct output for centreon (there is a guideline on formatting output for centreon on the doc (Plugins development guidelines | Centreon Documentation )

finally you add that batch/program to nsclient.ini to create a “command” that can be called with the “-c” option (like checkfile or check_service)

 

TL;DR it’s complicated, having the agent on the host is simpler.

 


but i can then install the nsclient on the host and use it directly right?

 


Yes


I’ll do it like that then

Thank you for your kind Help


Reply