Skip to main content

A plugin tool set of basic functions for pandorafms

Project description

pandoraPlugintoolsBasic

pandoraPlugintoolsBasic is a lightweight, dependency-free version of pandoraPlugintools for Pandora FMS plugin development.

It is designed as a drop-in replacement for the most commonly used functionality, with a smaller footprint and simpler deployment.

Install

pip install pandoraPlugintools-basic

Migration from pandoraPlugintools

If your plugin only uses the basic features included in this package, migrate with:

pip uninstall pandoraPlugintools
pip install pandoraPlugintools-basic

Important:

  • This package does not include all features from the full pandoraPlugintools package.
  • If your current code depends on advanced modules (for example SNMP or encryption helpers), keep using the standard package.

What is included

The package exports the following modules:

  • general: General-purpose helper functions for plugin development.
  • threads: Utilities for running functions in parallel.
  • agents: Functions to build Pandora FMS agent payloads.
  • modules: Functions to build Pandora FMS module payloads.
  • transfer: File transfer and data sending helpers.
  • discovery: Helpers for Pandora FMS discovery plugins.
  • output: Output formatting and return helpers.

Reference documentation: PluginTools Reference Documentation

Most used functions

The README stays focused on the quick path. For a complete function list and full details, use the reference documentation link above.

Module Common functions
general generate_md5, safe_input, safe_output, parse_configuration, parse_csv_file, translate_macros, now
agents init_agent, print_agent, get_os
modules init_module, print_module, init_log_module, print_log_module
transfer write_xml, transfer_xml, tentacle_xml
threads run_threads, run_processes, set_shared_dict_value, get_shared_dict_value
discovery set_disco_summary, add_disco_summary_value, add_disco_info_value, add_disco_monitoring_data, disco_output
output print_stdout, print_stderr, print_debug, logger

Quick example

import pandoraPlugintools 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",
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandoraplugintools_basic-1.0.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandoraplugintools_basic-1.0.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file pandoraplugintools_basic-1.0.1.tar.gz.

File metadata

  • Download URL: pandoraplugintools_basic-1.0.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pandoraplugintools_basic-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6873e8cb20295663cb20fc6e900b09c509d6f7e842abf522fa891c27ebe45ee2
MD5 3727e16c0c68cc9ec7ae15242135a1d0
BLAKE2b-256 33aa0c00086b07392b79daa4c4fa1b92d7d6b70d56db2a8217e4e1c8226d3327

See more details on using hashes here.

File details

Details for the file pandoraplugintools_basic-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pandoraplugintools_basic-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b03bc393f5407322ba96e19d3bdd6bc1faf27fedc8ea1dbe5e942b655dd6d188
MD5 27e2b1231a5890fd71a337264d8eed39
BLAKE2b-256 743ec7b5f32a206483a7f01d58487e84f8ff616590897a58f5e45dbe80ac2701

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page