Merge branch 'ent-10906-Carga-de-datos-de-demo' of brutus.artica.es:artica/pandorafms into ent-10906-Carga-de-datos-de-demo

This commit is contained in:
alejandro.campos@artica.es 2023-12-05 12:20:58 +01:00
commit cfc1992d26
3 changed files with 167 additions and 34 deletions

View File

@ -274,24 +274,24 @@ group[37]="Networking"
oid[1]=".1.3.6.1.4.1.9.9.41.1.2.3.1.2.0" oid[1]=".1.3.6.1.4.1.9.9.41.1.2.3.1.2.0"
value[1]="RANDOM;0;100" value[1]="RANDOM;0;100"
snmp_type[1]="6" snmp_type[1]="6"
chance_percent[1]="30" chance_percent[1]="20"
oid[2]=".1.3.6.1.4.1.9.9.41.1.2.3.1.3.0" oid[2]=".1.3.6.1.4.1.9.9.41.1.2.3.1.3.0"
value[2]="RANDOM;0;100" value[2]="RANDOM;0;100"
snmp_type[2]="6" snmp_type[2]="6"
chance_percent[2]="30" chance_percent[2]="20"
oid[3]=".1.3.6.1.4.1.9.9.41.1.2.3.1.4.0" oid[3]=".1.3.6.1.4.1.9.9.41.1.2.3.1.4.0"
value[3]="RANDOM;0;100" value[3]="RANDOM;0;100"
snmp_type[3]="6" snmp_type[3]="6"
chance_percent[3]="30" chance_percent[3]="20"
oid[4]=".1.3.6.1.4.1.9.9.41.1.2.3.1.5.0" oid[4]=".1.3.6.1.4.1.9.9.41.1.2.3.1.5.0"
value[4]="RANDOM;0;100" value[4]="RANDOM;0;100"
snmp_type[4]="6" snmp_type[4]="6"
chance_percent[4]="30" chance_percent[4]="20"
oid[5]=".1.3.6.1.4.1.9.9.41.1.2.3.1.6.0" oid[5]=".1.3.6.1.4.1.9.9.41.1.2.3.1.6.0"
value[5]="RANDOM;0;100" value[5]="RANDOM;0;100"
snmp_type[5]="6" snmp_type[5]="6"
chance_percent[5]="30" chance_percent[5]="20"

View File

@ -5,39 +5,61 @@ group="Demo dashboard"
[dashboard_items] [dashboard_items]
title[1]="Agents sunburst" title[1]="Groups status"
type[1]="service_map" type[1]="system_group_status"
service_name[1]="Sunburst service"
x[1]="0" x[1]="0"
y[1]="0" y[1]="0"
width[1]="6" width[1]="5"
height[1]="10" height[1]="4"
show_sunburst[1]=true
title[2]="Linux CPU Load" title[2]="Network map"
type[2]="custom_graph" type[2]="network_map"
graph_name[2]="Linux CPU Load" x[2]="5"
x[2]="6"
y[2]="0" y[2]="0"
width[2]="6" width[2]="7"
height[2]="5" height[2]="6"
graph_type[2]="s_area" map_name[2]="Demo sunburst network map"
interval[2]="86400"
title[3]="Linux Disk Usage" title[3]="Module histogram"
type[3]="custom_graph" type[3]="graph_module_histogram"
graph_name[3]="Linux Disk Usage" x[3]="0"
x[3]="6" y[3]="4"
y[3]="5" width[3]="5"
width[3]="6" height[3]="2"
height[3]="5" agent_name[3]="demo-global-agent-1"
graph_type[3]="line" module[3]="Host Alive"
interval[3]="86400" interval[3]="86400"
title[4]="Network map" title[4]="List of latest events"
type[4]="network_map" type[4]="events_list"
map_name[4]="Demo network map"
x[4]="0" x[4]="0"
y[4]="10" y[4]="6"
width[4]="12" width[4]="12"
height[4]="10" height[4]="5"
title[5]="Top N events by agent"
type[5]="top_n_events_by_group"
x[5]="6"
y[5]="11"
width[5]="6"
height[5]="8"
title[6]="Top N of agent modules"
type[6]="top_n"
x[6]="0"
y[6]="11"
width[6]="6"
height[6]="4"
agent_name[6]="cisco-.*"
module[6]=".*ifOutOctets"
interval[6]="86400"
title[7]="Top N of agent modules"
type[7]="top_n"
x[7]="0"
y[7]="15"
width[7]="6"
height[7]="4"
agent_name[7]="cisco-.*"
module[7]=".*ifInOctets"
interval[7]="86400"

View File

@ -2933,7 +2933,7 @@ if ($action === 'create_demo_data') {
'agentId' => "$agent_id", 'agentId' => "$agent_id",
'metaconsoleId' => 0, 'metaconsoleId' => 0,
'moduleId' => "$module_id", 'moduleId' => "$module_id",
'period' => (isset($items_array['interval']) === false) ? $items_array['interval'] : '86400', 'period' => (isset($items_array['interval']) === true) ? $items_array['interval'] : '86400',
'showLegend' => 1, 'showLegend' => 1,
'projection_switch' => false, 'projection_switch' => false,
'period_projection' => '300', 'period_projection' => '300',
@ -2980,7 +2980,7 @@ if ($action === 'create_demo_data') {
'background' => '#ffffff', 'background' => '#ffffff',
'id_graph' => $id_graph, 'id_graph' => $id_graph,
'type' => $graph_type_id, 'type' => $graph_type_id,
'period' => (isset($items_array['interval']) === false) ? $items_array['interval'] : 86400, 'period' => (isset($items_array['interval']) === true) ? $items_array['interval'] : 86400,
'showLegend' => 1, 'showLegend' => 1,
]; ];
@ -3056,6 +3056,117 @@ if ($action === 'create_demo_data') {
$order++; $order++;
} }
if ($items_array['type'] === 'system_group_status') {
$options_data = [
'title' => $title,
'background' => '#ffffff',
'groupId' => ["0"],
'status' => ["4,1,0,2"],
'sunburst' => false,
];
$order++;
}
if ($items_array['type'] === 'graph_module_histogram') {
if (isset($items_array['agent_name']) === false
|| isset($items_array['module']) === false
) {
// The above fields are required for this item.
continue;
}
$matched_agents = agents_get_agents(
['nombre' => $items_array['agent_name']],
['id_agente'],
'AR',
[
'field' => 'nombre',
'order' => 'ASC',
],
false,
0,
false,
false,
false
);
$agent_id = $matched_agents[0]['id_agente'];
if (!($agent_id > 0)) {
continue;
}
$module_row = modules_get_agentmodule_id(io_safe_input($items_array['module']), $agent_id);
$module_id = $module_row['id_agente_modulo'];
if (!($module_id > 0)) {
continue;
}
$options_data = [
'title' => $title,
'background' => '#ffffff',
'agentId' => "$agent_id",
'metaconsoleId' => 0,
'moduleId' => "$module_id",
'period' => (isset($items_array['interval']) === true) ? $items_array['interval'] : '86400',
'sizeLabel' => 30
];
$order++;
}
if ($items_array['type'] === 'events_list') {
$options_data = [
'title' => $title,
'background' => '#ffffff',
'eventType' => 0,
'maxHours' => 8,
'limit' => 20,
'eventStatus' => -1,
'severity' => -1,
'groupId' => [""],
'tagsId' => [""],
'groupRecursion' => 0,
'customFilter' => -1,
'columns_events_widget' => ["mini_severity,evento,estado,agent_name,timestamp", ""]
];
$order++;
}
if ($items_array['type'] === 'top_n_events_by_group') {
$options_data = [
'title' => $title,
'background' => '#ffffff',
'amountShow' => 10,
'maxHours' => 8,
'groupId' => ["0"],
'legendPosition' => "bottom",
'show_total_data' => 0
];
$order++;
}
if ($items_array['type'] === 'top_n') {
$options_data = [
'title' => $title,
'background' => '#ffffff',
'agent' => (isset($items_array['agent_name']) === true) ? $items_array['agent_name'] : '.*',
'module' => (isset($items_array['module']) === true) ? $items_array['module'] : '.*',
'period' => (isset($items_array['interval']) === true) ? $items_array['interval'] : '86400',
'quantity' => '10',
'order' => '2',
'display' => '0',
'type_graph' => 'bar_vertical',
'legend' => 'agent_module'
];
$order++;
}
$item_x = $items_array['x']; $item_x = $items_array['x'];
$item_y = $items_array['y']; $item_y = $items_array['y'];
$item_width = $items_array['width']; $item_width = $items_array['width'];