Solved

Count number of process running

  • 24 November 2022
  • 4 replies
  • 35 views

Badge +1

Hello everyone,

 

For my company i need to count a number of specific process running on a system and get an alert on my centreon dashboard if that number is superior than N.

 

I really apreciate if you have any solution or suggestion.

 

Regards. 

icon

Best answer by christophe.niel-ACT 24 November 2022, 17:59

View original

4 replies

Userlevel 2
Badge +3

hello

what os is your host and what type of monitoring are you using (snmp, agent, restapi, ws-man)

most of the OS template have a check “process” that will test the presence and the count of a process

 

if you don’t use an os plugin pack, you will need to make your own command to call the plugin, but without information we can’t tell you

 

Badge +1

Thanks for your answer for the OS we’re using Windows server and we’re using agent for monitoring.

And my problem when a sepcific service is running it can create more than a instance and that create a problem and the system becomes slow so we want to supervice the instances of this service the way if it create more than one instance it generate an alert. 

Userlevel 2
Badge +3

mhh with nsclient (i’m assuming that’s the agent you have) there is this documentation

CheckSystem (Windows) - NSClient++ which include a check_process

this is a bit tricky to use with the way it’s setup in centreon and the default template but, first thing first, the process name is case sensitive

 

here is how you would setup your service with the macro using the default custom template you need to modifiy some default macro otherwise it could return lots of text (one for each process running matching the name)

here I used that template : 

there is the exact same one with NRPE

and you need to set the macro: (look the explorer.exe with CAPS, most exe are in lower case, but sometimes they have uppercase, couldn’t find a way to ignore case)

 

here the text for the “topsyntax” macro :   ${status}: Process count:  ${count}

it will give you warning and critical, if you don’t want warning, put “ none “ without quote

 

you will even have a graph with the process count

output and perfdata

 

Badge +1

Thank you so much it’s resolve my problem and that exactly what i search for.

 

Reply