feat: set skip_reason on nagios_runner when no commands configured

When NagiosRunnerPlugin has no commands configured, set skip_reason before
returning False from initialize(). This allows PluginLoader to log INFO
(not WARNING) when the plugin is skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 16:13:03 +02:00
parent c9c2ed772f
commit 94e1597978
2 changed files with 25 additions and 2 deletions
+3 -2
View File
@@ -87,13 +87,14 @@ class NagiosRunnerPlugin(MonitorPlugin):
async def initialize(self) -> bool:
"""Initialize the Nagios runner plugin.
Returns:
True if at least one command is configured, False otherwise
"""
self.logger.info(f"Initializing {self.name} plugin")
if not self.commands:
self.skip_reason = "no commands configured (add nagios_runner.commands to config)"
self.logger.info("No Nagios commands configured")
return False