2013-09-12 Ramon Novoa <rnovoa@artica.es>
* NetBSD/pandora_server.conf, FreeBSD/pandora_server.conf, conf/pandora_server.conf.new: Removed an unused token. * lib/PandoraFMS/DB.pm, lib/PandoraFMS/Core.pm: Changed the module status macro to return a string instead of the numeric value. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8760 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
ec48818bc5
commit
72883e40f4
|
@ -1,3 +1,13 @@
|
|||
2013-09-12 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* NetBSD/pandora_server.conf,
|
||||
FreeBSD/pandora_server.conf,
|
||||
conf/pandora_server.conf.new: Removed an unused token.
|
||||
|
||||
* lib/PandoraFMS/DB.pm,
|
||||
lib/PandoraFMS/Core.pm: Changed the module status macro to return a
|
||||
string instead of the numeric value.
|
||||
|
||||
2013-09-09 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* conf/pandora_server.conf.new,
|
||||
|
|
|
@ -392,11 +392,6 @@ snmp_threads 2
|
|||
|
||||
block_size 15
|
||||
|
||||
# Enable (1) or disable (0) Pandora FMS Netflow Server.
|
||||
# You need to install package nfcapd before try to use this feature.
|
||||
|
||||
netflowserver 1
|
||||
|
||||
# Path to the netflow daemon nfcapd.
|
||||
|
||||
netflow_daemon /usr/local/bin/nfcapd
|
||||
|
|
|
@ -386,11 +386,6 @@ snmp_threads 2
|
|||
|
||||
block_size 15
|
||||
|
||||
# Enable (1) or disable (0) Pandora FMS Netflow Server.
|
||||
# You need to install package nfcapd before try to use this feature.
|
||||
|
||||
netflowserver 1
|
||||
|
||||
# If set to 1, process XML data files in a stack instead of a queue. 0 by default.
|
||||
# WARNING: Incremental modules will not work properly if dataserver_lifo is set to 1!!!
|
||||
|
||||
|
|
|
@ -386,11 +386,6 @@ snmp_threads 2
|
|||
|
||||
block_size 15
|
||||
|
||||
# Enable (1) or disable (0) Pandora FMS Netflow Server.
|
||||
# You need to install package nfcapd before try to use this feature.
|
||||
|
||||
netflowserver 1
|
||||
|
||||
# If set to 1, process XML data files in a stack instead of a queue. 0 by default.
|
||||
# WARNING: Incremental modules will not work properly if dataserver_lifo is set to 1!!!
|
||||
|
||||
|
|
|
@ -804,7 +804,7 @@ sub pandora_execute_action ($$$$$$$$$;$) {
|
|||
_module_ => (defined ($module)) ? $module->{'nombre'} : '',
|
||||
_modulegroup_ => (defined ($module)) ? (get_module_group_name ($dbh, $module->{'id_module_group'}) || '') : '',
|
||||
_moduledescription_ => (defined ($module)) ? $module->{'descripcion'} : '',
|
||||
_modulestatus_ => (defined ($module)) ? get_agentmodule_status($pa_config, $dbh, $module->{'id_agente_modulo'}) : '',
|
||||
_modulestatus_ => (defined ($module)) ? get_agentmodule_status_str($pa_config, $dbh, $module->{'id_agente_modulo'}) : '',
|
||||
_moduletags_ => (defined ($module)) ? pandora_get_module_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '',
|
||||
_id_agent_ => (defined ($module)) ? $module->{'id_agente'} : '',
|
||||
_id_alert_ => (defined ($alert->{'id_template_module'})) ? $alert->{'id_template_module'} : '',
|
||||
|
|
|
@ -82,6 +82,7 @@ our @EXPORT = qw(
|
|||
get_agent_status
|
||||
get_agent_modules
|
||||
get_agentmodule_status
|
||||
get_agentmodule_status_str
|
||||
get_agentmodule_data
|
||||
$RDBMS
|
||||
$RDBMS_QUOTE
|
||||
|
@ -305,6 +306,24 @@ sub get_agentmodule_status($$$) {
|
|||
return $status;
|
||||
}
|
||||
|
||||
########################################################################
|
||||
## Return the status of an agent module as a string.
|
||||
########################################################################
|
||||
sub get_agentmodule_status_str($$$) {
|
||||
my ($pa_config, $dbh, $agent_module_id) = @_;
|
||||
|
||||
my $status = get_db_value($dbh, 'SELECT estado
|
||||
FROM tagente_estado
|
||||
WHERE id_agente_modulo = ?', $agent_module_id);
|
||||
|
||||
return 'Normal' if ($status == 0);
|
||||
return 'Critical' if ($status == 1);
|
||||
return 'Warning' if ($status == 2);
|
||||
return 'Unknown' if ($status == 3);
|
||||
return 'Not init' if ($status == 4);
|
||||
return 'N/A';
|
||||
}
|
||||
|
||||
########################################################################
|
||||
## SUB get_get_status (agent_id)
|
||||
## Return agent status, given "agent_id"
|
||||
|
|
Loading…
Reference in New Issue