Pandora FMS community forums
Configure Historical data parameter from configuration file or plugins - Printable Version

+- Pandora FMS community forums (http://pandorafms.org/forum)
+-- Forum: Pandora FMS (http://pandorafms.org/forum/forum-3.html)
+--- Forum: General monitoring discussion (http://pandorafms.org/forum/forum-6.html)
+--- Thread: Configure Historical data parameter from configuration file or plugins (/thread-8188.html)



Configure Historical data parameter from configuration file or plugins - dstoian - 01-16-2017


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.


Re: Configure Historical data parameter from configuration file or plugins - dstoian - 01-17-2017

No one trying to set up the history right from the config file ?


Re: Configure Historical data parameter from configuration file or plugins - antonio - 01-17-2017

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.


Re: Configure Historical data parameter from configuration file or plugins - dstoian - 01-18-2017

Hello Antonio,

It's clear now. Thank you very much.