diff --git a/CHANGELOG.md b/CHANGELOG.md index b815986cca..589b1411b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ found in the [HISTORY](HISTORY) file. ## [Unreleased] +### Added + +- Added a report of software upgrade logs ([#2466](https://github.com/Uninett/nav/pull/2466), [#2457](https://github.com/Uninett/nav/issues/2457)) + ### Fixed - Avoid running command line scripts twice on every invocation ([#2877](https://github.com/Uninett/nav/issues/2877), [#2878](https://github.com/Uninett/nav/pull/2878)) diff --git a/python/nav/etc/report/report.conf.d/report.conf b/python/nav/etc/report/report.conf.d/report.conf index b1a3e8ba3a..2cdc6a2bf2 100644 --- a/python/nav/etc/report/report.conf.d/report.conf +++ b/python/nav/etc/report/report.conf.d/report.conf @@ -1304,6 +1304,40 @@ $url_remote_as = "bgp?remote_as=$remote_as"; $order_by = "sysname, peer"; } +software_upgrades { +$title = "Software upgrade logs"; +$description = "Listing of all software upgrades for all IP devices"; +$sql = " +SELECT + start_time, + sysname, + variables.old_sw_version, + variables.new_sw_version +FROM alerthist +LEFT JOIN netbox USING (netboxid) +INNER JOIN alerttype USING (alerttypeid) +LEFT JOIN ( + SELECT + var1.alerthistid, + var1.val AS old_sw_version, + var2.val AS new_sw_version + FROM alerthistvar var1 + INNER JOIN + alerthistvar var2 ON var1.alerthistid = var2.alerthistid + WHERE + var1.var = 'old_version' AND + var2.var = 'new_version' + ) AS variables USING (alerthistid) +WHERE alerttype = 'deviceSwUpgrade' +"; + +$order_by = "start_time DESC"; +$url_sysname = "/ipdevinfo/$sysname"; +$name_sysname = "Sysname"; +$name_start_time = "Date/Time"; +$name_sw_ver = "New software revision"; +} + # # EOF #