Skip to content
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

Python for shell scripting #23

Open
willfurnass opened this issue Jul 17, 2023 · 2 comments
Open

Python for shell scripting #23

willfurnass opened this issue Jul 17, 2023 · 2 comments

Comments

@willfurnass
Copy link

How/why/when to convert bash scripts to Python scripts?

Key modules: os, sys, logging, subprocess, json, LDAP, XML, SNMP

@willfurnass
Copy link
Author

@jkwmoore or I would be happy leading on this.

@jkwmoore
Copy link

My thoughts around this were generalizing around scripts that:

  • Do a thing with a piece of data - e.g. add a user permissions
  • Do a thing with a piece of data and validate - e.g. add user permissions and check they're added.
  • Do a check - e.g. check a user has permissions / check a server or service is live.
  • Setting out a common approach to log parsing / monitoring / checking.
  • Setting out a common approach to what data structures to use e.g. outputs get JSONified.
  • Setting out a common approach to searching data, e.g. regex on JSONified data.
  • Setting out how to approach sub-processing around certain processes e.g. scanning logs, threading by chunking big file or via thread per log file (design patterning.)

Stretch ideas (or bits that may not quite fit in team-python):

  • Inter-machine comms / API stuff? Thoughts around Flask?
  • Approaches to ensuring Python scripting / programs are still running (Nagios + systemd? Healthchecks.io?)

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

No branches or pull requests

2 participants