Compare commits
3 Commits
22519f89b2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f3dffb9540 | |||
| 5be0232a23 | |||
| 51c5c3447d |
@@ -13,12 +13,12 @@ If the Traefik dashboard reports any critical state, the appropriate service goe
|
|||||||
|
|
||||||
Services Overview:
|
Services Overview:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Traefik Info Details:
|
Traefik Info Details:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Traefik HTTP Components Details:
|
Traefik HTTP Components Details:
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
BIN
mkp/Traefik-0.2.0.mkp
Normal file
BIN
mkp/Traefik-0.2.0.mkp
Normal file
Binary file not shown.
@@ -2,6 +2,7 @@
|
|||||||
# pylint: disable=missing-module-docstring, unused-argument,
|
# pylint: disable=missing-module-docstring, unused-argument,
|
||||||
# pylint: disable=missing-function-docstring, line-too-long
|
# pylint: disable=missing-function-docstring, line-too-long
|
||||||
|
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -24,6 +25,9 @@ def get_state_upper(
|
|||||||
levels: tuple[int | float, int | float], value: int | float
|
levels: tuple[int | float, int | float], value: int | float
|
||||||
) -> State:
|
) -> State:
|
||||||
"""returns OK/WARN/CRIT depending on the given parameters"""
|
"""returns OK/WARN/CRIT depending on the given parameters"""
|
||||||
|
if levels is None:
|
||||||
|
# a rule with no levels set is active, assume OK state
|
||||||
|
return State.OK
|
||||||
warn, crit = levels
|
warn, crit = levels
|
||||||
if value >= crit:
|
if value >= crit:
|
||||||
return State.CRIT
|
return State.CRIT
|
||||||
@@ -62,6 +66,9 @@ def check_traefik_info(params, section) -> CheckResult:
|
|||||||
"""the check function"""
|
"""the check function"""
|
||||||
_level_type, levels = params["levels_traefik_agent_execution_time"]
|
_level_type, levels = params["levels_traefik_agent_execution_time"]
|
||||||
codename: str = section["codename"]
|
codename: str = section["codename"]
|
||||||
|
if codename == "":
|
||||||
|
# docker hardened image
|
||||||
|
codename = "DHI"
|
||||||
version: str = section["version"]
|
version: str = section["version"]
|
||||||
startdate: str = section["startdate"]
|
startdate: str = section["startdate"]
|
||||||
startdate_seconds_since_epoch: int = section["startdate_seconds_since_epoch"]
|
startdate_seconds_since_epoch: int = section["startdate_seconds_since_epoch"]
|
||||||
@@ -71,7 +78,6 @@ def check_traefik_info(params, section) -> CheckResult:
|
|||||||
agent_version: str = section["agent_version"]
|
agent_version: str = section["agent_version"]
|
||||||
agent_runtime: float = round(section["agent_runtime"], 1)
|
agent_runtime: float = round(section["agent_runtime"], 1)
|
||||||
state: State = get_state_upper(levels=levels, value=agent_runtime)
|
state: State = get_state_upper(levels=levels, value=agent_runtime)
|
||||||
|
|
||||||
yield Metric(
|
yield Metric(
|
||||||
name="traefik_agent_execution_time",
|
name="traefik_agent_execution_time",
|
||||||
value=agent_runtime,
|
value=agent_runtime,
|
||||||
Reference in New Issue
Block a user