SOLVED

Notify when new version of log analytics agent is available

%3CLINGO-SUB%20id%3D%22lingo-sub-2710038%22%20slang%3D%22en-US%22%3ENotify%20when%20new%20version%20of%20log%20analytics%20agent%20is%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2710038%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Azure%20Monitor%20Humans%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20wondering%20if%20there%20is%20a%20way%20to%20determine%20when%20the%20Log%20Analytics%20agent%20or%20Azure%20monitor%20agent%20is%20below%20the%20current%20available%20version.%3C%2FP%3E%3CP%3EI.e.%20if%20current%20version%20of%20the%20Windows%20agent%20is%26nbsp%3B%3CSPAN%3E10.20.18018.0%20but%20agent%20version%2010.20.18053.0%20is%20available%20to%20install%20from%20the%20log%20analytics%20workspace%2C%20is%20there%20a%20way%20to%20create%20a%20query%20to%20determine%20this%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EDanny%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2712338%22%20slang%3D%22en-US%22%3ERe%3A%20Notify%20when%20new%20version%20of%20log%20analytics%20agent%20is%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2712338%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F181356%22%20target%3D%22_blank%22%3E%40Danny%20Grasso%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20had%20this%20from%20a%20while%20ago%2C%20but%20never%20fully%20tested%20it...in%20case%20it%20helps%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-cpp%22%3E%3CCODE%3Elet%20max_%20%3D%20toscalar(Heartbeat%0A%7C%20summarize%20max(Version))%3B%0AHeartbeat%0A%7C%20where%20OSType%20!%3D%22Linux%22%0A%7C%20summarize%20by%20Version%2C%20Computer%0A%7C%20extend%20isLatest%20%3D%20iif(Version%20%3D%3D%20max_%2C%22Latest%20version%22%2C%22Upgrade%20needed%3F%22)%0A%7C%20order%20by%20isLatest%20asc%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi Azure Monitor Humans,

 

I'm wondering if there is a way to determine when the Log Analytics agent or Azure monitor agent is below the current available version.

I.e. if current version of the Windows agent is 10.20.18018.0 but agent version 10.20.18053.0 is available to install from the log analytics workspace, is there a way to create a query to determine this?

Is this something that could be added to the Insights workbook? Although ideally we would like to alert when agents are out of date.

Thanks

 

Danny

4 Replies

@Danny Grasso 

I had this from a while ago, but never fully tested it...in case it helps? 

 

let max_ = toscalar(Heartbeat
| summarize max(Version));
Heartbeat
| where OSType !="Linux"
| summarize by Version, Computer
| extend isLatest = iif(Version == max_,"Latest version","Upgrade needed?")
| order by isLatest asc

 

Getting some odd results! Apart from some very old versions in this environment, it doesn't seem to be detecting 10.20.18053.0 as the latest version. I don't understand what the first part of the query is doing before the Heartbeat command. Has something changed where we can't query the current version available to install?

(Server names removed )

8.0.11072.0 Latest version
10.20.18053.0 Upgrade needed?
10.20.18053.0 Upgrade needed?
10.20.18053.0 Upgrade needed?
10.20.18053.0 Upgrade needed?
10.20.18053.0 Upgrade needed?
10.20.18001.0 Upgrade needed?
8.0.11049.0 Upgrade needed?
10.20.18053.0 Upgrade needed?
best response confirmed by Danny Grasso (Occasional Contributor)
Solution

@Danny Grasso 

 

The first part (should) just get the newest version from the Heartbeat table

Heartbeat
| summarize max(Version)

If you run the above on its own, I assume you are not getting "10.20.18053.0" as the latest.

Something like this may solve it (but I need longer to look)

let max_ = toscalar(Heartbeat
| where TimeGenerated > ago(90d)
| summarize by Version , strlen(Version)
| order by strlen(Version) desc, Version desc);
Heartbeat
| where OSType !="Linux"
| summarize by Version, Computer
| extend isLatest = iif(Version == max_,"Latest version","Upgrade needed?")
| order by isLatest asc
Thanks for helping out with the query info - I was going to spend some more time on it today but you beat me to it! Results look much better.
Really appreciate the assistance!

10.20.18053.0 Latest version
10.20.18053.0 Latest version
10.20.18053.0 Latest version
10.20.18053.0 Latest version
10.20.18053.0 Latest version
10.20.18053.0 Latest version
10.20.18001.0 Upgrade needed?
8.0.11072.0 Upgrade needed?
8.0.11049.0 Upgrade needed?