-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
robotmk: Add plugin for Robotmk Scheduler Status
*Discover Robotmk Scheduler Status service if the configuration is available in the agent output CMK-14987 Change-Id: I70784151f4e297e239efde2254fc1282c91c1743
- Loading branch information
Showing
3 changed files
with
42 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
title: Robotmk Scheduler Status | ||
agents: robotmk | ||
catalog: robotframework | ||
license: GPLv2 | ||
distribution: check_mk | ||
description: | ||
Provides information about the scheduler status. | ||
|
||
discovery: | ||
One service called "Robotmk Scheduler Status" is created. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (C) 2023 Checkmk GmbH - License: GNU General Public License v2 | ||
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and | ||
# conditions defined in the file COPYING, which is part of this source code package. | ||
|
||
|
||
from cmk.base.plugins.agent_based.agent_based_api.v1 import register, Result, Service, State | ||
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import CheckResult, DiscoveryResult | ||
from cmk.base.plugins.agent_based.utils import robotmk_api # Should be replaced by external package | ||
|
||
|
||
def discover_scheduler_status(section: robotmk_api.ConfigFileContent | None) -> DiscoveryResult: | ||
if section: | ||
yield Service(item="Robotmk Scheduler Status") | ||
|
||
|
||
def check_scheduler_status(item: str, section: robotmk_api.ConfigFileContent | None) -> CheckResult: | ||
if not section: | ||
return | ||
|
||
# TODO: Determine the conditions for the status | ||
yield Result(state=State.OK, summary="The Scheduler status is OK") | ||
|
||
|
||
register.check_plugin( | ||
name="robotmk_scheduler_status", | ||
sections=["robotmk_v2"], | ||
service_name="%s", | ||
discovery_function=discover_scheduler_status, | ||
check_function=check_scheduler_status, | ||
) |