|
|
2 месяцев назад | |
|---|---|---|
| ci | 2 месяцев назад | |
| config | 2 месяцев назад | |
| examples | 2 месяцев назад | |
| group_vars | 3 месяцев назад | |
| logs | 2 месяцев назад | |
| roles | 3 месяцев назад | |
| src | 2 месяцев назад | |
| README.md | 3 месяцев назад | |
| ansible.cfg | 3 месяцев назад | |
| deploy.yml | 3 месяцев назад | |
| hosts | 3 месяцев назад |
# FX-Monitor - Monitoring Infrastructure with Ansible
FX-Monitor is an Ansible-based automation toolkit for deploying and managing a complete monitoring system stack. It leverages Prometheus, Grafana, Consul, and Node Exporter to provide comprehensive infrastructure monitoring and visualization.
` . ansible.cfg # Ansible configuration deploy.yml # Main playbook hosts # Inventory file README.md # This file group_vars/
all.yml # Group variables
roles/
prometheus/ # Prometheus monitoring server
tasks/
main.yml
templates/
prometheus.service.j2
prometheus.yml.j2
grafana/ # Grafana dashboard and visualization
tasks/
main.yml
node_exporter/ # Node metrics exporter
tasks/
main.yml
templates/
node_exporter.service.j2
consul/ # Consul service discovery
tasks/
main.yml
templates/
consul.conf.json.j2
consul.service.j2
`
Edit the hosts file to define your target machines: ` [monitor]
host1 ansible_host=10.0.0.1
[exporter]
host2 ansible_host=10.0.0.2 host3 ansible_host=10.0.0.3 `
Modify group_vars/all.yml with your environment-specific settings: `yaml
prometheus_port: 9090 grafana_port: 3000 consul_port: 8500 node_exporter_port: 9100 `
Deploy all components:
ash
ansible-playbook deploy.yml
Deploy specific components using tags: `ash
ansible-playbook deploy.yml --tags prom
ansible-playbook deploy.yml --tags grafana
ansible-playbook deploy.yml --tags ne
ansible-playbook deploy.yml --tags consul `
After deployment, services can be managed on target hosts:
`ash
systemctl status prometheus systemctl status grafana-server systemctl status node_exporter systemctl status consul
systemctl restart prometheus systemctl restart grafana-server systemctl restart node_exporter systemctl restart consul `
Internal use only
jiangkai
For issues and questions, contact the infrastructure team.