Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Construction of simple local monitoring system under Windows (Telegraf+Influxdb+Grafana)

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

File preparation 1, file name telegraf-1.5.0_windows_amd64.zipinfluxdb-1.4.2_windows_amd64.zip

Grafana-4.6.3.windows-x64.zip

Telegraf-1.5.0_windows_amd64.zip

Wget https://dl.influxdata.com/telegraf/releases/telegraf-1.5.0_windows_amd64.zip

Unzip telegraf-1.5.0_windows_amd64.zip

Influxdb-1.4.2_windows_amd64.zip

Wget https://dl.influxdata.com/influxdb/releases/influxdb-1.4.2_windows_amd64.zip

Unzip influxdb-1.4.2_windows_amd64.zip

Grafana-4.6.3.windows-x64.zip

Wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3.windows-x64.zip

Unzip grafana-4.6.3.windows-x64.zip

You can use the above command to download, Windows can use the command of wget, download a Windwos version of wget, modify the environment variables, OK

Because grafana only provides interface display, he needs to obtain data from influxdb, and the data in influxdb needs to be collected from other places. The commonly used collection tools are collectd and telegraf, in which collectd is not introduced here, and some data is not suitable, while influxdb itself integrates telegraf plug-ins and does not need special configuration.

Collectd/telegraf (collect data)-> influxdb (save data)-> grafana (display data)

That's the relationship between the three.

Install and extract the downloaded files to the specified directory, such as F:/Grafana configuration

Modify the telegraf.conf file and set the log file directory

Specify the log file name. The empty string means to log to stdout.logfile = "F:/Grafana/server/telegraf/telegraf.log" # # you modify the directory path defined for yourself, and don't make any other configuration changes. Modify influxdb.conf, open HTTP, and modify the path where the data is saved, that is, the database file Where the metadata/raft database is storeddir = "F:/Grafana/server/influxdb/meta" # # modify to your own directory path # meta controls the Metastore parameter of InfluxDB, which stores information about users, databases, retention policies, sharding and continuous queries

3. Modify influxdb.conf, open HTTP, and modify the path where the data is saved, that is, the database file

The directory where the TSM storage engine stores TSM files. Dir = "F:/Grafana/server/influxdb/data" # # modify to your own directory path # to control where the actual shard data exists in InfluxDB and how to refresh the data from WAL

4. Modify influxdb.conf, open HTTP, and modify the path where the data is saved, that is, the database file

The directory where the TSM storage engine stores WAL files. Wal-dir = "F:/Grafana/server/influxdb/wal" # # modify to your own directory path # store WAL refresh data

5. Modify influxdb.conf, open HTTP, and modify the path where the data is saved, that is, the database file

Determines whether HTTP endpoint is enabled. Enabled = true # # enabled, the main function is to receive and store telegraf data, and provide API to Grafana call data # The bind address used by the HTTP service. Bind-address = ": 8086" # # Port used by HTTP API

Note: starting with version 1.3, the Web management interface is no longer available in InfluxDB. The interface does not run on the port 8083 Magi InfluxDB ignores this part of the [admin] configuration file. Chronograf replaces the network management interface with improved tools for querying data, writing data, and database management.

Or use InfluxDB+Telegraf+Chromograf+Kapacitor components for build monitoring (all available in Windows version)

6.Grafana uses the default configuration.

HTTP port default: 3000HTTP address default: localhost (127.0.0.1) default user: admin default user password: admin database type: sqlite3 # # support mysql,postgres and other database addresses: localhost (127.0.0.1) database port: 3306 database name: grafana # # if you connect to the database under Windows, please find the grafana.db file under grafana/data Login user with Navicat connection database: root database login password: root starts 4.1 Influxdb through the cmd command window, change to the influxdb installation directory, execute the following command: influxd-config influxdb.conf4.2 Telegraf through the cmd command window, change to the Telegraf installation directory, execute the following command: telegraf-config telegraf.conf4.3 Grafana changes to the bin directory in the Grafana installation directory, double-click grafana-server.exe startup program

You can write some scripts, such as bat or vbs, to start with one click and run in the background.

Use the operation to open Google Chrome, enter http://localhost:3000, log in to the native Grafana using admin/admin, and create a new influxdb data source.

Step 1: log in to Grafana.

Step 2, create a data source

two。 The completion of the creation of the data source is the establishment of the template, data query operation, and automatic drawing.

Step 1: create a new panel

New Dashboard for naming, description, customization.

Step 2: add Graph

Step 3: save. There is a Save configuration button in the top corner of the page.

Show me the graphics that I have simply configured:

The above is my simple configuration. For the interpretation of the configuration file, please refer to the official documentation. If you have any specific questions, just leave a message.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report