2016-01-25 16:31:02 +01:00
|
|
|
<?php
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2020-11-27 13:52:35 +01:00
|
|
|
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
2016-01-25 16:31:02 +01:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
// 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 for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
// Login check
|
|
|
|
global $config;
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
require_once 'include/functions_snmp.php';
|
2016-01-25 16:31:02 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$save_snmp_translation = (bool) get_parameter('save_snmp_translation', 0);
|
|
|
|
$delete_snmp_translation = (bool) get_parameter('delete_snmp_translation', 0);
|
|
|
|
$update_snmp_translation = (bool) get_parameter('update_snmp_translation', 0);
|
|
|
|
$delete_snmp_filter = (bool) get_parameter('delete_snmp_filter', 0);
|
2016-01-25 16:31:02 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
// skins image checks
|
2016-01-25 16:31:02 +01:00
|
|
|
if ($save_snmp_translation) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$oid = get_parameter('oid', '');
|
|
|
|
$description = get_parameter('description', '');
|
|
|
|
$post_process = get_parameter('post_process', '');
|
|
|
|
|
|
|
|
$result = snmp_save_translation($oid, $description, $post_process);
|
|
|
|
|
|
|
|
echo json_encode(['correct' => $result]);
|
|
|
|
|
|
|
|
return;
|
2016-01-25 16:31:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($delete_snmp_translation) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$oid = get_parameter('oid', '');
|
|
|
|
|
|
|
|
$result = snmp_delete_translation($oid);
|
|
|
|
|
|
|
|
echo json_encode(['correct' => $result]);
|
|
|
|
|
|
|
|
return;
|
2016-01-25 16:31:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($update_snmp_translation) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$oid = get_parameter('oid', '');
|
|
|
|
$new_oid = get_parameter('new_oid', '');
|
|
|
|
$description = get_parameter('description', '');
|
|
|
|
$post_process = get_parameter('post_process', '');
|
|
|
|
|
|
|
|
$result = snmp_update_translation($oid, $new_oid, $description, $post_process);
|
|
|
|
|
|
|
|
echo json_encode(['correct' => $result]);
|
|
|
|
|
|
|
|
return;
|
2016-01-25 16:31:02 +01:00
|
|
|
}
|
2017-10-26 11:03:08 +02:00
|
|
|
|
|
|
|
if ($delete_snmp_filter) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$filter_id = get_parameter('filter_id');
|
|
|
|
db_process_sql_delete('tsnmp_filter', ['id_snmp_filter' => $filter_id]);
|
2017-10-26 11:03:08 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
return;
|
2017-10-26 11:03:08 +02:00
|
|
|
}
|