When was the last time this agent inserted data and what was the latency?

This is one way to check whether a particular agent is communicating with the management group.  Just replace FQDN with the agent you want to test, and this will return the last sampled DateTime stamp.  We will also see when the data was actually inserted into the database, which allows us to calculate a ‘Latency’ column that shows us how long it took for that data to make it from the agent to the operational database.

Beware of word wrap – this is a one-liner.


Get-PerformanceCounter -Criteria 'ObjectName = ''LogicalDisk'' and CounterName = ''Avg. Disk sec/Write'' and MonitoringObjectPath = ''FQDN''' | get-PerformanceCounterValue -StartTime(Get-Date).AddDays(-1) -EndTime(Get-Date) | select -last 1 TimeSampled, TimeAdded, @{Name="Latency";Expression={$_.TimeAdded - $_.TimeSampled}}


Note: I used the LogicalDisk \ Avg. Disk sec/Write counter for this query, because this is enabled out of box and has the most sensitive optimization settings.  In other words, this collection rule should be enabled against all Windows Servers out of box and is sampled frequently (every 5 minutes by default).  If the DateTime stamps are more than 10-20 minutes ago, this is a good sign that the agent may not be communicating.  If the DateTime stamps are more than a couple hours, data from this agent is most certainly not making it to the database.

Be aware that this doesn’t ALWAYS indicate an agent issue.  Could be an issue with the management server or possibly even the database server.  Sampling a couple different agents should tell that story.


Command Shell Main Menu

Comments (0)

Skip to main content