Metadata-Version: 2.4
Name: pandoraPlugintools-basic
Version: 1.0.0
Summary: A plugin tool set of basic functions for pandorafms
Home-page: https://github.com/pandorafms/pandoraPlugintoolsBasic
Author: PandoraFMS projects department
Author-email: <info@pandorafms.com>
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: summary

# pandoraPlugintoolsBasic
Basic version of plugintools.

# Python: module plugintools-basic for PandoraFMS Developers

pandoraPluginToolsBasic is a library that aims to help the creation of scripts and their integration in Pandora FMS. This is a simplified and lighter version. If you want to use the plugin tools with SNMP or encryption functions, it is recommended to use the standard version.

[PluginTools Reference Documentation](https://pandorafms.com/guides/public/books/plugintools)

The package includes the following modules. Each one has different functions that facilitate and automate the data integration in Pandora FMS: 

**general**

Module containing general purpose functions, useful in the creation of plugins for PandoraFMS.

**threads**

Module containing threading purpose functions, useful to run parallel functions.

**agents**

Module that contains functions oriented to the creation of Pandora FMS agents

**modules**

Module that contains functions oriented to the creation of Pandora FMS modules.

**transfer**

Module containing functions oriented to file transfer and data sending to Pandora FMS server.

**discovery**

Module containing functions oriented to the creation of Pandora FMS discovery plugins.

**output**

Module containing functions oriented to output and return data.

## Example 

``` python
import pandoraPluginTools-basic as ppt

## Define agent
server_name = "WIN-SERV"

agent=ppt.init_agent({
    "agent_name"  : ppt.generate_md5(server_name),
    "agent_alias" : server_name,
    "description" : "Default Windows server"
})

## Define modules
modules=[]

data = 10
modules.append({
    "name" : "CPU usage",
    "type" : "generic_data",
    "value": data,
    "desc" : "Percentage of CPU utilization",
    "unit" : "%"
})

## Generate and transfer XML
xml_content = ppt.print_agent(agent, modules)
xml_file = ppt.write_xml(xml_content, agent["agent_name"])
ppt.transfer_xml(
    xml_file,
    transfer_mode="tentacle",
    tentacle_ip="192.168.1.20",
    tentacle_port="41121",
)
```

