Compare commits

...

No commits in common. "master" and "v0.1.1" have entirely different histories.

2 changed files with 0 additions and 68 deletions

View File

@ -29,10 +29,7 @@
// Mount complete volume for site directories // Mount complete volume for site directories
"mounts": [ "mounts": [
{ "source": "omd-sites", "target": "/opt/omd/sites", "type": "volume" }, { "source": "omd-sites", "target": "/opt/omd/sites", "type": "volume" },
{ "source": "${localWorkspaceFolder}/lib", "target": "/opt/omd/sites/cmk/local/lib/python3/cmk", "type": "bind"},
{ "source": "${localWorkspaceFolder}/plugins", "target": "/opt/omd/sites/cmk/local/lib/python3/cmk_addons/plugins", "type": "bind" }, { "source": "${localWorkspaceFolder}/plugins", "target": "/opt/omd/sites/cmk/local/lib/python3/cmk_addons/plugins", "type": "bind" },
{ "source": "${localWorkspaceFolder}/plugins_legacy", "target": "/opt/omd/sites/cmk/local/share/check_mk", "type": "bind"},
{ "source": "${localWorkspaceFolder}/packages_local", "target": "/opt/omd/sites/cmk/var/check_mk/packages_local/", "type": "bind"}
], ],
// Use 'postCreateCommand' to run commands after the container is created. // Use 'postCreateCommand' to run commands after the container is created.

View File

@ -100,71 +100,6 @@ def discover_pbs_special_agent_storage(section):
# yield Service(item=ITEM_FS_SWAP) # yield Service(item=ITEM_FS_SWAP)
def check_pbs_special_agent(item, section):
# pprint(section)
if "error" in section:
if item == ITEM_STATUS:
yield Result(state=State.CRIT, summary=section["error"])
return
if item == ITEM_STATUS:
status = section["status"]
version = section["version"]
yield Result(
state=State.OK,
summary=(
f"Version {version['version']}."
f"{version['release']}"
),
details=(
f"CPU: {status['cpuinfo']["model"]}, "
f"{status['cpuinfo']['sockets']} sockets, "
f"{status['cpuinfo']['cpus']} cores\n"
f"Kernel: {status['current-kernel']["sysname"]} "
f"{status['current-kernel']["release"]} "
f"{status['current-kernel']["machine"]} "
f"{status['current-kernel']["version"]}\n"
f"Bios: {status['boot-info']['mode']}, "
f"secureboot: {'on' if status['boot-info']['secureboot'] else 'off'}\n"
)
)
yield from parse_jobs(item, ITEM_SYNC_JOBS, section, "sync", "id")
yield from parse_jobs(item, ITEM_GC, section, "gc", "store")
yield from parse_jobs(item, ITEM_PRUNE, section, "prune", "id")
yield from parse_jobs(item, ITEM_VERIFY, section, "verify", "id")
if item == ITEM_CPU:
status = section["status"]
cpu_busy = float(status.get("cpu", 0.0)) * 100 # Prozent
cpu_wait = float(status.get("wait", 0.0)) * 100
yield Result(
state=State.OK,
summary=f"CPU Busy: {cpu_busy:.1f}%, IOWait: {cpu_wait:.1f}%"
)
yield Metric("cpu_busy", cpu_busy)
yield Metric("cpu_wait", cpu_wait)
if item == ITEM_MEM:
status = section["status"]
mem = status.get("memory", {})
total = mem.get("total", 0)
used = mem.get("used", 0)
free = mem.get("free", 0)
yield Result(
state=State.OK,
summary=f"Memory used: {used}, free: {free}, total: {total}",
)
yield Metric("mem_total", total)
yield Metric("mem_used", used)
yield Metric("mem_free", free)
if item == ITEM_LOAD:
status = section["status"]
loadavg = status.get("loadavg", [0.0, 0.0, 0.0])
load1, load5, load15 = [float(x) for x in loadavg]
yield Result(
state=State.OK,
summary=f"Load avg: {load1:.2f}, {load5:.2f}, {load15:.2f}",
)
yield Metric("load1", load1)
yield Metric("load5", load5)
yield Metric("load15", load15)
def check_pbs_special_agent_storage(item: str, params: list, section: dict): def check_pbs_special_agent_storage(item: str, params: list, section: dict):