Day 7 of My DevOps Learning Journey! Today, I built my first real DevOps-style automation script using Python — a Server Health Monitoring Tool. This was a big step from learning basics to actually creating something practical and useful. 💡 What I implemented: 1. Read multiple servers from a file 2. Automated ping checks using Python (subprocess) 3. Determined server status (UP / DOWN) 4. Extracted response time (latency) using regex 5. Added colored terminal output (green = UP, red = DOWN) 6. Logged results into files for tracking 7. Built a basic alert system when a server is DOWN 📊 Features of my script: Real-time server status monitoring Response time measurement Clean and readable terminal output Logging + alert mechanism (like real monitoring systems) 🧠 This exercise helped me understand how real-world tools like monitoring systems work behind the scenes from executing system commands to parsing outputs and triggering alerts. Step by step, I’m moving from learning concepts to building practical DevOps tools #DevOps #Python #Automation #Monitoring #LearningInPublic #DevOpsJourney #Day6 #Linux
Building DevOps Automation Script with Python
More Relevant Posts
-
Tired of Python package chaos after you think your automation is done? In my latest post, "Ansible Pip 2026: Install, Manage Packages, and Avoid Common Mistakes," I walk through how to reliably install and manage Python packages with Ansible so you stop chasing manual installs and environment drift. Key takeaways: - When to use ansible.builtin.pip vs. system package managers - Best practices for virtualenvs, user installs, and idempotency - How to avoid common pitfalls that introduce drift and security issues - Examples and playbook snippets you can apply today If you manage deployments or write Ansible roles, this will save you time and reduce incidents. Read the full article and try the playbook examples in your CI/CD pipeline. Read it now and share what mistakes you still see in the wild — I’ll respond to questions and examples. #Ansible #DevOps #Python
To view or add a comment, sign in
-
A few months ago, I thought Python virtual environments, Docker, and Kubernetes were just different ways to “run code.” Then a small issue changed everything. I had a Kafka consumer working perfectly on my laptop. Clean logic, no errors. But when I moved it to another server… it failed. Missing libraries. Version conflicts. Classic “works on my machine” problem.😀 That’s when I truly understood the role of a Python virtual environment (venv). It helped me isolate dependencies — different projects, different package versions, no conflicts. But the problem wasn’t just Python packages… it was the environment itself. So I moved to Docker. Now, I wasn’t just shipping code — I was shipping the entire environment. Python version, libraries, configurations — everything packed into one image. And suddenly, the same Kafka consumer ran exactly the same everywhere. Problem solved? Not quite. What if the process crashes? What if I need 5 consumers running in parallel? What if one server goes down? That’s where Kubernetes came in. With Kubernetes Pods, my container wasn’t just running — it was being managed. Auto-restarts, scaling, load distribution… things I used to handle manually were now automated. That’s when it clicked: venv helps you develop Docker helps you deploy Kubernetes helps you scale and survive failures Today, I don’t see them as competing tools — they are layers of maturity in building reliable systems. Start simple. But build in a way that you’re ready to scale. #Python #Docker #Kubernetes #Kafka #DevOps #DataEngineering #SystemDesign
To view or add a comment, sign in
-
-
Day 64 - Troubleshooting a Python App Deployed on K8s Cluster #100DaysOfDevOps 🧑💻 Today’s Day 64 of #100DaysOfDevOps was a hands-on Kubernetes troubleshooting scenario that felt very close to a real production incident. A Python Flask app deployed on the cluster was completely unavailable, and digging into the Pods revealed an "ImagePullBackOff" error. After investigating with "kubectl describe", I traced the issue to an incorrect container image, which prevented the Pod from ever starting. Fixing that immediately brought the Pods back to life. But that wasn’t the only issue, traffic still wasn’t reaching the app. The Service was misconfigured with "targetPort: 8080" instead of Flask’s default port 5000, meaning requests were being routed to the wrong destination. Updating the Service to use the correct targetPort and ensuring the required nodePort: 32345 made the application accessible externally. This task reinforced a key production lesson: small misconfigurations in image names or port mappings can completely break deployments, and systematic debugging (Pods → Logs → Services) is critical for fast recovery. I’ve documented the full breakdown and fix here: https://lnkd.in/eKtVpMdK Each challenge is sharpening my troubleshooting instincts and deepening my Kubernetes expertise. 💪 #DevOps #Kubernetes #CloudEngineering #K8s #SRE #Troubleshooting #LearningInPublic
To view or add a comment, sign in
-
🐍 Want to start Python from scratch? This FREE resource is gold! 📘 Complete Python for Beginners – Notes by Rishabh Mishra If you're planning to learn Python (or strengthen your basics), this book gives a clear and structured foundation. Here’s what it covers 👇 ✅ Python basics – variables, data types, operators ✅ Control flow – if-else, loops, conditions ✅ Functions & arguments (real coding examples) ✅ Core concepts like lists, strings, and type casting ✅ Step-by-step setup + beginner-friendly explanations 💡 Why this is useful: Python is one of the most popular languages used in DevOps, Data Science, AI, and Automation (GeeksforGeeks) And this guide makes it simple to start without confusion. 🔥 As a DevOps Engineer, I’m focusing on improving Python skills for: • Automation • Scripting • Cloud & Infrastructure tasks 💬 Let’s discuss: 👉 Are you learning Python for DevOps, Data Science, or Development? 🔗 My LinkedIn Profile: https://lnkd.in/gpakHghj #Python #DevOps #Programming #Automation #Coding #Beginners #Learning #Tech #SoftwareDevelopment
To view or add a comment, sign in
-
If you've ever had to migrate a Puppet codebase to Ansible, you know the drill: go through every manifest, translate each resource into YAML, rewrite ERB templates to Jinja2, map Hiera data to group_vars. All manually. I built p2a — an open source CLI tool that automates this process. It runs fully offline, has minimal dependencies, and never sends anything outside your machine. It handles Puppet v3 through v7, follows include chains across modules, resolves Hiera lookups, converts ERB to Jinja2, and outputs ansible-lint clean playbooks and roles. What it can't convert doesn't get silently dropped — it becomes a TODO task with the original Puppet code preserved. The project is still young and I'd love feedback from anyone who's dealt with this kind of migration. Try it on your lab and let me know what you think! https://lnkd.in/deuupJhW #DevOps #Ansible #Puppet #Python #OpenSource
To view or add a comment, sign in
-
Exploring APIs with Python | Learning in Action Today, I worked on a simple yet powerful Python script using the requests library to fetch geolocation data from an API. 🔹 API Used: ipinfo.io 🔹 Method: GET request 🔹 Output: JSON data (IP details like city, country, region, etc.) Understanding how to interact with APIs and handle JSON responses is a fundamental skill for automation, DevOps, and backend development. Here’s what I practiced: ✔ Sending HTTP requests using Python ✔ Parsing JSON responses ✔ Iterating over dictionary data ✔ Debugging syntax errors effectively This small step is helping me move forward in my journey as a Python Automation Engineer & Linux Admin. #Python #API #Automation #Linux #DevOps #Learning #CodingJourney
To view or add a comment, sign in
-
-
🚀 Python for DevOps – Automating Disk Monitoring with subprocess As part of my DevOps learning, I worked on automating system monitoring using Python’s subprocess module. Instead of manually checking disk usage, I built a simple script to monitor it and trigger alerts. 🔧 Here’s the code: import subprocess Run disk usage command result = subprocess.run(["df", "-h", "/"], capture_output=True, text=True) Print full output print(result.stdout) Parse and check usage lines = result.stdout.split("\n") for line in lines[1:]: if line: usage = line.split()[4] # Extract usage % print(f"Disk Usage: {usage}") if int(usage.replace("%","")) > 80: print("⚠️ ALERT: Disk usage is above 80%!") Output: ubuntu@satheesha:~/python$ python3 import-subprocess.py Disk Usage: 3% 💡 Key Learnings: ✔️ subprocess helps automate Linux commands using Python ✔️ Useful for real-time monitoring and automation ✔️ Can be extended to trigger alerts, emails, or restart services 🚀 Real DevOps Use Cases: System health monitoring Auto-alerting when resources are high Integrating with cron jobs Automating routine checks Small automation like this can save a lot of manual effort in production environments. #Python #DevOps #Automation #Linux #Scripting #Cloud #Learning #Monitoring
To view or add a comment, sign in
-
🚀 Automated GitHub Onboarding Process Using Python! Recently worked on an automation script that simplifies DevOps workflows: ✔️ Auto repository creation ✔️ Branch & team setup ✔️ Bulk user onboarding from Excel ✔️ Permission assignment (push/pull/admin) 💡 This helps teams save time and avoid manual errors in daily operations. ⚡ Automation like this is widely used in enterprise environments to improve efficiency. If your team is still handling this manually, I’d be happy to help automate it 👍 #DevOps #Automation #Python #GitHub #CI_CD
To view or add a comment, sign in
-
Today I faced a real issue while building a Docker image — and learned something important from it. Problem: While building the image, I got an error: “You must give at least one requirement to install” Root Cause: I was running "pip install" without specifying any requirements or missing the "requirements.txt" file in the Dockerfile. Solution: - Added a proper "requirements.txt" file - Updated Dockerfile with: "RUN pip install --no-cache-dir -r requirements.txt" - Rebuilt the image successfully Key Learning: Small mistakes in Dockerfiles can break the entire build process. Understanding error messages is a crucial DevOps skill. Tools Used: Docker | Python | Flask Every bug I solve makes me stronger 💪 #DevOps #Docker #Debugging #Python #javafullstack
To view or add a comment, sign in
-
-
Why am I still writing Bash when Python can do this better? So I started documenting the switch. Just published 3 new posts on my blog: 🐍 Phase 0: Python Basics for People Who Already Know Bash 🐍 Phase 1: Replace Your Shell Scripts with Python 🛠️ Project: Automated CI/CD Pipeline for a Flask App (Docker + Nginx + GitHub Actions + AWS EC2) Everything I'm learning, in public. If you're a DevOps engineer curious about Python or MLOps, I'm writing this roadmap for you. 🔗 [https://lnkd.in/gXJmVMTd] #DevOps #Python #MLOps #CI_CD #LearningInPublic #AWS #Docker
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development