Skip to content

Add support for namespaces and service for each client #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

edvler
Copy link

@edvler edvler commented Mar 31, 2025

No description provided.

@edvler
Copy link
Author

edvler commented Mar 31, 2025

fixes #4

@edvler
Copy link
Author

edvler commented Mar 31, 2025

Hello,

as requested I've splitted up the modifications into two parts. One for namespaces, the other for the services.

Greets

@nedjitef
Copy link
Collaborator

Which version of cmk are you using?
raw, cme or cee?



default_proxmox_bs_clients_params={'bkp_age': (172800, 259200), 'snapshot_min_ok': 1}
register.check_plugin(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've updated to use API v2, as such this would not work with the most recent release version. This would be the new syntax:

check_plugin_proxmox_bs_clients = CheckPlugin(
    name="proxmox_bs_clients",
    service_name="PBS Client %s",
    sections=["proxmox_bs"],
    discovery_function=proxmox_bs_clients_discovery,
    check_function=proxmox_bs_clients_checks,
    check_default_parameters=default_proxmox_bs_clients_params,
    check_ruleset_name="proxmox_bs_clients",
)

Copy link
Contributor

@fdriessler fdriessler Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will likely also have to be changed:
$OUTPUT_FORMAT was adjusted to be json instead of json-pretty, as the newlines were increasing the file size unnecessarily, even quadrupling its size in one of our tests; the updated plugin reads the line in its entirety as a json to further process it instead of reading multiple lines and using key words to create the Section. As such,the discovery and check will also have to be adjusted.
The Section, as it is created by the parse function has the following structure:

{
  "tasks": [
    <"UPID:*">
  ],
  "data_stores": [
    "store1",
    "store2",
    ...
  ],
  "versions":{...},
  "datastore_list": [
    {...},
    {...},
    ...
  ],
  "task_list": [
    {...},
    {...},
    ...
  ]
}

@nedjitef
Copy link
Collaborator

Since we changed a lot on our side, we need an updated version of the modifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants