Merge branch 'ent-8365-ncm-fase-3' into 'develop'
Ent 8365 ncm fase 3 See merge request artica/pandorafms!6612
This commit is contained in:
commit
f3d190a8bb
File diff suppressed because it is too large
Load Diff
|
@ -1062,7 +1062,13 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'ncm':
|
||||
$idAgent = $item['id_agent'];
|
||||
$id_agent_ncm = json_decode($item['ncm_agents']);
|
||||
$ncm_group = $item['id_group'];
|
||||
break;
|
||||
|
||||
case 'ncm_backups':
|
||||
$id_agent_ncm = json_decode($item['ncm_agents']);
|
||||
$ncm_group = $item['id_group'];
|
||||
break;
|
||||
|
||||
case 'top_n_agents_sh':
|
||||
|
@ -2079,6 +2085,71 @@ if (is_metaconsole() === true) {
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row_ncm_group" class="datos">
|
||||
<td class="bolder"><?php echo __('Group NCM'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
echo '<div class="w250px inline padding-right-2-imp">';
|
||||
$url = ui_get_full_url('ajax.php');
|
||||
html_print_input_hidden('url_ajax', $url, false, false, false, 'url_ajax');
|
||||
if (check_acl($config['id_user'], 0, 'RW')) {
|
||||
html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'RW',
|
||||
true,
|
||||
'ncm_group',
|
||||
$ncm_group,
|
||||
'filterNcmAgentChange()',
|
||||
);
|
||||
} else if (check_acl($config['id_user'], 0, 'RM')) {
|
||||
html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'RM',
|
||||
true,
|
||||
'ncm_group',
|
||||
$ncm_group,
|
||||
'filterNcmAgentChange()',
|
||||
);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row_ncm_agent">
|
||||
<td class="bolder"><?php echo __('Agent NCM'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
echo '<div class="w250px inline padding-right-2-imp">';
|
||||
$all_agents = agents_get_agents_selected($ncm_group);
|
||||
html_print_select(
|
||||
$all_agents,
|
||||
'agent_ncm[]',
|
||||
$id_agent_ncm,
|
||||
'',
|
||||
__('Any'),
|
||||
0,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
);
|
||||
echo '</div>';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row_source" class="datos">
|
||||
<td class="bolder"><?php echo __('Source'); ?></td>
|
||||
<td >
|
||||
|
@ -7305,6 +7376,10 @@ function chooseType() {
|
|||
|
||||
$('#agent_autocomplete_events').show();
|
||||
|
||||
// NCM fields.
|
||||
$("#row_ncm_group").hide();
|
||||
$("#row_ncm_agent").hide();
|
||||
|
||||
switch (type) {
|
||||
case 'event_report_group':
|
||||
$("#row_description").show();
|
||||
|
@ -8168,7 +8243,13 @@ function chooseType() {
|
|||
break;
|
||||
|
||||
case 'ncm':
|
||||
$("#row_agent").show();
|
||||
$("#row_ncm_group").show();
|
||||
$("#row_ncm_agent").show();
|
||||
break;
|
||||
|
||||
case 'ncm_backups':
|
||||
$("#row_ncm_group").show();
|
||||
$("#row_ncm_agent").show();
|
||||
break;
|
||||
|
||||
case 'top_n_agents_sh':
|
||||
|
@ -8551,4 +8632,43 @@ $(document).ready(function () {
|
|||
});
|
||||
});
|
||||
|
||||
// Ncm agent filter by group.
|
||||
function filterNcmAgentChange() {
|
||||
var idGroup = $("#ncm_group").val();
|
||||
const url_ajax = $("#url_ajax").val();
|
||||
|
||||
$.ajax({
|
||||
url: url_ajax,
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: {
|
||||
page: "operation/agentes/ver_agente",
|
||||
get_ncm_agents: 1,
|
||||
id_group: idGroup,
|
||||
privilege: "AW",
|
||||
keys_prefix: "_"
|
||||
},
|
||||
success: function(data) {
|
||||
$("#agent_ncm").empty();
|
||||
var optionAny = $("<option></option>")
|
||||
.attr("value",0)
|
||||
.html("Any");
|
||||
// Add any option.
|
||||
$("#agent_ncm").append(optionAny);
|
||||
|
||||
data.map(item => {
|
||||
var option = $("<option></option>")
|
||||
.attr("value", item.id_agent)
|
||||
.html(item.alias);
|
||||
// Add agents options.
|
||||
$("#agent_ncm").append(option);
|
||||
});
|
||||
},
|
||||
error: function(err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -2061,6 +2061,20 @@ switch ($action) {
|
|||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'ncm_backups':
|
||||
$agents_ncm = get_parameter('agent_ncm');
|
||||
$values['ncm_agents'] = json_encode($agents_ncm);
|
||||
$values['id_group'] = get_parameter('ncm_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'ncm':
|
||||
$agents_ncm = get_parameter('agent_ncm');
|
||||
$values['ncm_agents'] = json_encode($agents_ncm);
|
||||
$values['id_group'] = get_parameter('ncm_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_severity_graph':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
|
@ -2131,7 +2145,10 @@ switch ($action) {
|
|||
break;
|
||||
}
|
||||
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
if (isset($values['id_agent']) === false) {
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
}
|
||||
|
||||
$values['id_gs'] = get_parameter('id_custom_graph');
|
||||
|
||||
$values['id_agent_module'] = '';
|
||||
|
@ -2247,7 +2264,10 @@ switch ($action) {
|
|||
$values['id_module_group'] = get_parameter(
|
||||
'combo_modulegroup'
|
||||
);
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
|
||||
if (isset($values['id_group']) === false) {
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
}
|
||||
|
||||
if ($values['server_name'] == '') {
|
||||
$values['server_name'] = get_parameter(
|
||||
|
@ -3057,6 +3077,21 @@ switch ($action) {
|
|||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'ncm_backups':
|
||||
$agents_ncm = get_parameter('agent_ncm');
|
||||
$values['ncm_agents'] = json_encode($agents_ncm);
|
||||
$values['id_group'] = get_parameter('ncm_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'ncm':
|
||||
$agents_ncm = get_parameter('agent_ncm');
|
||||
$values['ncm_agents'] = json_encode($agents_ncm);
|
||||
$values['id_agent'] = get_parameter('agent_ncm');
|
||||
$values['id_group'] = get_parameter('ncm_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_severity_graph':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
|
@ -3133,7 +3168,10 @@ switch ($action) {
|
|||
);
|
||||
}
|
||||
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
if (isset($values['id_agent']) === false) {
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
}
|
||||
|
||||
$values['id_gs'] = get_parameter('id_custom_graph');
|
||||
if (($values['type'] == 'alert_report_agent')
|
||||
|| ($values['type'] == 'event_report_agent')
|
||||
|
@ -3247,7 +3285,9 @@ switch ($action) {
|
|||
$values['id_module_group'] = get_parameter(
|
||||
'combo_modulegroup'
|
||||
);
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
if (isset($values['id_group']) === false) {
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
}
|
||||
|
||||
|
||||
if ((($values['type'] == 'custom_graph')
|
||||
|
|
|
@ -896,6 +896,35 @@ echo '<legend>'.__('Mail configuration').'</legend>';
|
|||
|
||||
echo '</fieldset>';
|
||||
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
echo '<legend>'.__('NCM Configuration').'</legend>';
|
||||
|
||||
$table_ncm_config = new stdClass();
|
||||
$table_ncm_config->width = '100%';
|
||||
$table_ncm_config->class = 'databox filter-table-adv';
|
||||
$table_ncm_config->size = [];
|
||||
$table_ncm_config->size[0] = '50%';
|
||||
$table_ncm_config->data = [];
|
||||
|
||||
$table_ncm_config->data[0][] = html_print_label_input_block(
|
||||
__('FTP server IP').ui_print_help_tip(__('This value will be used by TFTP_SERVER_IP macro in NCM scripts.'), true),
|
||||
html_print_input_text(
|
||||
'tftp_server_ip',
|
||||
$config['tftp_server_ip'],
|
||||
'',
|
||||
false,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w50p'
|
||||
)
|
||||
);
|
||||
|
||||
html_print_table($table_ncm_config);
|
||||
|
||||
echo '</fieldset>';
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>donut</title>
|
||||
<g id="donut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10,1 C14.9705627,1 19,5.02943725 19,10 C19,14.9705627 14.9705627,19 10,19 C5.02943725,19 1,14.9705627 1,10 C1,5.02943725 5.02943725,1 10,1 Z M10,6 C7.790861,6 6,7.790861 6,10 C6,12.209139 7.790861,14 10,14 C12.209139,14 14,12.209139 14,10 C14,7.790861 12.209139,6 10,6 Z" id="Oval" fill="#484848" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 649 B |
|
@ -431,6 +431,10 @@ function config_update_config()
|
|||
if (config_update_value('inventory_changes_blacklist', implode(',', $inventory_changes_blacklist), true) === false) {
|
||||
$error_update[] = __('Inventory changes blacklist');
|
||||
}
|
||||
|
||||
if (config_update_value('tftp_server_ip', (string) get_parameter('tftp_server_ip'), true) === false) {
|
||||
$error_update[] = __('Ftp server ip');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'enterprise':
|
||||
|
|
|
@ -973,7 +973,15 @@ function reporting_make_reporting_data(
|
|||
break;
|
||||
|
||||
case 'ncm':
|
||||
$report['contents'][] = reporting_ncm_config(
|
||||
$report['contents'][] = reporting_ncm_list(
|
||||
$report,
|
||||
$content,
|
||||
$pdf
|
||||
);
|
||||
break;
|
||||
|
||||
case 'ncm_backups':
|
||||
$report['contents'][] = reporting_ncm_backups(
|
||||
$report,
|
||||
$content,
|
||||
$pdf
|
||||
|
|
|
@ -480,7 +480,11 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
|||
break;
|
||||
|
||||
case 'ncm':
|
||||
reporting_html_ncm_config($table, $item);
|
||||
reporting_html_ncm_list($table, $item);
|
||||
break;
|
||||
|
||||
case 'ncm_backups':
|
||||
reporting_html_ncm_backups($table, $item);
|
||||
break;
|
||||
|
||||
case 'top_n_agents_sh':
|
||||
|
@ -7747,40 +7751,146 @@ function reporting_html_permissions($table, $item, $pdf=0)
|
|||
|
||||
|
||||
/**
|
||||
* HTML content for ncm configuration diff report.
|
||||
* HTML content for ncm devices list.
|
||||
*
|
||||
* @param array $item Content generated by reporting_ncm_config.
|
||||
* @param array $item Content generated by reporting_ncm_list.
|
||||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
function reporting_html_ncm_config($table, $item, $pdf=0)
|
||||
function reporting_html_ncm_list($table, $item, $pdf=0)
|
||||
{
|
||||
$key = uniqid();
|
||||
// Create table diff.
|
||||
$table_ncm = new stdClass();
|
||||
$table_ncm->width = '100%';
|
||||
$table_ncm->class = 'info_table';
|
||||
$table_ncm->styleTable = 'table-layout: fixed;';
|
||||
$table_ncm->titleclass = 'title_table_pdf';
|
||||
|
||||
$table_ncm->align = [];
|
||||
$table_ncm->align['name'] = 'left';
|
||||
$table_ncm->align['ip'] = 'left';
|
||||
$table_ncm->align['vendor'] = 'left';
|
||||
$table_ncm->align['model'] = 'left';
|
||||
$table_ncm->align['firmware'] = 'left';
|
||||
$table_ncm->align['last_backup_date'] = 'left';
|
||||
|
||||
$table_ncm->headstyle['name'] = 'text-align: left';
|
||||
$table_ncm->headstyle['ip'] = 'text-align: left';
|
||||
$table_ncm->headstyle['vendor'] = 'text-align: left';
|
||||
$table_ncm->headstyle['model'] = 'text-align: left';
|
||||
$table_ncm->headstyle['firmware'] = 'text-align: left';
|
||||
$table_ncm->headstyle['last_backup_date'] = 'text-align: left';
|
||||
|
||||
$table_ncm->head = [];
|
||||
$table_ncm->head['name'] = __('Name');
|
||||
$table_ncm->head['ip'] = __('Ip');
|
||||
$table_ncm->head['vendor'] = __('Vendor');
|
||||
$table_ncm->head['model'] = __('Model');
|
||||
$table_ncm->head['firmware'] = __('Firmware');
|
||||
$table_ncm->head['last_backup_date'] = __('Last backup date');
|
||||
|
||||
$table_ncm->data = [];
|
||||
foreach ($item['data'] as $key => $row) {
|
||||
$title = $row['last_error'];
|
||||
if (empty($title) === true) {
|
||||
$title = null;
|
||||
}
|
||||
|
||||
$table_ncm->data[] = [
|
||||
$row['alias'],
|
||||
$row['direccion'],
|
||||
$row['vendor'],
|
||||
$row['model'],
|
||||
$row['firmware'],
|
||||
$row['last_backup_date'],
|
||||
];
|
||||
}
|
||||
|
||||
if ($pdf === 0) {
|
||||
ui_require_javascript_file('diff2html-ui.min');
|
||||
ui_require_css_file('diff2html.min');
|
||||
$script = "$(document).ready(function() {
|
||||
const configuration = {
|
||||
drawFileList: false,
|
||||
collapsed: true,
|
||||
matching: 'lines',
|
||||
outputFormat: 'side-by-side',
|
||||
};
|
||||
const diff2htmlUi = new Diff2HtmlUI(
|
||||
document.getElementById('".$key."'),
|
||||
atob('".base64_encode($item['data'])."'),
|
||||
configuration
|
||||
);
|
||||
diff2htmlUi.draw();
|
||||
});";
|
||||
$content = '<div class="w100p" id="'.$key.'"></div class="w100p">';
|
||||
$content .= '<script>'.$script.'</script>';
|
||||
$table->data[1] = $content;
|
||||
$table->colspan[1][0] = 2;
|
||||
$table->colspan['data']['cell'] = 3;
|
||||
$table->cellstyle['data']['cell'] = 'text-align: left;';
|
||||
$table->data['data']['cell'] = html_print_table(
|
||||
$table_ncm,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$content = '<div style="text-align:left;margin-left: 14px;">';
|
||||
$content .= str_replace("\n", '<br>', $item['data']);
|
||||
$content .= '</div>';
|
||||
return $content;
|
||||
$table_ncm->titleclass = 'title_table_pdf';
|
||||
$table_ncm->titlestyle = 'text-align:left;';
|
||||
|
||||
return html_print_table(
|
||||
$table_ncm,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HTML content for ncm backup report.
|
||||
*
|
||||
* @param array $item Content generated by reporting_ncm_backups.
|
||||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
function reporting_html_ncm_backups($table, $item, $pdf=0)
|
||||
{
|
||||
ui_require_css_file('diff2html.min');
|
||||
ui_require_css_file('highlight.min');
|
||||
ui_require_css_file('highlight/vs.min');
|
||||
ui_require_javascript_file('diff2html-ui.min');
|
||||
ui_require_javascript_file('highlight.min');
|
||||
ui_require_javascript_file('highlightjs-line-numbers.min');
|
||||
ui_require_javascript_file('languages/plaintext.min');
|
||||
ui_require_javascript_file('jquery', ENTERPRISE_DIR.'/include/javascript/');
|
||||
ui_require_javascript_file('functions_ncm', ENTERPRISE_DIR.'/include/javascript/');
|
||||
|
||||
// Create table diff.
|
||||
foreach ($item['data'] as $ncm_agent_key => $ncm_agent) {
|
||||
$table_ncm = new stdClass();
|
||||
if ($pdf === 1) {
|
||||
$table_ncm->width = '100%';
|
||||
}
|
||||
|
||||
$table_ncm->class = 'info_table';
|
||||
$table_ncm->styleTable = 'table-layout: fixed;';
|
||||
$table_ncm->headstyle[0] = 'width: 250px';
|
||||
$table_ncm->head = [];
|
||||
$table_ncm->head[0] = __('Date');
|
||||
$table_ncm->head[1] = __('Diff');
|
||||
$table_ncm->id = 'ncm_backups';
|
||||
$table_ncm->name = 'ncm_backups';
|
||||
$table_ncm->title = $ncm_agent['caption'];
|
||||
$row = [];
|
||||
foreach ($ncm_agent['data'] as $ncm_agent_data) {
|
||||
if ($pdf === 1) {
|
||||
$row[] = [
|
||||
$ncm_agent_data['updated_at'],
|
||||
($ncm_agent_data['diffstr'] === '') ? $ncm_agent_data['diff'] : str_replace("\n", '<br>', $ncm_agent_data['diffstr']),
|
||||
];
|
||||
} else {
|
||||
$row[] = [
|
||||
$ncm_agent_data['updated_at'],
|
||||
$ncm_agent_data['diff'],
|
||||
];
|
||||
}
|
||||
|
||||
$table_ncm->data = $row;
|
||||
}
|
||||
|
||||
$table->colspan[$ncm_agent_key]['cell'] = 3;
|
||||
$table->cellstyle[$ncm_agent_key]['cell'] = 'text-align: left;';
|
||||
$table->data[$ncm_agent_key]['cell'] = html_print_table(
|
||||
$table_ncm,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($pdf === 1) {
|
||||
$table->width = '100%';
|
||||
return html_print_table(
|
||||
$table,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -967,9 +967,14 @@ function reports_get_report_types($template=false, $not_editor=false)
|
|||
];
|
||||
}
|
||||
|
||||
$types['ncm_backups'] = [
|
||||
'optgroup' => __('NCM'),
|
||||
'name' => __('NCM configuration changes'),
|
||||
];
|
||||
|
||||
$types['ncm'] = [
|
||||
'optgroup' => __('NCM'),
|
||||
'name' => __('Network configuration changes'),
|
||||
'name' => __('NCM devices list'),
|
||||
];
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
|
|
|
@ -104,11 +104,8 @@ function load_modal(settings) {
|
|||
width = settings.onshow.width;
|
||||
}
|
||||
|
||||
if (settings.modal.overlay == undefined) {
|
||||
settings.modal.overlay = {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
};
|
||||
if (settings.modal.overlay === true) {
|
||||
$("body").append("<div id='modal_overlay'class='ui-widget-overlay'></div>");
|
||||
}
|
||||
|
||||
if (settings.beforeClose == undefined) {
|
||||
|
@ -496,7 +493,6 @@ function load_modal(settings) {
|
|||
settings.onshow.maxHeight != undefined
|
||||
? settings.onshow.maxHeight
|
||||
: "auto",
|
||||
overlay: settings.modal.overlay,
|
||||
position: {
|
||||
my: "top+20%",
|
||||
at: "top",
|
||||
|
@ -518,6 +514,7 @@ function load_modal(settings) {
|
|||
if (settings.cleanup != undefined) {
|
||||
settings.cleanup();
|
||||
}
|
||||
$("#modal_overlay").remove();
|
||||
},
|
||||
beforeClose: settings.beforeClose()
|
||||
});
|
||||
|
|
|
@ -365,3 +365,9 @@ input[type="submit"].ui-button-dialog {
|
|||
.ui_tpicker_time {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
.ui-widget-overlay {
|
||||
background: #aaa !important;
|
||||
opacity: 0.3 !important;
|
||||
z-index: 1114;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
span.select2.select2-container.select2-container--default {
|
||||
max-width: 175px !important;
|
||||
width: 175px !important;
|
||||
}
|
||||
|
||||
.edit_discovery_input b {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
.select2-selection__rendered {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
|
|
@ -12878,6 +12878,10 @@ tr.shown td.details-control {
|
|||
top: -92px;
|
||||
}
|
||||
|
||||
#ncm_backups > caption > h4 {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tags_selected_container > span.select2 {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
use PandoraFMS\ITSM\ITSM;
|
||||
use PandoraFMS\Enterprise\NetworkManager;
|
||||
|
||||
global $config;
|
||||
|
||||
|
@ -74,6 +75,7 @@ if (is_ajax()) {
|
|||
$get_node_agent = (bool) get_parameter('get_node_agent', false);
|
||||
$get_agent_inventory_modules = (bool) get_parameter('get_agent_inventory_modules', false);
|
||||
$get_agent_inventory_dates = (bool) get_parameter('get_agent_inventory_dates', false);
|
||||
$get_ncm_agents = (bool) get_parameter('get_ncm_agents', false);
|
||||
|
||||
$refresh_contact = get_parameter('refresh_contact', 0);
|
||||
|
||||
|
@ -215,6 +217,30 @@ if (is_ajax()) {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get ncm Agent.
|
||||
if ($get_ncm_agents === true) {
|
||||
$fields = [
|
||||
'`tncm_agent`.id_agent',
|
||||
'`tagente`.alias',
|
||||
];
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
|
||||
$filter['filter_id_group'] = $id_group;
|
||||
// Retrieve data.
|
||||
$ncm_data = NetworkManager::agents(
|
||||
// Fields.
|
||||
$fields,
|
||||
// Filter.
|
||||
$filter,
|
||||
);
|
||||
|
||||
echo json_encode($ncm_data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($get_modules_group_json === true) {
|
||||
$id_group = (int) get_parameter('id_module_group', 0);
|
||||
$id_agents = get_parameter('id_agents', null);
|
||||
|
|
|
@ -335,6 +335,7 @@ $table2->data[0][3] = $html_menu_export;
|
|||
$searchForm = '<form method="post" action="'.$url.'&pure='.$config['pure'].'" class="mrgn_right_0px">';
|
||||
$searchForm .= html_print_table($table2, true);
|
||||
$searchForm .= html_print_input_hidden('id_report', $id_report, true);
|
||||
$Actionbuttons = '';
|
||||
|
||||
if ((bool) is_metaconsole() === true) {
|
||||
$Actionbuttons .= html_print_submit_button(
|
||||
|
|
|
@ -1638,6 +1638,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
|
|||
`cat_security_hardening` INT NOT NULL DEFAULT 0,
|
||||
`ignore_skipped` INT NOT NULL DEFAULT 0,
|
||||
`status_of_check` TINYTEXT,
|
||||
`ncm_agents` MEDIUMTEXT,
|
||||
`check_unknowns_graph` tinyint DEFAULT '0',
|
||||
PRIMARY KEY(`id_rc`),
|
||||
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
|
||||
|
@ -4187,6 +4188,29 @@ CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
|
|||
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tncm_agent_data_template`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tncm_agent_data_template` (
|
||||
`id` SERIAL,
|
||||
`name` TEXT,
|
||||
`vendors` TEXT,
|
||||
`models` TEXT,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tncm_agent_data_template_scripts`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tncm_agent_data_template_scripts` (
|
||||
`id` SERIAL,
|
||||
`id_agent_data_template` BIGINT UNSIGNED NOT NULL,
|
||||
`id_script` BIGINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_agent_data_template`) REFERENCES `tncm_agent_data_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tncm_agent`
|
||||
-- ----------------------------------------------------------------------
|
||||
|
@ -4202,10 +4226,13 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` (
|
|||
`updated_at` BIGINT NOT NULL DEFAULT 0,
|
||||
`config_backup_id` BIGINT UNSIGNED DEFAULT NULL,
|
||||
`id_template` BIGINT UNSIGNED,
|
||||
`id_agent_data_template` BIGINT UNSIGNED,
|
||||
`execute_type` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`execute` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`cron_interval` VARCHAR(100) DEFAULT '',
|
||||
`agent_data_cron_interval` VARCHAR(100) DEFAULT '',
|
||||
`event_on_change` INT UNSIGNED DEFAULT null,
|
||||
`agent_data_event_on_change` INT UNSIGNED DEFAULT null,
|
||||
`last_error` TEXT,
|
||||
PRIMARY KEY (`id_agent`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
|
@ -4222,6 +4249,7 @@ CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
|
|||
`id` SERIAL,
|
||||
`id_agent` INT UNSIGNED NOT NULL,
|
||||
`script_type` INT UNSIGNED NOT NULL,
|
||||
`id_agent_data` INT NOT NULL DEFAULT 0,
|
||||
`data` LONGBLOB,
|
||||
`status` INT NOT NULL DEFAULT 5,
|
||||
`updated_at` BIGINT NOT NULL DEFAULT 0,
|
||||
|
@ -4235,8 +4263,10 @@ CREATE TABLE IF NOT EXISTS `tncm_queue` (
|
|||
`id` SERIAL,
|
||||
`id_agent` INT UNSIGNED NOT NULL,
|
||||
`id_script` BIGINT UNSIGNED NOT NULL,
|
||||
`id_agent_data` bigint unsigned,
|
||||
`utimestamp` INT UNSIGNED NOT NULL,
|
||||
`scheduled` INT UNSIGNED DEFAULT NULL,
|
||||
`snippet` TEXT NULL,
|
||||
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
|
|
@ -375,11 +375,11 @@ INSERT INTO `tusuario_perfil` (`id_up`, `id_usuario`, `id_perfil`, `id_grupo`, `
|
|||
--
|
||||
|
||||
INSERT INTO `tperfil` VALUES
|
||||
(1,'Operator (Read)',1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0),
|
||||
(2,'Operator (Write)',1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0),
|
||||
(3,'Chief Operator',1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0),
|
||||
(4,'Group coordinator',1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0),
|
||||
(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
|
||||
(1,'Operator (Read)',1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0),
|
||||
(2,'Operator (Write)',1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0),
|
||||
(3,'Chief Operator',1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0),
|
||||
(4,'Group coordinator',1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0),
|
||||
(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
|
||||
|
||||
--
|
||||
-- Dumping data for table `tnews`
|
||||
|
@ -394,7 +394,7 @@ INSERT INTO tmodule VALUES (5,'Prediction module');
|
|||
INSERT INTO tmodule VALUES (6,'WMI module');
|
||||
INSERT INTO tmodule VALUES (7, 'Web module');
|
||||
INSERT INTO tmodule VALUES (8, 'Wux module');
|
||||
INSERT INTO tmodule VALUES (9, 'Wizard module');
|
||||
INSERT INTO tmodule VALUES (9, 'Wizard module');
|
||||
|
||||
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (1,'OS Total process','Total process in Operating System (UNIX MIB)',13,15,0,0,300,0,'','','public','HOST-RESOURCES-MIB::hrSystemProcesses.0 ',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
|
@ -738,11 +738,11 @@ INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `t
|
|||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (513,'MSDTC TransactionsPersec','Transactions performed per second.',22,1,0,0,300,0,'','','','select TransactionsPersec from Win32_PerfRawData_MSDTC_DistributedTransactionCoordinator',3,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (514,'c2900InfoPeakBuffersUsed','ftp://ftp.cisco.com/pub/mibs/oid/CISCO-C2900-MIB.oid',23,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.9.87.1.1.2.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (515,'c2900InfoTotalBufferDepth','ftp://ftp.cisco.com/pub/mibs/oid/CISCO-C2900-MIB.oid',23,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.9.87.1.1.3.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (516,'c2900BandwidthUsageCurrent ','ftp://ftp.cisco.com/pub/mibs/oid/CISCO-C2900-MIB.oid',23,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.9.87.1.5.1.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (516,'c2900BandwidthUsageCurrent ','ftp://ftp.cisco.com/pub/mibs/oid/CISCO-C2900-MIB.oid',23,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.9.87.1.5.1.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (517,'Latest Message  ','Get the last message sent in Syslog',2,17,0,0,300,0,'','','public','1.3.6.1.4.1.9.9.41.1.2.3.1.5.12',1,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (518,'Latest Message date','',2,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.9.41.1.2.3.1.6.12',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (519,'CPU avgBusy1min ','',2,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.2.1.57.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (520,'CPU avgBusy5min ','',2,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.2.1.58.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (519,'CPU avgBusy1min ','',2,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.2.1.57.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (520,'CPU avgBusy5min ','',2,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.2.1.58.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (521,'Software Image running ','',2,17,0,0,1800,0,'','','public','1.3.6.1.4.1.9.2.1.73.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (522,'nvRAMUsed','',2,15,0,0,300,0,'','','public','1.3.6.1.4.1.9.3.6.8.0',2,2,0,'','','0',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (523,'Printers BytesPrintedPersec','Number of bytes per second printed on a print queue.',24,1,0,0,300,0,'','','','select BytesPrintedPersec from Win32_PerfRawData_Spooler_PrintQueue where NAME = '_total'',5,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
|
@ -754,7 +754,7 @@ INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `t
|
|||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (529,'Printers OutofPaperErrors','Total number of out-of-paper errors in a print queue after the last restart.',24,1,0,0,300,0,'','','','select OutofPaperErrors from Win32_PerfRawData_Spooler_PrintQueue where NAME = '_total'',5,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (530,'Printers TotalJobsPrinted','Total number of jobs printed on a print queue after the last restart.',24,1,0,0,300,0,'','','','select TotalJobsPrinted from Win32_PerfRawData_Spooler_PrintQueue where NAME = '_total'',5,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (531,'Printers TotalPagesPrinted','Total number of pages printed through GDI on a print queue after the last restart.',24,1,0,0,300,0,'','','','select TotalPagesPrinted from Win32_PerfRawData_Spooler_PrintQueue where NAME = '_total'',5,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (532,'Printers Availability','Availability and status of the device\r\n\r\nValue Meaning\r\n\r\n10x1 Other\r\n\r\n20x2 Unknown\r\n\r\n30x3 Running or Full Power\r\n\r\n40x4 Warning\r\n\r\n50x5 In Test\r\n\r\n60x6 Not Applicable\r',24,3,0,0,300,0,'','','','select Availability from Win32_Printer',5,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (532,'Printers Availability','Availability and status of the device\r\n\r\nValue Meaning\r\n\r\n10x1 Other\r\n\r\n20x2 Unknown\r\n\r\n30x3 Running or Full Power\r\n\r\n40x4 Warning\r\n\r\n50x5 In Test\r\n\r\n60x6 Not Applicable\r',24,3,0,0,300,0,'','','','select Availability from Win32_Printer',5,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (533,'Serv_IISAdmin','IIS Administration Server service status.',26,2,0,0,300,0,'','','Running','Select State from Win32_Service WHERE name = 'IISAdmin'',3,6,0,'Administrador','6683','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (534,'Serv_MSSQL_server','Displays if  MS SQL SERVER is running',27,2,0,0,0,0,'','','Running','select state from Win32_Service where name = "MSSQLSERVER"',7,6,0,'','','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (535,'SQLServer_DataFilesSizeKB','Sql database size in kb
',27,1,0,0,0,0,'','','','select state from Win32_Service where name = "MSSQLSERVER"',7,6,0,'','','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','','');
|
||||
|
@ -1302,8 +1302,8 @@ INSERT INTO `tcontainer` SET `name` = 'Default graph container';
|
|||
-- Dumping data for table `tlog_graph_models`
|
||||
--
|
||||
INSERT INTO tlog_graph_models VALUES (1, 'Apache log model',
|
||||
'^.*?\s+.*".*?\s(\/.*?)\?.*1.1"\s+(.*?)\s+(.*?)\s+',
|
||||
'pagina, html_err_code, _tiempo_', 1);
|
||||
'^.*?\s+.*".*?\s(\/.*?)\?.*1.1"\s+(.*?)\s+(.*?)\s+',
|
||||
'pagina, html_err_code, _tiempo_', 1);
|
||||
|
||||
INSERT INTO tlog_graph_models VALUES (2, 'Apache accesses per client and status',
|
||||
'(.*?)\ -.*1.1"\ (\d+)\ \d+',
|
||||
|
@ -1359,13 +1359,13 @@ UPDATE `tnotification_source` SET `enabled`=1 WHERE `description` = 'System 
|
|||
|
||||
INSERT INTO `tpen`
|
||||
VALUES
|
||||
(9,'cisco','Cisco System'),
|
||||
(11,'hp','Hewlett Packard'),
|
||||
(2021,'general_snmp','U.C. Davis, ECE Dept. Tom'),
|
||||
(2636,'juniper','Juniper Networks'),
|
||||
(3375,'f5','F5 Labs'),
|
||||
(8072,'general_snmp','Net SNMP'),
|
||||
(12356,'fortinet','Fortinet')
|
||||
(9,'cisco','Cisco System'),
|
||||
(11,'hp','Hewlett Packard'),
|
||||
(2021,'general_snmp','U.C. Davis, ECE Dept. Tom'),
|
||||
(2636,'juniper','Juniper Networks'),
|
||||
(3375,'f5','F5 Labs'),
|
||||
(8072,'general_snmp','Net SNMP'),
|
||||
(12356,'fortinet','Fortinet')
|
||||
;
|
||||
|
||||
--
|
||||
|
@ -2512,7 +2512,7 @@ INSERT IGNORE INTO `tpen` VALUES (171,'dlink','D-Link Systems, Inc.'),(14988,'mi
|
|||
|
||||
INSERT INTO `tncm_vendor` (`id`, `name`) VALUES
|
||||
(1,'Cisco'),
|
||||
(2, 'D-Link Systems, Inc.'),
|
||||
(2, 'D-Link Systems, Inc.'),
|
||||
(3, 'MikroTik'),
|
||||
(4, 'Alcatel-Lucent Enterprise'),
|
||||
(5, 'Ubiquiti Networks, Inc.'),
|
||||
|
@ -2524,21 +2524,157 @@ INSERT INTO `tncm_vendor` (`id`, `name`) VALUES
|
|||
(11, 'Netlink'),
|
||||
(12, 'Ascom'),
|
||||
(13, 'Synology Inc.'),
|
||||
(14, 'Fujitsu Network Communications, Inc.');
|
||||
(14, 'Fujitsu Network Communications, Inc.'),
|
||||
(15, 'Juniper'),
|
||||
(16, 'Palo Alto'),
|
||||
(17, 'A10'),
|
||||
(18, 'Aruba');
|
||||
|
||||
INSERT INTO `tncm_model` VALUES (1,1,'7200');
|
||||
INSERT INTO `tncm_model` VALUES
|
||||
(1,1,'7200'),
|
||||
(2,1,'Cisco-Generic'),
|
||||
(3,15,'Juniper-Generic'),
|
||||
(4,16,'Palo Alto-Generic'),
|
||||
(5,17,'A10-Generic'),
|
||||
(6,4,'Alcatel-Generic'),
|
||||
(7,18,'Aruba-Generic'),
|
||||
(8,3,'Mikrotik-Generic');
|
||||
|
||||
INSERT INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
|
||||
INSERT INTO `tncm_template` VALUES
|
||||
(1,'cisco-base','[\"1\"]','[\"1\"]'),
|
||||
(2,'Cisco-Generic','[\"1\"]','[\"2\"]'),
|
||||
(3,'Juniper-Generic','[\"15\"]','[\"3\"]'),
|
||||
(4,'Palo Alto-Generic','[\"16\"]','[\"4\"]'),
|
||||
(5,'A10-Generic','[\"17\"]','[\"5\"]'),
|
||||
(6,'Alcatel-Generic','[\"4\"]','[\"6\"]'),
|
||||
(7,'Aruba-Generic','[\"18\"]','[\"7\"]'),
|
||||
(8,'Mikrotik-Generic','[\"3\"]','[\"8\"]');
|
||||
|
||||
INSERT INTO `tncm_script` VALUES
|
||||
(1,0,'enable
expect:Password:\s*
_enablepass_
exit'),
|
||||
(2,1,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show running-config
exit
'),
|
||||
(3,2,'enable
expect:Password:\s*
_enablepass_
term length 0
config terminal
_applyconfigbackup_
exit
'),
|
||||
(4,3,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show version | i IOS Software
exit
'),
|
||||
(5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
'),
|
||||
(6,4,'copy tftp flash
expect:\]\?
_TFTP_SERVER_IP_
expect:\]\?
_SOURCE_FILE_NAME_
expect:\]\?
_DESTINATION_FILE_NAME_
show flash
reload
expect:confirm
y
config terminal
boot system _DESTINATION_FILE_NAME_');
|
||||
(3,2,'enable
expect:Password:\s*
_enablepass_
term length 0
config terminal
_applyconfigbackup_
exit
'),
|
||||
(4,3,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show version | i IOS Software
exit
'),
|
||||
(5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
'),
|
||||
(6,4,'copy tftp flash
expect:\]\?
_TFTP_SERVER_IP_
expect:\]\?
_SOURCE_FILE_NAME_
expect:\]\?
firmware.bin
show flash
reload
expect:confirm
y
config terminal
boot system firmware.bin'),
|
||||
(7,0,'enable\n
expect:Password:\s*
_enablepass_\n
exit\n'),
|
||||
(8,1,'enable\n
expect:Password:\s*
_enablepass_\n
term length 0\n
capture:show running-config\n
exit\n'),
|
||||
(9,2,'enable\n
expect:Password:\s*
_enablepass_\n
term length 0\n
config terminal\n
_applyconfigbackup_\n
exit\n'),
|
||||
(10,3,'enable\n
expect:Password:\s*
_enablepass_\n
term length 0\n
capture:show version | i IOS Software\n
exit\n'),
|
||||
(11,4,'copy tftp flash\n
expect:\]\?
_TFTP_SERVER_IP_\n
expect:\]\?
_SOURCE_FILE_NAME_\n
expect:\]\?
firmware.bin\n
show flash\n
reload\n
expect:confirm
y\n
config terminal\n
boot system firmware.bin\n'),
|
||||
(12,5,''),
|
||||
(13,7,'enable\n
expect:Password:\s*
_enablepass_\n
term length 0\n
capture:show version | i IOS Software\n
exit\n'),
|
||||
(14,0,'expect:root@%
cli\n
exit\n'),
|
||||
(15,1,'expect:root@%
cli\n
expect:root>
capture:show configuration | no-more\n
capture:\n
quit\n
expect:root@%
exit\n'),
|
||||
(16,2,'expect:root@%
cli\n
expect:root>
configure\n
load override terminal\n
_applyconfigbackup_\n
commit\n
exit\n'),
|
||||
(17,3,'expect:root@%
cli\n
expect:root>
capture:show version|match Junos:\n
capture: \n
quit\n
expect:root@%
exit\n'),
|
||||
(18,4,'expect:root@%
cli\n
expect:root>
save software from tftp _TFTP_SERVER_IP_ _FIRMWARE_NAME_ to flash\n
reset\n
exit\n'),
|
||||
(19,5,''),
|
||||
(20,7,'expect:root@%
cli\n
expect:root>
capture:show version|match Junos:\n
capture: \n
quit\n
expect:root@%
exit\n'),
|
||||
(21,0,'sleep:1
exit\n'),
|
||||
(22,1,'set cli pager off \n
capture:show config running\n
exit\n'),
|
||||
(23,2,'set cli terminal width 500\n
set cli scripting-mode on\n
configure\n
_applyconfigbackup_\n
commit\n'),
|
||||
(24,3,'set cli pager off \n
capture:show system info | match app-version:\n
sleep:1 
expect:app-version:\s*
exit \n'),
|
||||
(25,4,'tftp import software from _TFTP_SERVER_IP_ file _FIRMWARE_NAME_\n
request system software install version\n
reboot\n
exit\n'),
|
||||
(26,5,''),
|
||||
(27,7,'set cli pager off \n
capture:show system info | match app-version:\n
sleep:1 
expect:app-version:\s*
exit \n'),
|
||||
(28,0,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n'),
|
||||
(29,1,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
capture:show running-config\n
exit\n'),
|
||||
(30,2,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
configure\n
_applyconfigbackup_\n
exit\n'),
|
||||
(31,3,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
exit\n'),
|
||||
(32,4,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
configure\n
expect:(config)
restore _TFTP_SERVER_IP_/_FIRMWARE_NAME_\n
expect:Password:\s*
_enablepass_\n
expect:skip port map
yes\n
expect: see the diff
yes\n
sleep:1
expect:Proceed with reboot
yes\n
expect:eof'),
|
||||
(33,5,''),
|
||||
(34,7,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
exit\n'),
|
||||
(35,0,'enable\n
expect:Password:\s*
_enablepass_\n
exit\n'),
|
||||
(36,1,'enable\n
expect:Password:\s*
_enablepass_\n
capture:admin display-config\n
logout\n'),
|
||||
(37,2,''),
|
||||
(38,3,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
logout\n'),
|
||||
(39,4,''),
|
||||
(40,5,''),
|
||||
(41,7,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
logout\n'),
|
||||
(42,0,'enable\n
expect:Password:\s*
_enablepass_\n
exit\n'),
|
||||
(43,1,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show running-config\n
exit\n'),
|
||||
(44,2,'configure terminal\n
load replace /var/tmp/file.conf\n
end\n
write memory\n
exit\n'),
|
||||
(45,3,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
exit\n'),
|
||||
(46,4,'copy tftp flash _TFTP_SERVER_IP_ firmware.bin.swi secondary\n
boot system flash secondary\n
copy tftp flash  _TFTP_SERVER_IP_ firmware.bin primary\n
boot system flash primary\n'),
|
||||
(47,5,''),
|
||||
(48,7,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
exit\n'),
|
||||
(49,0,'sleep:1
exit\n\r'),
|
||||
(50,1,'sleep:1
capture:system resource print\n\r 
exit\n\r'),
|
||||
(51,2,'sleep:1
system backup load name=_nameBackup_ password=_passwordBackup_\n\r
expect:Restore
yes\n\r
exit\n\r'),
|
||||
(52,3,'sleep:1
capture:/system package print\n\r 
exit\n\r'),
|
||||
(53,4,'sleep:1
/system routerboard upgrade\n\r
expect:Do
yes\n\r
exit\n\r'),
|
||||
(54,5,''),
|
||||
(55,7,'sleep:1
capture:/system package print\n\r 
exit\n\r'),
|
||||
(56,6,'snippet');
|
||||
|
||||
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6);
|
||||
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES
|
||||
(1,1),
|
||||
(1,2),
|
||||
(1,3),
|
||||
(1,4),
|
||||
(1,5),
|
||||
(1,6),
|
||||
(2,7),
|
||||
(2,8),
|
||||
(2,9),
|
||||
(2,10),
|
||||
(2,11),
|
||||
(2,12),
|
||||
(3,14),
|
||||
(3,15),
|
||||
(3,16),
|
||||
(3,17),
|
||||
(3,18),
|
||||
(3,19),
|
||||
(4,21),
|
||||
(4,22),
|
||||
(4,23),
|
||||
(4,24),
|
||||
(4,25),
|
||||
(4,26),
|
||||
(5,28),
|
||||
(5,29),
|
||||
(5,30),
|
||||
(5,31),
|
||||
(5,32),
|
||||
(5,33),
|
||||
(6,35),
|
||||
(6,36),
|
||||
(6,37),
|
||||
(6,38),
|
||||
(6,39),
|
||||
(6,40),
|
||||
(7,42),
|
||||
(7,43),
|
||||
(7,44),
|
||||
(7,45),
|
||||
(7,46),
|
||||
(7,47),
|
||||
(8,49),
|
||||
(8,50),
|
||||
(8,51),
|
||||
(8,52),
|
||||
(8,53),
|
||||
(8,54);
|
||||
|
||||
INSERT INTO `tncm_agent_data_template` VALUES
|
||||
(1,'Cisco-Generic','[\"1\"]','[\"2\"]'),
|
||||
(2,'Juniper-Generic','[\"15\"]','[\"3\"]'),
|
||||
(3,'Palo Alto-Generic','[\"16\"]','[\"4\"]'),
|
||||
(4,'A10-Generic','[\"17\"]','[\"5\"]'),
|
||||
(5,'Alcatel-Generic','[\"4\"]','[\"6\"]'),
|
||||
(6,'Aruba-Generic','[\"18\"]','[\"7\"]'),
|
||||
(7,'Mikrotik-Generic','[\"3\"]','[\"8\"]');
|
||||
|
||||
INSERT INTO `tncm_agent_data_template_scripts`(`id_agent_data_template`, `id_script`) VALUES
|
||||
(1,13),
|
||||
(2,20),
|
||||
(3,27),
|
||||
(4,34),
|
||||
(5,41),
|
||||
(6,48),
|
||||
(7,55);
|
||||
|
||||
INSERT INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar');
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ def _print_debug(
|
|||
####
|
||||
# Internal use only: Get AES cipher
|
||||
#########################################################################################
|
||||
def _get_cipher(
|
||||
def _get_cipher_AES(
|
||||
password: str = _PASSWORD
|
||||
) -> AES:
|
||||
'''
|
||||
|
@ -78,7 +78,7 @@ def encrypt_AES(
|
|||
Returns:
|
||||
str: The encrypted string in base64 encoding.
|
||||
'''
|
||||
cipher = _get_cipher(password)
|
||||
cipher = _get_cipher_AES(password)
|
||||
|
||||
try:
|
||||
msg_padded = pad(str_to_encrypt.encode(), AES.block_size, style='pkcs7')
|
||||
|
@ -106,11 +106,91 @@ def decrypt_AES(
|
|||
Returns:
|
||||
str: The decrypted string.
|
||||
'''
|
||||
cipher = _get_cipher(password)
|
||||
cipher = _get_cipher_AES(password)
|
||||
|
||||
try:
|
||||
decrypted_str = unpad(cipher.decrypt(base64.b64decode(str_to_decrypt)), AES.block_size, style='pkcs7').decode().strip()
|
||||
except:
|
||||
decrypted_str = ''
|
||||
|
||||
return decrypted_str
|
||||
|
||||
####
|
||||
# Internal use only: Get Rijndael cipher
|
||||
#########################################################################################
|
||||
def _get_cipher_Rijndael(
|
||||
password: str = _PASSWORD
|
||||
) -> AES:
|
||||
'''
|
||||
Internal use only: Get Rijndael cipher for encryption and decryption.
|
||||
|
||||
Args:
|
||||
password (str): The password used to derive the encryption key.
|
||||
|
||||
Returns:
|
||||
AES: An AES cipher instance for encryption and decryption.
|
||||
'''
|
||||
key = b''
|
||||
msg = password.encode('utf-8')
|
||||
hash_obj = hmac.new(key, msg, hashlib.sha256)
|
||||
hash_result = hash_obj.digest()
|
||||
hash_base64 = base64.b64encode(hash_result)[:16].decode()
|
||||
|
||||
return AES.new(hash_base64.encode(), AES.MODE_ECB)
|
||||
|
||||
####
|
||||
# Return encrypted string
|
||||
#########################################################################################
|
||||
def encrypt_Rijndael(
|
||||
str_to_encrypt: str = "",
|
||||
password: str = _PASSWORD
|
||||
) -> str:
|
||||
'''
|
||||
Encrypt a string using Rijndael encryption.
|
||||
|
||||
Args:
|
||||
str_to_encrypt (str): The string to be encrypted.
|
||||
password (str): The password used to derive the encryption key.
|
||||
|
||||
Returns:
|
||||
str: The encrypted string in base64 encoding.
|
||||
'''
|
||||
cipher = _get_cipher_Rijndael(password)
|
||||
|
||||
try:
|
||||
padded_data = str_to_encrypt.encode()
|
||||
missing = 16 - (len(padded_data) % 16)
|
||||
padded_data += bytes([0] * missing) if missing != 16 else b''
|
||||
|
||||
b64str = base64.b64encode(cipher.encrypt(padded_data)).decode()
|
||||
except:
|
||||
b64str = ''
|
||||
|
||||
return b64str
|
||||
|
||||
####
|
||||
# Return decrypted string
|
||||
#########################################################################################
|
||||
def decrypt_Rijndael(
|
||||
str_to_decrypt: str = "",
|
||||
password: str = _PASSWORD
|
||||
) -> str:
|
||||
'''
|
||||
Decrypt an encrypted string using Rijndael decryption.
|
||||
|
||||
Args:
|
||||
str_to_decrypt (str): The encrypted string to be decrypted.
|
||||
password (str): The password used to derive the encryption key.
|
||||
|
||||
Returns:
|
||||
str: The decrypted string.
|
||||
'''
|
||||
cipher = _get_cipher_Rijndael(password)
|
||||
|
||||
try:
|
||||
decrypted_data = cipher.decrypt(base64.b64decode(str_to_decrypt))
|
||||
decrypted_str = decrypted_data.rstrip(b'\x00').decode()
|
||||
except:
|
||||
decrypted_str = ''
|
||||
|
||||
return decrypted_str
|
Loading…
Reference in New Issue