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


Hello again,

So 1st of all sorry for my lacks of skills.

 

So i did install nsclient on a windows machine, if i run this command i have this error, and i don’t really know what to do next

 

>root@centreon-central plugins]# ./check_nrpe -2 -H SERVER -c CheckService -a "filter=TEST" "service=*" "exclude=" "ok=state_is_ok()" "warning=none" "critical=not state_is_ok()" 'top-syntax=${problem_list}' 'detail-syntax=${name}=${state} (${start_type})' --arg="perf-config=none"

Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).

 

Any help would be greatly appreciated
 


Sorry about this but can i ask for a little help?

Thank you


hello, sorry I missed your previous question

if you copy pasted the command exactly, a screenshot would be nice from your ssh prompt

there are a lot of syntax issue linked to double quotes and single quotes, and the copy/paste in plain text

 

also can you try removing some filters like the “ok” “warning” “critical” or everything after “service=*” and see what work and what doesn’t, it should at least answer something if you cut the command after service=*


Thank you for your kind answer!

Here’s the ss

 

tx

 


hmm, don’t know if it’s a display bug, but you have 2 time the command in your line, you have 2 ./check_nrpe

 


my bad :)

 


let’s start at the begining, 

first run the check 

 ./check_nrpe -2 -H SERVER

this should return you the version of the nrpe/nsclient agent on the host (just to be sure it can communicate)

if that doesn’t work, I don’t really know but it has to do with the command check_nrpe, and 

 

next run

 ./check_nrpe -2 -H SERVER -c CheckService 

this should return you either ok or critical if some service are stopped, but ok or critical is good, next you need to add each argument one by one until you have the error message

 

 


Hmmm strange

 


>root@centreon-central plugins]# ./check_nrpe -2 -H srv-dial2
I (0.5.2.41 2018-04-26) seem to be doing fine...
>root@centreon-central plugins]# ./check_nrpe -2 -H srv-dial2 -c CheckService
Unknown command(s): checkservice
>root@centreon-central plugins]#


where did you get your command, “-c CheckService”?

I just realized the command is “-c check_service”, this should be setup by the plugin pack


from you 14 days ago :)


ha yeah I remember pasting what was in my centreon command

try with that underscore


got the same it seems so

 

 


please go on your windows host where you installed nsclient

in a shell as administrator go in c:\program files\centreon-nslcient\nsclient++\  (that should be where the centreon package is installed for nsclient, )

 

in the shell you should type 

  nscp test --settings dummy

this load the nsclient shell

then type 

  load CheckSystem

 

then you can type the command from “-c” like check_cpu and check_service

is it working in that shell ? ( you can find example here from Checking things - NSClient++ )

 

 


Reply