|
|
hace 2 meses | |
|---|---|---|
| ci | hace 2 meses | |
| config | hace 2 meses | |
| examples | hace 2 meses | |
| group_vars | hace 3 meses | |
| logs | hace 2 meses | |
| roles | hace 3 meses | |
| src | hace 2 meses | |
| README.md | hace 3 meses | |
| ansible.cfg | hace 3 meses | |
| deploy.yml | hace 3 meses | |
| hosts | hace 3 meses |
# 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.