Skip to content

Commit

Permalink
Add software upgrade report
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Apr 30, 2024
1 parent 282694b commit a9f14f2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
34 changes: 34 additions & 0 deletions python/nav/etc/report/report.conf.d/report.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
#

0 comments on commit a9f14f2

Please sign in to comment.