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:
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.
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:
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.
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
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):
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.
* This page is wrong: you shouldn’t use the -n switch after import/export keyword to define a data collector set’s name!
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.