setup procmon as a background task to run at a specific time and capture a specific process

avinash upadhyay 96 Reputation points
2021-07-12T11:48:05.703+00:00

I want to capture some details around a w3wp process which triggers at a particular time and fails intermittently.
How can I setup procmon with a process filter to run independently (may be Task Scheduler ) at a specific time, capture the log and save it for future review. and then exit out?

Sysinternals
Sysinternals
Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,162 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 54,311 Reputation points
    2021-07-12T14:11:56.807+00:00

    You can schedule procman to run via Task Scheduler. The challenge is when. If you have a specific time then you can set that. If you don't know when then it becomes harder as you are limited in startup options.

    To stop procman from running you can either set a run length limit in Task Scheduler or you can tell procmon to stop collecting after a certain interval or event size limit.

    Note however that I don't believe using procmon is the correct solution here. The biggest issue is that you're talking about IIS. The process by itself isn't sufficient to identify the site being run. If you are like most other companies then your IIS is hosting more than 1 site. There will be no easy way using procmon to tell it to monitor just 1 site out of all of them. w3wp is the process IIS uses to run all sites and therefore each app pool is going to have its own instance. Within the app pool any related sites are going to be running. Depending upon your IIS configuration you may be monitoring the wrong process or more than just the site you care about.

    Personally I think the better option is to use IIS's custom logging directly, your own custom logging within your app, AppInsights for on premise or the older IIS monitoring tools. These will allow you more fine grained control over the site(s) to monitor and they will better integrate with how web apps actually work.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.