Skip to content

tools: Machine audit - backend scripts to run on Nagios server#4357

Open
Haroon-Khel wants to merge 2 commits into
adoptium:masterfrom
Haroon-Khel:machine.audit.server
Open

tools: Machine audit - backend scripts to run on Nagios server#4357
Haroon-Khel wants to merge 2 commits into
adoptium:masterfrom
Haroon-Khel:machine.audit.server

Conversation

@Haroon-Khel
Copy link
Copy Markdown
Contributor

@Haroon-Khel Haroon-Khel commented May 21, 2026

  • commit message has one of the standard prefixes
  • faq.md updated if appropriate
  • other documentation is changed or added (if applicable)
  • playbook changes run through VPC or QPC (if you have access)
  • VPC/QPC not applicable for this PR
  • for inventory.yml changes, bastillion/nagios/jenkins updated accordingly

Re #4334

Backend scripts to run on the Nagios server.

  • machine.list generated by getNodeList.py, pulls machines from jenkins, saves hostname ip and port
  • main.py performs scp onto the machines to pull machines_info.json file, stores in collecedInfo/{node_name}_machine_info.json
  • url username and token provided as command line arguments for now. Will add functionality to pass in via .env file after ive tested this pr on the nagios server

Things i need to do to test this pr:

  • run the scripts in machine_audit/platform on each of our machines (including static docker containers) to generate machine_info.json on each machine
    • Non windows machines
    • Static docker containers
    • Windows
  • Create nagios user on static docker machines
  • Ensure nagios key is on static docker nodes

@karianna karianna requested review from steelhead31 and sxa May 22, 2026 09:34
def main():

# Jenkins credentials from command line
url, username, password = sys.argv[1:4]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd recommend adding some validation akin to

if len(sys.argv) < 4: print("Usage: ..."); sys.exit(1)

Python has a habit of crashing if an argument is missing

scp_command = [
"scp",
"-P", port,
"-o", "StrictHostKeyChecking=no",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Semgrep will likely flag this as an issue, might be worth trying it without this flag.

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