Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Configure Historical data parameter from configuration file or plugins
#1

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.
 Reply
#2
No one trying to set up the history right from the config file ?
 Reply
#3
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.
 Reply
#4
Hello Antonio,

It's clear now. Thank you very much.
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes