mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
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
2f42ff5fc4
commit
0f04a5693f
@ -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>
|
2013-09-04 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm,
|
* lib/PandoraFMS/Core.pm,
|
||||||
|
@ -162,17 +162,17 @@ sub data_consumer ($$) {
|
|||||||
|
|
||||||
# Build command to execute
|
# Build command to execute
|
||||||
my $command = $plugin->{'execute'};
|
my $command = $plugin->{'execute'};
|
||||||
|
|
||||||
if (!defined($plugin->{'parameters'})){
|
if (!defined($plugin->{'parameters'})){
|
||||||
$plugin->{'parameters'} = "";
|
$plugin->{'parameters'} = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $parameters = $plugin->{'parameters'};
|
my $parameters = $plugin->{'parameters'};
|
||||||
|
|
||||||
if (!defined($module->{'macros'})){
|
if (!defined($module->{'macros'})){
|
||||||
$module->{'macros'} = "";
|
$module->{'macros'} = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Plugin macros
|
# Plugin macros
|
||||||
eval {
|
eval {
|
||||||
if ($module->{'macros'} ne '') {
|
if ($module->{'macros'} ne '') {
|
||||||
@ -182,7 +182,9 @@ sub data_consumer ($$) {
|
|||||||
if(ref($macros) eq "HASH") {
|
if(ref($macros) eq "HASH") {
|
||||||
foreach my $macro_id (keys(%macros))
|
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 .= ' ' . $parameters;
|
||||||
|
|
||||||
$command = decode_entities($command);
|
$command = safe_output($command);
|
||||||
|
|
||||||
logger ($pa_config, "Executing AM # $module_id plugin command '$command'", 9);
|
logger ($pa_config, "Executing AM # $module_id plugin command '$command'", 9);
|
||||||
|
|
||||||
# Execute command
|
# Execute command
|
||||||
$command = $pa_config->{'plugin_exec'} . ' ' . $timeout . ' ' . $command;
|
$command = $pa_config->{'plugin_exec'} . ' ' . $timeout . ' ' . $command;
|
||||||
|
|
||||||
my $module_data;
|
my $module_data;
|
||||||
eval {
|
eval {
|
||||||
$module_data = `$command`;
|
$module_data = `$command`;
|
||||||
|
16
pandora_server/util/plugin/dummy_plugin.pl
Executable file
16
pandora_server/util/plugin/dummy_plugin.pl
Executable file
@ -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…
x
Reference in New Issue
Block a user