I am trying to see if it is possible to use PRTG to monitor the memory and CPU usage of a individual service
I have never done this but it looks interesting. Checkout these articles:
You could use WMI Process sensors
Even better Patrick. Thanks!
This is possible with new Custom Sensor PTF.ProcessResourceXML
This sensor monitors a process and returns a channel for both the CPU and memory usage of the process. The new XML sensors can return multiple channels, so you only need one sensor to monitor both CPU and memory.
-s=process -c=computer [-u=username] [-p=password|passhash] -s= Name of the process. -c= Name or IP-Address of the computer running the process. -u= Optional Domain\Username of a user account hat has access to the computer via WMI service. -p= Optional Password or PassHash of a user account that has access to the computer via WMI service.
Note: This sensor requires PRTG version 8.2
The sensor can be downloaded from this page.
With Windows 10 (and maybe earlier), Windows hosts its services under multiple instances of svchost.exe. I've been able to break them out so the service I'm interested in is running by itself under one instance of svchost.exe only differentiated by a command line parameter, but are there any ideas how I might just track the memory usage of a specific svchost.exe instance among the many? I've also checked and the PID is not consistent though I didn't expet it to be.
Unfortunately, the WMI Class "Win32_PerfRawData_PerfProc_Process" doesn't offer a "Commandline"-field which would allow you to filter for the exact svchost. Therefore I am afraid that this might not be possible to monitor via WMI. You could however build a PowerShell Script that runs on the server that sends it's results to PRTG via a HTTP Push Data Sensor:
I may have a different approach. I copied svchost.exe to svchost1.exe and modified the service to use it instead.