2013-09-05 Miguel de Dios <miguel.dedios@artica.es>
* lib/PandoraFMS/PluginServer.pm: fixed the lost decode html entities for the value in the macros. * util/plugin/dummy_plugin.pl: added tiny plugin server with only purpose to testing. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8744 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
14cd85bd03
commit
172fc500ec
|
@ -1,3 +1,11 @@
|
|||
2013-09-05 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* lib/PandoraFMS/PluginServer.pm: fixed the lost decode html
|
||||
entities for the value in the macros.
|
||||
|
||||
* util/plugin/dummy_plugin.pl: added tiny plugin server with only
|
||||
purpose to testing.
|
||||
|
||||
2013-09-04 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/Core.pm,
|
||||
|
|
|
@ -162,17 +162,17 @@ sub data_consumer ($$) {
|
|||
|
||||
# Build command to execute
|
||||
my $command = $plugin->{'execute'};
|
||||
|
||||
|
||||
if (!defined($plugin->{'parameters'})){
|
||||
$plugin->{'parameters'} = "";
|
||||
}
|
||||
|
||||
my $parameters = $plugin->{'parameters'};
|
||||
|
||||
|
||||
if (!defined($module->{'macros'})){
|
||||
$module->{'macros'} = "";
|
||||
}
|
||||
|
||||
|
||||
# Plugin macros
|
||||
eval {
|
||||
if ($module->{'macros'} ne '') {
|
||||
|
@ -182,7 +182,9 @@ sub data_consumer ($$) {
|
|||
if(ref($macros) eq "HASH") {
|
||||
foreach my $macro_id (keys(%macros))
|
||||
{
|
||||
$parameters =~ s/$macros{$macro_id}{'macro'}/$macros{$macro_id}{'value'}/g;
|
||||
my $macro_value = safe_output($macros{$macro_id}{'value'});
|
||||
|
||||
$parameters =~ s/$macros{$macro_id}{'macro'}/$macro_value/g;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -215,13 +217,13 @@ sub data_consumer ($$) {
|
|||
|
||||
$command .= ' ' . $parameters;
|
||||
|
||||
$command = decode_entities($command);
|
||||
$command = safe_output($command);
|
||||
|
||||
logger ($pa_config, "Executing AM # $module_id plugin command '$command'", 9);
|
||||
|
||||
# Execute command
|
||||
$command = $pa_config->{'plugin_exec'} . ' ' . $timeout . ' ' . $command;
|
||||
|
||||
|
||||
my $module_data;
|
||||
eval {
|
||||
$module_data = `$command`;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
open STDOUT, '>', "/var/log/pandora/pandora_server.log";
|
||||
|
||||
print "------------INIT DUMMY PLUGIN------------------\n";
|
||||
print Dumper(@ARGV) . "\n";
|
||||
print "------------END DUMMY PLUGIN------------------\n";
|
||||
|
||||
close(STDOUT);
|
||||
|
||||
exit 1;
|
Loading…
Reference in New Issue