mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch '4727-macros-grupos-secundarios' into 'develop'
4727 macros grupos secundarios See merge request artica/pandorafms!2811
This commit is contained in:
commit
37ffff12eb
@ -77,6 +77,7 @@ Besides the defined module macros, the following macros are available:
|
|||||||
<li>_policy_: Name of the policy that the module belongs to (if applies).</li>
|
<li>_policy_: Name of the policy that the module belongs to (if applies).</li>
|
||||||
<li>_prevdata_: Module previous data before the alert has been triggered.</li>
|
<li>_prevdata_: Module previous data before the alert has been triggered.</li>
|
||||||
<li>_rca_: Root cause analysis chain (only for services).</li>
|
<li>_rca_: Root cause analysis chain (only for services).</li>
|
||||||
|
<li>_secondarygroups_: List of all secondary groups of the agent.</li>
|
||||||
<li>_server_ip_: Ip of server assigned to agent. </li>
|
<li>_server_ip_: Ip of server assigned to agent. </li>
|
||||||
<li>_server_name_: Name of server assigned to agent. </li>
|
<li>_server_name_: Name of server assigned to agent. </li>
|
||||||
<li>_target_ip_: IP address for the module’s target.</li>
|
<li>_target_ip_: IP address for the module’s target.</li>
|
||||||
|
@ -77,6 +77,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
|
|||||||
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
|
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
|
||||||
<li>_prevdata_: Dato previo antes de disparase la alerta.</li>
|
<li>_prevdata_: Dato previo antes de disparase la alerta.</li>
|
||||||
<li>_rca_: Cadena de análasis de causa raíz (sólo para servicios).</li>
|
<li>_rca_: Cadena de análasis de causa raíz (sólo para servicios).</li>
|
||||||
|
<li>_secondarygroups_: Lista de todos los grupos secundarios del agente.</li>
|
||||||
<li>_server_ip_: Ip del servidor al que el agente está asignado. </li>
|
<li>_server_ip_: Ip del servidor al que el agente está asignado. </li>
|
||||||
<li>_server_name_: Nombre del servidor al que el agente está asignado. </li>
|
<li>_server_name_: Nombre del servidor al que el agente está asignado. </li>
|
||||||
<li>_target_ip_: Dirección IP del objetivo del módulo.</li>
|
<li>_target_ip_: Dirección IP del objetivo del módulo.</li>
|
||||||
|
@ -77,6 +77,7 @@
|
|||||||
<li>_policy_ : モジュールが属するポリシー名 (存在する場合)</li>
|
<li>_policy_ : モジュールが属するポリシー名 (存在する場合)</li>
|
||||||
<li>_prevdata_ : アラートを発報する前のモジュールデータ</li>
|
<li>_prevdata_ : アラートを発報する前のモジュールデータ</li>
|
||||||
<li>_rca_: Root cause analysis chain (only for services).</li>
|
<li>_rca_: Root cause analysis chain (only for services).</li>
|
||||||
|
<li>_secondarygroups_: エージェントのすべてのセカンダリグループのリスト</li>
|
||||||
<li>_server_ip_ : エージェントが割り当てられているサーバ IP。</li>
|
<li>_server_ip_ : エージェントが割り当てられているサーバ IP。</li>
|
||||||
<li>_server_name_ : エージェントが割り当てられているサーバ名。 </li>
|
<li>_server_name_ : エージェントが割り当てられているサーバ名。 </li>
|
||||||
<li>_target_ip_ : モジュールの対象IPアドレス</li>
|
<li>_target_ip_ : モジュールの対象IPアドレス</li>
|
||||||
|
@ -1129,6 +1129,7 @@ sub pandora_execute_action ($$$$$$$$$;$) {
|
|||||||
_name_tag_ => undef,
|
_name_tag_ => undef,
|
||||||
_all_address_ => undef,
|
_all_address_ => undef,
|
||||||
'_address_\d+_' => undef,
|
'_address_\d+_' => undef,
|
||||||
|
_secondarygroups_ => undef,
|
||||||
);
|
);
|
||||||
|
|
||||||
if ((defined ($extra_macros)) && (ref($extra_macros) eq "HASH")) {
|
if ((defined ($extra_macros)) && (ref($extra_macros) eq "HASH")) {
|
||||||
@ -4117,6 +4118,15 @@ sub on_demand_macro($$$$$$;$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return(defined($field_value)) ? $field_value : '';
|
return(defined($field_value)) ? $field_value : '';
|
||||||
|
} elsif ($macro eq '_secondarygroups_') {
|
||||||
|
my $field_value = '';
|
||||||
|
|
||||||
|
my @groups = get_db_rows ($dbh, 'SELECT tg.nombre from tagent_secondary_group as tsg INNER JOIN tgrupo tg ON tsg.id_group = tg.id_grupo WHERE tsg.id_agent = ?', $module->{'id_agente'});
|
||||||
|
foreach my $element (@groups) {
|
||||||
|
$field_value .= $element->{'nombre'} .",";
|
||||||
|
}
|
||||||
|
chop($field_value);
|
||||||
|
return(defined($field_value)) ? '('.$field_value.')' : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user