fixed nome agent for alias agent
This commit is contained in:
parent
0e1c62e644
commit
45ea30e5b3
|
@ -253,3 +253,13 @@ ALTER TABLE tgraph ADD COLUMN `percentil` int(4) unsigned default '0';
|
|||
-- Table `tnetflow_filter`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tnetflow_filter ADD COLUMN `router_ip` TEXT NOT NULL DEFAULT "";
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `treport_custom_sql`
|
||||
-- ---------------------------------------------------------------------
|
||||
UPDATE treport_custom_sql SET `sql` = 'select direccion, alias, comentarios, (select nombre from tgrupo where tgrupo.id_grupo = tagente.id_grupo) as `group` from tagente;'
|
||||
WHERE id = 1;
|
||||
UPDATE treport_custom_sql SET `sql` = 'select (select tagente.alias from tagente where tagente.id_agente = tagente_modulo.id_agente) as agent_nombre, nombre , (select tmodule_group.name from tmodule_group where tmodule_group.id_mg = tagente_modulo.id_module_group) as module_group, module_interval from tagente_modulo where delete_pending = 0 order by nombre;'
|
||||
WHERE id = 2;
|
||||
UPDATE treport_custom_sql SET `sql` = 'select t1.alias as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;'
|
||||
WHERE id = 3;
|
|
@ -901,7 +901,7 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
metaconsole_restore_db();
|
||||
}
|
||||
else {
|
||||
$agent_name = agents_get_name ($idAgent);
|
||||
$agent_name = agents_get_alias ($idAgent);
|
||||
}
|
||||
|
||||
html_print_input_hidden('id_agent', $idAgent);
|
||||
|
|
|
@ -208,8 +208,12 @@ function custom_graphs_print($id_graph, $height, $width, $period,
|
|||
foreach ($sources as $source) {
|
||||
array_push ($modules, $source['id_agent_module']);
|
||||
array_push ($weights, $source['weight']);
|
||||
if ($source['label'] != '')
|
||||
$labels[$source['id_agent_module']] = $source['label'];
|
||||
if ($source['label'] != ''){
|
||||
$item['type'] = 'custom_graph';
|
||||
$item['id_agent'] = agents_get_module_id($source['id_agent_module']);
|
||||
$item['id_agent_module'] = $source['id_agent_module'];
|
||||
$labels[$source['id_agent_module']] = reporting_label_macro($item, $source['label']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -709,7 +709,7 @@ function reporting_SLA($report, $content, $type = 'dinamic',
|
|||
}
|
||||
|
||||
$data = array();
|
||||
$data['agent'] = modules_get_agentmodule_agent_name($sla['id_agent_module']);
|
||||
$data['agent'] = modules_get_agentmodule_agent_alias($sla['id_agent_module']);
|
||||
$data['module'] = modules_get_agentmodule_name($sla['id_agent_module']);
|
||||
$data['max'] = $sla['sla_max'];
|
||||
$data['min'] = $sla['sla_min'];
|
||||
|
@ -819,7 +819,7 @@ function reporting_SLA($report, $content, $type = 'dinamic',
|
|||
// Slice graphs calculation
|
||||
if ($show_graphs) {
|
||||
$dataslice = array();
|
||||
$dataslice['agent'] = modules_get_agentmodule_agent_name ($sla['id_agent_module']);
|
||||
$dataslice['agent'] = modules_get_agentmodule_agent_alias ($sla['id_agent_module']);
|
||||
$dataslice['module'] = modules_get_agentmodule_name ($sla['id_agent_module']);
|
||||
$dataslice['sla_value'] = $data['sla_value'];
|
||||
$dataslice['order'] = $data['sla_value'];
|
||||
|
@ -1689,7 +1689,7 @@ function reporting_agent_module($report, $content) {
|
|||
foreach ($agents as $agent) {
|
||||
$row = array();
|
||||
$row['agent_status'][$agent] = agents_get_status($agent);
|
||||
$row['agent_name'] = agents_get_name($agent);
|
||||
$row['agent_name'] = agents_get_alias($agent);
|
||||
|
||||
$agent_modules = agents_get_modules($agent);
|
||||
|
||||
|
@ -2169,13 +2169,13 @@ function reporting_group_report($report, $content) {
|
|||
$return["date"] = reporting_get_date_text($report, $content);
|
||||
|
||||
$return["data"] = array();
|
||||
|
||||
|
||||
$events = events_get_agent(
|
||||
false,
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
|
@ -3700,7 +3700,7 @@ function reporting_value($report, $content, $type) {
|
|||
$module_name = io_safe_output(
|
||||
modules_get_agentmodule_name($content['id_agent_module']));
|
||||
$agent_name = io_safe_output(
|
||||
modules_get_agentmodule_agent_name ($content['id_agent_module']));
|
||||
modules_get_agentmodule_agent_alias ($content['id_agent_module']));
|
||||
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo',
|
||||
$content ['id_agent_module']);
|
||||
|
||||
|
@ -5206,7 +5206,7 @@ function reporting_availability_graph($report, $content, $pdf=false) {
|
|||
}
|
||||
|
||||
$data = array();
|
||||
$data['agent'] = modules_get_agentmodule_agent_name($sla['id_agent_module']);
|
||||
$data['agent'] = modules_get_agentmodule_agent_alias($sla['id_agent_module']);
|
||||
$data['module'] = modules_get_agentmodule_name($sla['id_agent_module']);
|
||||
$data['max'] = $sla['sla_max'];
|
||||
$data['min'] = $sla['sla_min'];
|
||||
|
@ -5317,7 +5317,7 @@ function reporting_availability_graph($report, $content, $pdf=false) {
|
|||
|
||||
// Slice graphs calculation
|
||||
$dataslice = array();
|
||||
$dataslice['agent'] = modules_get_agentmodule_agent_name ($sla['id_agent_module']);
|
||||
$dataslice['agent'] = modules_get_agentmodule_agent_alias ($sla['id_agent_module']);
|
||||
$dataslice['module'] = modules_get_agentmodule_name ($sla['id_agent_module']);
|
||||
$dataslice['order'] = $data['sla_value'];
|
||||
$dataslice['checks_total'] = $data['checks_total'];
|
||||
|
@ -5504,7 +5504,7 @@ function reporting_general($report, $content) {
|
|||
}
|
||||
|
||||
$mod_name = modules_get_agentmodule_name ($row['id_agent_module']);
|
||||
$ag_name = modules_get_agentmodule_agent_name ($row['id_agent_module']);
|
||||
$ag_name = modules_get_agentmodule_agent_alias ($row['id_agent_module']);
|
||||
$type_mod = modules_get_last_value($row['id_agent_module']);
|
||||
$unit = db_get_value('unit', 'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
|
@ -10329,7 +10329,7 @@ function reporting_label_macro ($item, $label) {
|
|||
case 'alert_report_agent':
|
||||
case 'agent_configuration':
|
||||
if (preg_match("/_agent_/", $label)) {
|
||||
$agent_name = agents_get_name($item['id_agent']);
|
||||
$agent_name = agents_get_alias($item['id_agent']);
|
||||
$label = str_replace("_agent_", $agent_name, $label);
|
||||
}
|
||||
|
||||
|
@ -10368,7 +10368,7 @@ function reporting_label_macro ($item, $label) {
|
|||
case 'MTBF':
|
||||
case 'MTTR':
|
||||
if (preg_match("/_agent_/", $label)) {
|
||||
$agent_name = agents_get_name($item['id_agent']);
|
||||
$agent_name = agents_get_alias($item['id_agent']);
|
||||
$label = str_replace("_agent_", $agent_name, $label);
|
||||
}
|
||||
|
||||
|
|
|
@ -153,8 +153,8 @@ function reporting_html_print_report($report, $mini = false, $report_info = 1) {
|
|||
else
|
||||
$label = '';
|
||||
|
||||
$aux = explode("-",$item['subtitle']);
|
||||
$item['subtitle'] = db_get_value ("alias","tagente","nombre",$item['agent_name']) .' -'. $aux[1];
|
||||
//$aux = explode("-",$item['subtitle']);
|
||||
//$item['subtitle'] = db_get_value ("alias","tagente","nombre",$item['agent_name']) .' -'. $aux[1];
|
||||
|
||||
reporting_html_header($table,
|
||||
$mini, $item['title'],
|
||||
|
@ -165,14 +165,14 @@ function reporting_html_print_report($report, $mini = false, $report_info = 1) {
|
|||
$item['date']['to'],
|
||||
$label);
|
||||
|
||||
$table->data['description_row']['description'] = $item['description'];
|
||||
$table->data['description_row']['description'] = $item['description'];
|
||||
|
||||
if($item['type']=='event_report_agent' || $item['type']=='event_report_group' || $item['type']=='event_report_module'){
|
||||
|
||||
$table->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||
}
|
||||
|
||||
$table->colspan['description_row']['description'] = 3;
|
||||
if($item['type']=='event_report_agent' || $item['type']=='event_report_group' || $item['type']=='event_report_module'){
|
||||
|
||||
$table->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||
}
|
||||
|
||||
$table->colspan['description_row']['description'] = 3;
|
||||
|
||||
switch ($item['type']) {
|
||||
case 'availability':
|
||||
|
@ -1326,14 +1326,10 @@ function reporting_html_agent_module($table, $item) {
|
|||
$list_modules = $first['modules'];
|
||||
|
||||
foreach ($list_modules as $module_name => $module) {
|
||||
$file_name = string2image(
|
||||
ui_print_truncate_text($module_name, 'module_small',
|
||||
false, true, false, '...'),
|
||||
false, false, 6, 270, '#B1B1B1', 'FFF', 4, 0);
|
||||
$table_data .= '<th width="22px">' .
|
||||
html_print_image($file_name, true,
|
||||
array('title' => $module_name)) .
|
||||
"</th>";
|
||||
$file_name = ui_print_truncate_text($module_name, 'module_small',
|
||||
false, true, false, '...');
|
||||
$table_data .= '<th style="padding: 10px;">' .
|
||||
$file_name . "</th>";
|
||||
}
|
||||
|
||||
|
||||
|
@ -1364,14 +1360,16 @@ function reporting_html_agent_module($table, $item) {
|
|||
$textcolor = '#FFF';
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
$file_name = string2image(
|
||||
ui_print_truncate_text($row['agent_name'], 'agent_small',
|
||||
false, true, false, '...'),
|
||||
false, false, 6, 0, $rowcolor, $textcolor, 4, 0);
|
||||
*/
|
||||
$file_name = ui_print_truncate_text($row['agent_name'], 'agent_small',
|
||||
false, true, false, '...');
|
||||
$table_data .= "<td style='background-color: " . $rowcolor . ";'>" .
|
||||
html_print_image($file_name, true,
|
||||
array('title' => $row['agent_name'])) . "</td>";
|
||||
$file_name . "</td>";
|
||||
|
||||
foreach ($row['modules'] as $module_name => $module) {
|
||||
if (is_null($module)) {
|
||||
|
|
|
@ -1009,9 +1009,9 @@ INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`,
|
|||
INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`, `priority`, `id_group`, `special_day`, `wizard_level`) VALUES (3,'Warning condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','','','','','','','','warning','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'','[PANDORA] Alert RECOVERED for WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','','','','','','','',3,0,0,'basic');
|
||||
|
||||
-- treport_custom_sql Data
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (1, 'Monitoring Report Agent', 'select direccion, nombre, comentarios, (select nombre from tgrupo where tgrupo.id_grupo = tagente.id_grupo) as `group` from tagente;');
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (2, 'Monitoring Report Modules', 'select (select tagente.nombre from tagente where tagente.id_agente = tagente_modulo.id_agente) as agent_name, nombre , (select tmodule_group.name from tmodule_group where tmodule_group.id_mg = tagente_modulo.id_module_group) as module_group, module_interval from tagente_modulo where delete_pending = 0 order by agent_name;');
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (3, 'Monitoring Report Alerts', 'select t1.nombre as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;');
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (1, 'Monitoring Report Agent', 'select direccion, alias, comentarios, (select nombre from tgrupo where tgrupo.id_grupo = tagente.id_grupo) as `group` from tagente;');
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (2, 'Monitoring Report Modules', 'select (select tagente.alias from tagente where tagente.id_agente = tagente_modulo.id_agente) as agent_nombre, nombre , (select tmodule_group.name from tmodule_group where tmodule_group.id_mg = tagente_modulo.id_module_group) as module_group, module_interval from tagente_modulo where delete_pending = 0 order by nombre;');
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (3, 'Monitoring Report Alerts', 'select t1.alias as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;');
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (4, 'Group view', 'select t1.nombre, (select count(t3.id_agente) from tagente as t3 where t1.id_grupo = t3.id_grupo) as agents, (SELECT COUNT(t4.id_agente) FROM tagente as t4 WHERE t4.id_grupo = t1.id_grupo AND t4.disabled = 0 AND t4.ultimo_contacto < NOW() - (intervalo / (1/2))) as agent_unknown, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND utimestamp > 0 AND tagente_modulo.id_tipo_modulo NOT IN(21,22,23,24,100) AND (UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) >= (tagente_estado.current_interval / (1/2))) as monitor_unknow, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,24) AND utimestamp = 0) as monitor_no_init, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 0 AND ((UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) < (tagente_estado.current_interval / (1/2)) OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24,100))) AND (utimestamp > 0 OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24)))) as monitor_ok, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 1 AND ((UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) < (tagente_estado.current_interval / (1/2)) OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24,100))) AND utimestamp > 0) as monitor_critical, (SELECT COUNT(talert_template_modules.id) FROM talert_template_modules, tagente_modulo, tagente_estado, tagente WHERE tagente.id_grupo = t1.id_grupo AND tagente_modulo.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente.disabled = 0 AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo AND times_fired > 0) as monitor_alert_fired from tgrupo as t1 where 0 < (select count(t2.id_agente) from tagente as t2 where t1.id_grupo = t2.id_grupo)');
|
||||
|
||||
INSERT INTO `trecon_script` VALUES (2,'IPMI Recon','Specific Pandora FMS Intel DCM Discovery (c) Artica ST 2011 <info@artica.es>

Usage: ./ipmi-recon.pl <task_id> <group_id> <create_incident_flag> <custom_field1> <custom_field2> <custom_field3> <custom_field4>

* custom_field1 = Network i.e.: 192.168.100.0/24
* custom_field2 = Username
* custom_field3 = Password
* custom_field4 = Additional parameters i.e.: -D LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.: 192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional parameters\",\"help\":\"Optional additional parameters such as -D LAN_2_0 to use IPMI ver 2.0 instead of 1.5.  These options will also be passed to the IPMI plugin when the current values are read.\",\"value\":\"\",\"hide\":\"\"}}');
|
||||
|
|
Loading…
Reference in New Issue