Hi,
I want to Monitor a process (especially usage of this process) and I am using wmiprocesssensor for this. This works fine as Long as the process runs. If the process is closed (which is normal) the sensor shouldn't raise an Alarm but continue to use Status OK instead.
Is there any (easy) way to configure this without creating a new custom WMI sensor?
Thanks for your reply
Article Comments
It would be ok, if the process is marked as down. But can I adjust the sensor that it won't raise the alarm state by modifying channel attributes?
If I can't use the pre built sensor, will something like this be possible by using a custom sensor?
So want to "exclude" the sensor from my general warning list and use the sensor only for documentation purposes.
best regards
Apr, 2014 - Permalink
Using a custom sensor you could define the state yourself, so yes, that would be possible.
Apr, 2014 - Permalink
I'm looking for this same functionality. I want to mimic everything the wmiprocesssensor does, except not throw an exception when the process is not found.
Dec, 2015 - Permalink
Hello there,
As mentioned before, this will be possible with a custom sensor which will allow you to define particular sensor states. You can i.e. use the PowerShell CMDlet
Get-WmiObject win32_process
to monitor the processes of a remote computer. I'll attach a script which will scan a target host for duplicated processes, this should give you a starting point to write your own sensor suiting your needs. Please note that this script comes at it is and we will not offer additional support for it:
# Description: Monitors Windows processes for duplicated entries # Parameters: # -Process: The name you want to check for multiple instances # -process "chrome.exe" -hostname %host -Username "%windowsdomain\%windowsuser" -Password "%windowspassword" # Parameter list param( [string]$process = "ProzessName", [string]$hostname = "TargetHostName", [string]$username = "YourUsername", [string]$password = "YourPassword" ) # Variables $result=0 # Generate Credentials Object $SecPasswd = ConvertTo-SecureString $Password -AsPlainText -Force $Credentials= New-Object System.Management.Automation.PSCredential ($UserName, $secpasswd) try{ $Objects = (Get-WmiObject win32_process -ComputerName $($hostname) -Filter "name like '%$($process)%'" | select Commandline | Group-Object commandline) } catch{ $Objects = (Get-WmiObject win32_process -ComputerName $($hostname) -Credential $($Credentials) -Filter "name like '%$($process)%'" | select Commandline | Group-Object commandline) } write-host ($Objects | Measure-Object).Count ":" ($Objects | Measure-Object).Count " instance(s) of the process '$($process)' running"
Best regards, Felix
Dec, 2015 - Permalink
The PowerShell .count function doesn't always works as expected. When $objects contains a single item, it returns null.
Suggested replacement (last line):
write-host ($Objects | Measure-Object).Count ":" ($Objects | Measure-Object).Count " instance(s) of the process '$($process)' running"
Nov, 2019 - Permalink
I'm afraid that isn't possible, sorry. If the process is no longer operational, PRTG will always mark the same as down.
Apr, 2014 - Permalink