BUG - test-template.php upgrade after #8803 + #8908 PR (#8910)

* Update test-template.php

* Test-Template.php - Use AlertData Class

* Update test-template.php
This commit is contained in:
PipoCanaja
2018-07-17 22:14:08 +02:00
committed by Neil Lathwood
parent d47f96d5c3
commit 83f414552d

View File

@@ -5,6 +5,7 @@ $init_modules = ['alerts', 'alerts-cli'];
require __DIR__ . '/../includes/init.php';
use LibreNMS\Alert\Template;
use LibreNMS\Alert\AlertData;
$options = getopt('t:h:r:p:s:d::');
@@ -26,9 +27,11 @@ if (isset($options['t']) && isset($options['h']) && isset($options['r'])) {
$obj['transport'] = $options['p'];
}
$type = new Template;
$obj['alert'] = new AlertData($obj);
$obj['title'] = $type->getTitle($obj);
$obj['msg'] = $type->getBody($obj);
unset($obj['template']);
unset($obj['alert']);
print_r($obj);
} else {
c_echo("