Add procedure management

This commit is contained in:
Guillaume COEUGNET 2016-05-27 16:11:06 +02:00
parent 47c22f6bb0
commit d5e26a3438
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
# header('Content-type: text/plain');
$alert_id = $_POST['alert_id'];
if (!is_numeric($alert_id)) {
echo 'ERROR: No alert selected';
exit;
}
else {
$proc = dbFetchCell('SELECT proc FROM alerts,alert_rules WHERE alert_rules.id = alerts.rule_id AND alerts.id = ?', array($alert_id));
if (! file_exists ("procs/$proc")) { echo header("HTTP/1.0 404 Not Found"); }
else { echo $proc; }
exit;
}

BIN
html/procs/noproc.pdf Normal file

Binary file not shown.

2
sql-schema/116.sql Normal file
View File

@ -0,0 +1,2 @@
ALTER TABLE alert_rules ADD COLUMN proc VARCHAR(30) AFTER name;
UPDATE alert_rules SET proc="noproc.pdf";