Hello Guest

Author Topic: Configure Historical data parameter from configuration file or plugins  (Read 237 times)

0 Members and 1 Guest are viewing this topic.

Offline dstoian

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile

Good evening,

I have a hard time configuring "Historical data" parameter using the agent configuration file or custom plugins.
This is very handy when thousand modules needs to be configured and just for a limited number of modules historical data it's needed.

I know there are workaround with Policy and Bulk editing of modules but this is just additional work, especially for free version without Policy support.

The API cand retrieve parameter module_history_data along with "get module_properties".
It can also set this parameter when using "set create_plugin_module".

But if configuration files are automatically generated with CHEF and then the agents are installed automatically module_history_data it's not working.
You need an additional API call to disable this parameter.

Examples not working:

In configuration file

module_begin
module_name Docker_service
module_group Application
module_type generic_proc
module_exec /etc/init.d/docker status | grep process | wc -l
module_description Docker service status
module_history_data 0
module_end

In ruby plugins:

  puts "<module>\n"
  puts "<name><![CDATA[Name2]]></name>\n"
  puts "<module_group><![CDATA[Application]]></module_group>\n"
  puts "<type><![CDATA[generic_data]]></type>\n"
  puts "<description><![CDATA[Healty status]]></description>\n"
  puts "<unit><![CDATA[]]></unit>\n"
  puts "<min_critical><![CDATA[1]]></min_critical>\n"
  puts "<max_critical><![CDATA[100]]></max_critical>\n"
  puts "<module_history_data><![CDATA[100]]></module_history_data>\n"
  puts "<data><![CDATA[#{@data}]]></data>\n"
  puts "</module>\n"

  puts "<module>\n"
  puts "<name><![CDATA[Name2]]></name>\n"
  puts "<module_group><![CDATA[Application]]></module_group>\n"
  puts "<type><![CDATA[generic_data]]></type>\n"
  puts "<description><![CDATA[Healty status]]></description>\n"
  puts "<unit><![CDATA[]]></unit>\n"
  puts "<min_critical><![CDATA[1]]></min_critical>\n"
  puts "<max_critical><![CDATA[100]]></max_critical>\n"
  puts "<history_data><![CDATA[100]]></history_data>\n"
  puts "<data><![CDATA[#{@data}]]></data>\n"
  puts "</module>\n"

Is this parameter usable in this way, or can only be configure via API, bulk editing, Policies?

Thank you very much.

Offline dstoian

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Configure Historical data parameter from configuration file or plugins
« Reply #1 on: January 17, 2017, 07:34:15 AM »
No one trying to set up the history right from the config file ?

Offline antonio.s

  • Administrator
  • Smart member
  • *****
  • Posts: 343
  • Karma: 5
    • View Profile
Re: Configure Historical data parameter from configuration file or plugins
« Reply #2 on: January 17, 2017, 08:04:05 AM »
Hello dstoian,

It is not possible to do it from the configuration file, is not an XML parameter that the serve can read. However, there are options using CLI and API that may help you, take a look at them here:

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

http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Annex_ExternalAPI#set_update_data_module

Kind regards,
Antonio.

Offline dstoian

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Configure Historical data parameter from configuration file or plugins
« Reply #3 on: January 17, 2017, 10:51:18 PM »
Hello Antonio,

It's clear now. Thank you very much.