Hello Guest

Author Topic: Modify UDP Remote monitoring by CLI  (Read 414 times)

0 Members and 1 Guest are viewing this topic.

Offline ainamori

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Modify UDP Remote monitoring by CLI
« on: October 19, 2016, 04:34:15 PM »
Hi there,

I'd like to know how to change 'Target IP' and 'Port of UDP' on UDP server plugin module.

According to the documents, we can modify the following command, but it doesn't work.
Even though the messages said the followings,  the Target IP and Port section were not changed.

 # perl pandora_manage.pl /etc/pandora/pandora_server.conf  my_module my_agent parameters '1.1.1.1 161'
  [INFO] Updating field 'plugin_parameter' in module 'my_module' of agent 'my_agent' with new value '1.1.1.1 161'

Could you tell me how to change the field by CLI please ?

 http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_CLI

--snip
perl pandora_manage.pl /etc/pandora/pandora_server.conf  <module_name> <agent_name> <field_to_update> <new_value>
 For the plugin modules: module_address, module_port, plugin_name, user, password, parameters
 

Offline enrique_m

  • Administrator
  • Sr. Member
  • *****
  • Posts: 141
  • Karma: 3
    • View Profile
Re: Modify UDP Remote monitoring by CLI
« Reply #1 on: October 20, 2016, 01:40:14 AM »
Hello ainamori,

The option "parameters" doesn't affect your plugin server modules in the latest versions of Pandora. This field is used for older versions, but actually the value of your plugin parameters are stored in the field "macros" from the table "tagente_modulo".

You can use, for example, this query to see it's value (change "N" with your module ID):
Code: [Select]
select id_agente_modulo, id_agente, nombre, macros from tagente_modulo where id_agente_modulo=N;

An option could be update this field in your database.

Another possibility is use the API to update that module. I let you here the section of the wiki.

Kind regards,
Enrique.

Offline ainamori

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Modify UDP Remote monitoring by CLI
« Reply #2 on: October 27, 2016, 03:02:44 PM »
Hi, enrique_m

Thank you for your reply, but if I use the command, I have to know the module ID.
I think that it is difficult to find the module ID by CLI.

Could you tell me if you have another solution please ?

Offline enrique_m

  • Administrator
  • Sr. Member
  • *****
  • Posts: 141
  • Karma: 3
    • View Profile
Re: Modify UDP Remote monitoring by CLI
« Reply #3 on: November 02, 2016, 04:52:03 AM »
Hello ainamori,

Those are the best solutions I can think of. From database you can get your module ID if you know the agent name and module name (both needed to use Pandora CLI). The query could be something like this:
Code: [Select]
select m.id_agente_modulo from tagente a, tagente_modulo m where a.id_agente=m.id_agente and a.nombre="agent_name" and m.nombre="module_name";

If you know that you can update the field "macros" in the table "tagente_modulo" with something like:
Code: [Select]
update tagente_module set macros="new_value_for_field" where id_agente_modulo=N;

Kind regards,
Enrique.

Offline ainamori

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Modify UDP Remote monitoring by CLI
« Reply #4 on: November 23, 2016, 10:20:03 AM »
Hi Enrique,

Thanks a lot.

I'll try to find another way because I think to use the Database directly is not comfortable to us.