squaredup / Community.DataOnDemand.MP

The Data on Demand Management Pack contains a number of useful System Center Operations Manager (SCOM) agent tasks, including the Netstat task required by Squared Up Visual Application Discovery & Analytics.
GNU General Public License v3.0
4 stars 2 forks source link

List Windows Updates #30

Closed wiredworm closed 6 years ago

wiredworm commented 6 years ago

I've created the needed files to allow a new on-demand task which, with it's default config, will list the 10 most recent Windows Updates that have been applied to the targeted Server. I'm not familiar with using GIT and I have no idea if I would even have rights to commit to the repo; so, i'm providing the files here so someone can include them into the MP.

Pete GetWindowsUpdates.zip

wiredworm commented 6 years ago

Seems I got my date formatting a little wrong. Below is a modified version of the script which formats the date using the regional setting for the target. It also formats the time into the local timezone as the previous script always reported the value in UTC.

Get-WindowsUpdate.txt

shadeon commented 6 years ago

Hi Pete,

Thanks for submitting this - providing scripts is definitely the important bit 👍

You are correct you wouldn't be able to commit directly to the repo, you'd need to fork this into your own github repo first, make your changes there and then submit a pull request to have us bring them in.

In terms of the date formatting, I think it would be better to ship with an unambiguous UTC date than one that is localised by the agent.

  1. When managing machines in more than one timezone (or a hybrid cloud where cloud machines are typically in a UTC zone regardless of region) this is going to produce confusing results.
  2. When using a Data On Demand grid tile with Squared Up, we can format this nicely into the browser's timezone using a {{[timeago(value)}} column template.

I've also spotted a couple of bugs in both versions (notably the 'NotStarted' case in the ResultCode switch statement won't ever trigger due to a typo) but I'll flag those in the PR and attach you as a reviewer so you can see them.

wiredworm commented 6 years ago

Thanks Matthew.

I would tend to agree with you on the timezone points; unfortunately a lot of my colleagues aren't so used to working with UTC so the change was more made to satisfy them, but no problem with keeping it UTC for the community release.

Good spot on the typo too; if there is one thing i'm slowly learning it's that SCOM scripts require even more care and attention because it's so easy to miss a bug and the impact can lead to some very odd looking results.

It's been a bit manic lately but i'll hopefully be able to contribute more once i'm back in the saddle after my short break away.

All the best

Pete


From: Matthew Long notifications@github.com Sent: 31 May 2018 09:47 To: squaredup/Community.DataOnDemand.MP Cc: wiredworm; Author Subject: Re: [squaredup/Community.DataOnDemand.MP] List Windows Updates (#30)

Hi Pete,

Thanks for submitting this - providing scripts is definitely the important bit 👍

You are correct you wouldn't be able to commit directly to the repo, you'd need to fork this into your own github repo first, make your changes there and then submit a pull request to have us bring them in.

In terms of the date formatting, I think it would be better to ship with an unambiguous UTC date than one that is localised by the agent.

  1. When managing machines in more than one timezone (or a hybrid cloud where cloud machines are typically in a UTC zone regardless of region) this is going to produce confusing results.
  2. When using a Data On Demand grid tile with Squared Up, we can format this nicely into the browser's timezone using a {{[timeago(value)}} column template.

I've also spotted a couple of bugs in both versions (notably the 'NotStarted' case in the ResultCode switch statement won't ever trigger due to a typo) but I'll flag those in the PR and attach you as a reviewer so you can see them.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/squaredup/Community.DataOnDemand.MP/issues/30#issuecomment-393477299, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AlqNpMrOj6l0kr60oa1wY4BX2xddEhg0ks5t37xNgaJpZM4UHGze.

shadeon commented 6 years ago

Hi Pete,

Yeah that makes perfect sense. I agree, the biggest one that catches me out (and did again when putting this script in) is how SCOM binds script parameters and some of the oddities there.

I don't know if it's an issue in your environment, but the other bug I found was that the ShowTop code was causing only a single result to be shown if it wasn't specified as $null -gt -1 evaluates to $true.

Hope you enjoy your holiday, and thanks again for contributing to the management pack - very much appreciated! 😄

Thanks,

Matthew

shadeon commented 6 years ago

PR has been merged. Expect to see an official release on the Squared Up download site next week.