feature: Added formatted uptime value for alert templates #4983

feature: Added formatted uptime value for alert templates #4983
This commit is contained in:
Neil Lathwood
2016-11-15 20:11:12 +00:00
committed by Søren Rosiak
parent a0fec9e574
commit e934e306fc
2 changed files with 13 additions and 8 deletions

View File

@@ -453,6 +453,8 @@ function DescribeAlert($alert)
$obj['sysName'] = $device['sysName'];
$obj['location'] = $device['location'];
$obj['uptime'] = $device['uptime'];
$obj['uptime_short'] = formatUptime($device['uptime'], 'short');
$obj['uptime_long'] = formatUptime($device['uptime']);
$obj['description'] = $device['purpose'];
$obj['notes'] = $device['notes'];
$obj['device_id'] = $alert['device_id'];

View File

@@ -118,6 +118,9 @@ Placeholders:
- Hostname of the Device: `%hostname`
- sysName of the Device: `%sysName`
- location of the Device: `%location`
- uptime of the Device (in seconds): `%uptime`
- short uptime of the Device (28d 22h 30m 7s): `%uptime_short`
- long uptime of the Device (28 days, 22h 30m 7s): `%uptime_long`
- description (purpose db field) of the Device: `%description`
- notes of the Device: `%notes`
- Title for the Alert: `%title`