Pandora FMS Community

Register Server Plugin without a file?

aeleus · 24 may 2024, 16:56 · 6 mensajes · 96 visitas

  1. Inicio del debate

    I 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.9

  2. Hi aeleus.

    Yes, you can configure the plugin directly in the command field using as many macros as you need "_fieldX_".

    You will need to create as many macros as the plugin needs as customisable parameters.

    Best regards,
    Víc.

  3. 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?

  4. Hi aeleus,

    I noticed that you have not attached a file in "filename", can you add one?

    Best regards,
    Víc.

  5. Hi aeleus,

    I noticed that you have not attached a file in "filename", can you add one?

    Best regards,
    Víc.

  6. 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.

Entra en tu cuenta para publicar.