Skip to content

in-band and oob GenericCollectionPlugin#219

Merged
alexandraBara merged 18 commits into
developmentfrom
alex_generic_collection
Jun 11, 2026
Merged

in-band and oob GenericCollectionPlugin#219
alexandraBara merged 18 commits into
developmentfrom
alex_generic_collection

Conversation

@alexandraBara

@alexandraBara alexandraBara commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

-Adding GenericCollectionPlugin that allows user to run commands and analyze output based on the specifications in the plugin_config.
By default these plugins don't run any commands.
Sample plugin_config, for the OOB version just update the plugin name from GenericCollectionPlugin to OobGenericCollectionPlugin

{
  "global_args": {},
  "plugins": {
    "GenericCollectionPlugin": {
      "collection_args": {
        "sudo": false,
        "include_stdout": true,
        "commands": [
          {
            "name": "kernel_release",
            "command": "uname -a"
          },
          {
            "name": "uptime",
            "command": "uptime"
          },
          {
            "name": "root_disk_usage",
            "command": "df -h /"
          }
        ]
      },
      "analysis_args": {
        "checks": [
          {
            "name": "kernel_release",
            "expected_regex": "^Linux\\s+\\S+\\s+[0-9]+\\.[0-9]+",
            "match_mode": "full"
          },
          {
            "name": "uptime",
            "must_not_contain": ["command not found", "not found"],
            "min_lines": 1
          },
          {
            "name": "root_disk_usage",
            "must_not_contain": ["No such file", "cannot read table of mounted file systems"],
            "expected_regex": "\\d+%|100%",
            "match_mode": "any_line"
          }
        ]
      }
    }
  },
  "result_collators": {},
  "name": "GenericCollectionPlugin sample with mixed analysis",
  "desc": "Regex kernel line, uptime sanity (no error strings + nonempty), df has a use-percent line"
}

Test plan

  • pytest test/unit
  • pytest test/functional (if applicable)
  • pre-commit run --all-files

Checklist

node-scraper --sys-location REMOTE --connection-config connection-config_BMC_325.json --plugin-configs=oob_generic_sample.json

Sample run IB:

 node-scraper  --plugin-configs=ib_generic_sample.json

@alexandraBara alexandraBara requested a review from sunnyhe2 June 11, 2026 20:54

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Missing License

@alexandraBara alexandraBara merged commit 23f91a3 into development Jun 11, 2026
6 checks passed
@alexandraBara alexandraBara deleted the alex_generic_collection branch June 11, 2026 22:47
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.

2 participants