Skip to content

Commit a9f14f2

Browse files
Add software upgrade report
1 parent 282694b commit a9f14f2

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ found in the [HISTORY](HISTORY) file.
99

1010
## [Unreleased]
1111

12+
### Added
13+
14+
- Added a report of software upgrade logs ([#2466](https://github.com/Uninett/nav/pull/2466), [#2457](https://github.com/Uninett/nav/issues/2457))
15+
1216
### Fixed
1317

1418
- 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))

python/nav/etc/report/report.conf.d/report.conf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,40 @@ $url_remote_as = "bgp?remote_as=$remote_as";
13041304
$order_by = "sysname, peer";
13051305
}
13061306

1307+
software_upgrades {
1308+
$title = "Software upgrade logs";
1309+
$description = "Listing of all software upgrades for all IP devices";
1310+
$sql = "
1311+
SELECT
1312+
start_time,
1313+
sysname,
1314+
variables.old_sw_version,
1315+
variables.new_sw_version
1316+
FROM alerthist
1317+
LEFT JOIN netbox USING (netboxid)
1318+
INNER JOIN alerttype USING (alerttypeid)
1319+
LEFT JOIN (
1320+
SELECT
1321+
var1.alerthistid,
1322+
var1.val AS old_sw_version,
1323+
var2.val AS new_sw_version
1324+
FROM alerthistvar var1
1325+
INNER JOIN
1326+
alerthistvar var2 ON var1.alerthistid = var2.alerthistid
1327+
WHERE
1328+
var1.var = 'old_version' AND
1329+
var2.var = 'new_version'
1330+
) AS variables USING (alerthistid)
1331+
WHERE alerttype = 'deviceSwUpgrade'
1332+
";
1333+
1334+
$order_by = "start_time DESC";
1335+
$url_sysname = "/ipdevinfo/$sysname";
1336+
$name_sysname = "Sysname";
1337+
$name_start_time = "Date/Time";
1338+
$name_sw_ver = "New software revision";
1339+
}
1340+
13071341
#
13081342
# EOF
13091343
#

0 commit comments

Comments
 (0)