need to monitor several Windows process with same exe

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
gkrupitsky
Posts: 7
Joined: Thu May 09, 2019 3:05 pm

need to monitor several Windows process with same exe

Post by gkrupitsky »

How to monitor several Windows process that start with same command.exe but from different config files, located on different
locations, on same drive.
Under Task manager I see 5-6 processes with same name, each has different process id because it was started with a different conf file (each conf file is located on a different path).

In check_nt or check_nrpe what $arg$ can I specify to look at the path of the config file, from which the command.exe(process name) was started.
I am looking for the process status up or down.
swolf

Re: need to monitor several Windows process with same exe

Post by swolf »

Hi @gkrupitsky, thanks for reaching out.

As far as I'm aware, this isn't built-in for any supported Windows agents, so you'll need to write a custom plugin. For Windows, I would recommend doing it with a PowerShell script.

To get you started, it looks like you can get a full list of running processes and their command-line options with this PowerShell command:

Code: Select all

gwmi Win32_Process | select CommandLine
From there, you should be able to write a script that is compatible with our plugin development guidelines (this part is simpler than it sounds - just try it). It sounds like you'll need to make a plugin that accepts the name of the config file as an argument and tells you whether there's a specific process running with this .exe name and config file.

Once you have a working plugin, I would expect it to work the same across NCPA/NSClient/any other nagios-compatible agent.

Hopefully that helps. Let me know how it turns out for you, or if you run into any roadblocks along the way.

-Sebastian Wolf
gkrupitsky
Posts: 7
Joined: Thu May 09, 2019 3:05 pm

Re: need to monitor several Windows process with same exe

Post by gkrupitsky »

Thank you Sebastian, much appreciated.
I will try that, let's see how that goes.
swolf

Re: need to monitor several Windows process with same exe

Post by swolf »

Best of luck to you!

I'm leaving a reply here so that other members of the team know this thread is "handled" until you have time to try the solution.
Post Reply