This post is for those who plans to move to Windows Server 2019 – if you’re using user-defined data collector sets (and specifically user-defined alerts) – being aware of the new “features” may help administrators to move flawlessly to the new version of Windows Server.
I used to monitor the performance of my servers with user defined data collector sets and alerts – it’s been working correctly up until I’ve tried to create a few data collector sets/alerts on the new Windows Server 2019. Here are the problems I’ve come accross in the latest server OS from MS (in fact I’m sure this is the one problem but I have MS’s confirmation for its first “occurrence” only.
As you already may know to make a user defined alert start automatically after server restart you can navigate to the Task Scheduler\Task Scheduler Library\Microsoft\Windows\PLA and configure the corresponding scheduled task to start the alert at system startup (each data collector set has a corresponding scheduled task of the same name in the PLA section of the Task Scheduler)
If you look at its properties you’ll see that the Actions pane contains the Custom Handler action instead of the Start a program in previous versions of Windows Server:
Compare with Windows Server 2012:
Either at server startup or after clicking Run the status of the scheduled task should change to Running and stay in the running state indefinitely, but in Windows Server 2019 the state just flashes as running and then reverts back to Ready – the History tab displays the 201 Action completed and 102 Task completed events.
The alert remains in the stopped state:
Status: MS has confirmed this is by design in Windows Server 2019.
Alerts do not have the Schedule tab so I thought at first that the issue with autostarting alerts will not pertain to “general” data collector sets which have their own Schedule tabs – and I was wrong. Let’s take a look at the SQL DCS which to be started at 3:17AM:
Event Viewer\Application and Services Logs\Microsoft\Windows\Diagnosis-PLA\Operational log:
The SQL scheduled task’s History tab in the Task Scheduler\Task Scheduler Library\Microsoft\Windows\PLA contains the folloing information:
It looks like exactly the same problem with starting CPU-Alert: the scheduled tasks gets started and completed successfully right after after starting – no action is performed despite the generation of the Action completed event 201.
Starting SQL manually completes successfully:
So in Windows Server 2019 you can’t use schedules for your data collector sets either!
In this case we’re left with the only option – logman command line utility. Once Performance Monitor can no more use its own schedules we’re going to have to create the corresponding scheduled tasks for each data collector and schedule those tasks as needed. For this the simplest cmd scripts can be created, for example:
CMD scripts: logman start [dcs name]
For the CPU-Alert the script will be as simple as CPU-Alert.cmd: logman start CPU-Alert
The Triggers and Actions tabs:
For the SQL data collector set specific schedules must be added instead of the At system startup trigger (SQL.cmd contains the single line logman start SQL):
1) CPU-Alert: after restarting the server CPU-Alert does really get started at system startup:
2) SQL data collector set (at the scheduled time) *!
Since we have to use Logman in Windows Server 2019 for starting DCSs at scheduled times it may be a good idea to use Logman – along with the DCS templates – for the enterprise-level deployment: many companies do not use third party monitoring tools (and even with such tools deployed you still may need to use Windows data collector sets) so the ability to quickly deploy a predefined set of data collector sets accross your organization might prove helpful to network administrators.
Suppose there’s a newly-installed server and you need to configure several DCSs using the templates from your old server:
Step 1 – copy the templates to the new server
Step 2 -create a command file * to import all DCSs (I added pause just to be able to see the result)
* This page is wrong: you shouldn’t use the -n switch after import/export keyword to define a data collector set’s name!
Step 4 – create the scheduled task for each DCS
If the scheduled tasks (and the data collector sets they start, of course) to be created on each server are the same across at least some of your servers, you can automate the process of creating the scheduled tasks on those server by using domain GPOs.
The only way to run the Performance Monitor’s data collector sets at schedule time in Windows Server 2019 is to use the logman program coupled with scheduled tasks: you must create a script that starts the data collector set and schedule it to start at a specific time in Task Scheduler.
In Windows Server 2022 Performance Monitor’s data collector can be run according to schedule once again!