Grafana + Prometheus implement Windows-based server, MySQL database monitoring
The current mainstream market is Liunx server-based system, but still use windows server enterprise systems, the following will describe how the content based on Grafana + Prometheus realized windows server, database monitoring.
I. Introduction
- Grafana : is an open source and timing of statistical monitoring platform support, for example elasticsearch, graphite, influxdb and many other data sources, and with a powerful interface editor known
- Prometheus : originally built on the SoundCloud open source system monitoring and alerting tool kit, has a complete monitoring system and trends, including those based on built-in and active crawl time series data, storage, query, graphics and alerts.
Second, download and install
1, Windows System Performance indicators Collector
# Download: HTTPS: //github.com/martinlindhe/wmi_exporter/releases # select the latest msi file download can be installed. By accessing http: // ip + default port 9182 (eg: http: // localhost: 9182) appears at FIG, which represents a successful data collection installation.
2, Mysql data acquisition indicator
# Download: HTTPS: //prometheus.io/download/ # find mysqld_exporter collector, you can select windows version (eg: mysqld_exporter-0.11.0.windows-amd64.tar.gz)
.My.cnf created in the same directory and start mysqld_exporter.exe
.my.cnf content:
[Client] Host = 127.0.0.1 ip #mysql the User account # = root password = 123456 # password
3、Prometheus
# Download: HTTPS: //prometheus.io/download/ # can select windows version
. A must extract, modify the configuration file, modify add MySQL, Windows data collection configuration:
scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: 'windows' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['localhost:9182'] - job_name: 'mysql' static_configs: - targets: ['localhost:3306']
b, start, cmd into the installation directory (& - -> running in the background)
prometheus.exe --config.file=prometheus.yml --web.listen-address=:9090 &
C, access the http: // ip: 9090, (such as: http: // localhost: 9090) is the following interface prometheus installation is successful, the data acquisition verification is successful (PS:. up is successful, unsuccessful Down)
3, Grafana
# Download: HTTPS: //grafana.com/grafana/download # can select windows version
Extraction is completed, go to the bin directory to start grafana-server.exe open a browser to access http: // ip: 3000, (such as: http: // localhost: 3000) username / password admin / admin
Third, the performance data show
1, the configuration data source
Configuration - Add data source --- Prometheus, enter the name, prometheus access url, click Save testing, validation is successful
2, select Import monitoring dashboard template.
Access address: https: //grafana.com/dashboards --- serch box to enter windows ---- select your favorite template (note template supported data sources for prometheus) ----- an ID or JOSN file in two ways import.
3, data show
You can see the template imported successfully monitoring data