
Author: Xiao Ming, Source: toutiao.com/article/7303178950443041295/
This article details 10 tools frequently used by operations engineers in their daily work, explaining the functionality, applicable scenarios, and outstanding features of each tool.
1. Shell Scripts
- Function: Primarily used for automating tasks and batch processing jobs.
- Applicable Scenarios: Frequently used for file processing, system management, and simple network management operations.
- Advantages: Flexible and powerful, capable of direct interaction with the system.
- Example: Operations engineers often use Shell scripts to batch modify configuration files on servers.
#!/bin/bash
# Path to configuration files config_path="/path/to/config/file"
# Old and new content old_content="old_value" new_content="new_value"
# Iterate through configuration files on the server for file in $(find $config_path -name "*.conf"); do # Check if the file contains the content to be modified if grep -q "$old_content" "$file"; then # Modify file content sed -i "s/$old_content/$new_content/g" "$file" echo "Modified file: $file" else echo "File $file does not contain the content to be modified." fi done
2. Git
- Function: Focused on version control features.
- Applicable Scenarios: For version management of code and configuration files.
- Advantages: Includes branch management, code rollback, and team collaboration features.
- Example: Operations engineers often use Git to manage Puppet or Ansible code.

3. Ansible

- Function: Provides automation solutions for configuration, deployment, and management.
- Applicable Scenarios: Suitable for automated server configuration, application deployment, and monitoring.
- Advantages: Easy to learn, agentless, and has strong module support.
- Example: Operations engineers typically use Ansible to batch configure firewall rules on servers.
Using Ansible to configure firewall rules on servers:
Install Ansible: First, you need to install Ansible on your local machine. You can install it via pip: pip install ansible.
Configure Inventory: In Ansible, you need to define an inventory file that lists all the servers you want to configure. For example, you can create a file called hosts.ini and list all the server IPs or hostnames in it.
Write Playbook: Next, you need to create a Playbook that defines the firewall rules you want to execute. For example:
---
- hosts: all
become: yes
tasks:
- name: Install firewalld
apt: name=firewalld state=present
- name: Enable firewalld
service: name=firewalld enabled=yes state=started
- name: Open port 80/tcp
firewalld: port=80/tcp permanent=true state=enabled
- name: Open port 22/tcp
firewalld: port=22/tcp permanent=true state=enabled
In this Playbook, we first install firewalld, then start it, and then open ports 80 and 22.
Run Playbook: Finally, you can run this Playbook on your servers using the following command: ansible-playbook -i hosts.ini playbook.yml.
4. Prometheus

- Function: Specializes in monitoring and alerting functionalities.
- Applicable Scenarios: Suitable for system performance monitoring and service status monitoring.
- Advantages: Open-source, flexible data model, and powerful query language.
- Example: Operations engineers often use Prometheus to monitor CPU and memory usage on servers.
5. Grafana

- Function: Focuses on data visualization and dashboard functionalities.
- Applicable Scenarios: Suitable for displaying data from Prometheus, MySQL, and other sources.
- Advantages: Aesthetically pleasing, supports multiple data sources, and has flexible dashboard definition capabilities.
- Example: Operations engineers often use Grafana to display real-time CPU usage on servers.
6. Docker
- Function: Provides containerization technology solutions.
- Applicable Scenarios: Suitable for application deployment, environment isolation, and rapid scaling.
- Advantages: Lightweight, rapid deployment, and ensures consistent runtime environments.
- Example: Operations engineers typically use Docker to deploy web applications.
7. Kubernetes (K8s)
- Function: Specializes in container orchestration and management.
- Applicable Scenarios: Suitable for scaling containerized applications, rolling updates, and high availability features.
- Advantages: Automated container orchestration, elastic scaling, and self-healing capabilities.
- Example: Operations engineers use Kubernetes to manage Docker container clusters.
8. Nginx
Function: Provides web server and reverse proxy functionalities.Applicable Scenarios: Suitable for serving static resources and load balancing operations.Advantages: High performance, stability, and easy configuration process.Example: Operations engineers often use Nginx as a front-end proxy and load balancer for web applications.
9. ELK Stack (Elasticsearch, Logstash, Kibana)
- Function: Specializes in log collection and analysis functionalities.
- Applicable Scenarios: Suitable for centralized management and analysis of system and application logs.
- Advantages: Real-time search capabilities, powerful data analysis, and intuitive dashboard display.
- Example: By using the ELK Stack, one can effectively analyze server access logs to identify the most visited web pages.
10. Zabbix
- Function: Excels in comprehensive network monitoring functionalities.
- Applicable Scenarios: Suitable for server performance monitoring, network monitoring, and service monitoring operations.
- Advantages: Open-source, comprehensive functionality, and good alerting mechanisms.
- Example: Using Zabbix, one can monitor server network bandwidth usage and trigger alerts when thresholds are exceeded.
Interactive Section: Which of the tools listed above do you use most frequently? In your opinion, what aspects of these tools perform best in practical use? Or do you have other operational tools that you think are worth recommending? We look forward to your comments and sharing!
END
Readers interested in learning about Linux systems can click the “Read Original” button to learn about the book “Learning Linux the Right Way”, which is also very suitable for professional operations personnel to read, becoming a high-value reference book to assist in your work!