Bienvenido a la comunidad de Pandora FMS › Forums › Community support › Register Server Plugin without a file?
-
Register Server Plugin without a file?
Posted by aeleus on mayo 24, 2024 at 16:56I am trying to register a simple plugin that runs a command and does not include a script file. The following plugin_definition.ini works, but it includes the file (test.pl) and the plugin command looks like this:
my command /var/www/html/pandora_console/attachment/plugin/test.pl
[plugin_definition]
name = Test Plugin
description = “A test plugin”
timeout = 20
filename = test.pl
execution_command = my command
execution_postcommand =
parameters = -a _field1_
plugin_type = 0
total_modules_provided = 0
total_macros_provided = 1
[macro_1]
hide = 0
description = “Agent name (obligatory)”
help = “The name of the agent for the modules discovered”
value =
I would like to be able to eliminate the test.pl file and have the command be simply “my command”.
If “filename=” or is omitted, the plugin fails to register.
Version v7.0NG.776 – Community
Rocky Linux 8.9aeleus replied 5 months, 3 weeks ago 2 Members · 5 Replies -
5 Replies
-
-
::
Thank you for the response, Vic.
I understand that I can do as you show using the UI. I have about 50 plugins to create. That would mean individually creating and editing each plugin. I would like to make this as automated and repeatable as possible.
Based on your screenshot, this is how the plugin_definition.ini might look:
[plugin_definition]
name = Test Plugin
description = “A test plugin”
timeout = 20
filename =
execution_command = echo
execution_postcommand =
parameters = _field1_ _field2_
plugin_type = 0
total_modules_provided = 0
total_macros_provided = 2
[macro_1]
hide = 0
description = “Field 1”
help = “Field1: Type String”
value = “This is a plugin”
[macro_2]
hide = 0
description = “Field 2”
help = “”
value = “executed by the Pandora FMS server.”
When zipped into a pspz2 file, this plugin fails to register and be created. Am I doing something wrong?
-
-
-
-
::
Yes, I have tried it with an attached file. That is the result I show at the beginning of this thread. As you can see, it places the file here: /var/www/html/pandora_console/attachment/plugin/test.pl
It also creates a command that looks like this:
my command /var/www/html/pandora_console/attachment/plugin/test.pl
Not what I expect or want.Thanks for the replies, but I’ve solved my problem (more or less) by using a combination of the CLI and DB calls to fill in the gaps where the CLI falls short – that is for a different discussion.
-