diff --git a/docs/PLUGIN_DEVELOPMENT.md b/docs/PLUGIN_DEVELOPMENT.md index ed6caf0..e5bff6e 100644 --- a/docs/PLUGIN_DEVELOPMENT.md +++ b/docs/PLUGIN_DEVELOPMENT.md @@ -21,7 +21,7 @@ Heartbeat's plugin system is designed to be simple yet powerful. Plugins are Pyt ### Key Concepts - **Plugin Registry**: Central registry that manages all loaded plugins -- **Plugin Loader**: Automatically discovers and loads plugins from the `hbd/plugins/` directory +- **Plugin Loader**: Automatically discovers and loads plugins from the `hbd/client/plugins/` directory - **Plugin Types**: InfoPlugin (static data) and MonitorPlugin (periodic metrics) - **Async/Await**: All plugin methods are async for non-blocking operation @@ -64,7 +64,7 @@ Decide whether your plugin collects static information (InfoPlugin) or dynamic m ### Step 2: Create Plugin File -Create a new Python file in `hbd/plugins/` directory: +Create a new Python file in `hbd/client/plugins/` directory: ```python """ @@ -82,7 +82,7 @@ try: except ImportError: psutil = None -from hbd.plugin import MonitorPlugin # or InfoPlugin +from hbd.client.plugin import MonitorPlugin # or InfoPlugin logger = logging.getLogger(__name__) @@ -193,7 +193,7 @@ from pathlib import Path # Add parent directory to path sys.path.insert(0, str(Path(__file__).parent)) -from hbd.plugins.my_awesome_plugin import MyAwesomePlugin +from hbd.client.plugins.my_awesome_plugin import MyAwesomePlugin async def test(): # Create plugin instance @@ -224,7 +224,7 @@ Understanding the plugin lifecycle helps you implement plugins correctly: ``` 1. Plugin Discovery - └─> Loader scans hbd/plugins/ directory + └─> Loader scans hbd/client/plugins/ directory └─> Finds Python files (except those starting with _) └─> Imports modules @@ -378,7 +378,7 @@ Document your plugin thoroughly: ### Example 1: Simple InfoPlugin ```python -from hbd.plugin import InfoPlugin +from hbd.client.plugin import InfoPlugin import platform class SimpleInfoPlugin(InfoPlugin): @@ -406,7 +406,7 @@ plugin = SimpleInfoPlugin ### Example 2: MonitorPlugin with State ```python -from hbd.plugin import MonitorPlugin +from hbd.client.plugin import MonitorPlugin import time class CounterPlugin(MonitorPlugin): @@ -442,7 +442,7 @@ plugin = CounterPlugin ### Example 3: Plugin with External Command ```python -from hbd.plugin import MonitorPlugin +from hbd.client.plugin import MonitorPlugin import asyncio class CommandPlugin(MonitorPlugin): @@ -561,7 +561,7 @@ python -m hbd.hbc -c test_config.yaml --verbose ## Further Reading -- [Plugin Framework Source](../hbd/plugin.py) - Core plugin implementation -- [Built-in Plugins](../hbd/plugins/) - Examples of working plugins +- [Plugin Framework Source](../hbd/client/plugin.py) - Core plugin implementation +- [Built-in Plugins](../hbd/client/plugins/) - Examples of working plugins - [Nagios Integration](NAGIOS_INTEGRATION.md) - Running external plugins - [Configuration Guide](../hbd/config_example.yaml) - Full configuration reference diff --git a/hbd/server/templates/about.html b/hbd/server/templates/about.html index 944ec82..4850494 100644 --- a/hbd/server/templates/about.html +++ b/hbd/server/templates/about.html @@ -107,6 +107,8 @@ + {% include 'foot.html' %} +