Grafana
下载
wget https://dl.grafana.com/oss/release/grafana-6.2.5-1.x86_64.rpm
安装
sudo yum localinstall grafana-6.2.5-1.x86_64.rpm
运行
sudo service grafana-server start
停止
sudo service grafana-server stop
启动服务:brew services start grafana
停止服务:brew services stop grafana
Telegra(928)
下载Telegraf
wget https://dl.influxdata.com/telegraf/releases/telegraf-1.6.3-1.x86_64.rpm
安装Telegraf
sudo yum localinstall telegraf-1.6.3-1.x86_64.rpm
启动telegraf服务、添加开机启动
systemctl start telegraf.service
service telegraf status
systemctl enable telegraf.service
vim /etc/telegraf/telegraf.conf
修改文件
###############################################################################
OUTPUT PLUGINS
###############################################################################
Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]
The full HTTP or UDP URL for your InfluxDB instance.
Multiple URLs can be specified for a single cluster, only ONE of the
urls will be written to each interval.
urls = [“unix:///var/run/influxdb.sock”]
urls = [“udp://127.0.0.1:8089”]
influxdb http地址,由于是宿主机直接安装,直接访问本地8086端口即可。
urls = [“http://127.0.0.1:8086”]
The target database for metrics; will be created as needed.
数据库名,不存在会自动创建,默认"telegraf"
database = “telegraf”
If true, no CREATE DATABASE queries will be sent. Set to true when using
Telegraf with a user without permissions to create databases or when the
database already exists.
跳过创建数据库
skip_database_creation = false
Name of existing retention policy to write to. Empty string writes to
the default retention policy.
retention_policy = “”
Write consistency (clusters only), can be: “any”, “one”, “quorum”, “all”
write_consistency = “any”
Timeout for HTTP messages.
超时时间
timeout = “5s”
HTTP Basic Auth
username = “telegraf”
password = “metricsmetricsmetricsmetrics”
HTTP User-Agent
user_agent = “telegraf”
UDP payload size is the maximum packet size to send.
udp_payload = 512
Optional SSL Config
ssl_ca = “/etc/telegraf/ca.pem”
ssl_cert = “/etc/telegraf/cert.pem”
ssl_key = “/etc/telegraf/key.pem”
Use SSL but skip chain & host verification
insecure_skip_verify = false
HTTP Proxy override, if unset values the standard proxy environment
variables are consulted to determine which proxy, if any, should be used.
http_proxy = “http://corporate.proxy:3128”
Additional HTTP headers
http_headers = {“X-Special-Header” = “Special-Value”}
HTTP Content-Encoding for write request body, can be set to “gzip” to
compress body or “identity” to apply no encoding.
content_encoding = “identity”
When true, Telegraf will output unsigned integers as unsigned values,
i.e.: “42u”. You will need a version of InfluxDB supporting unsigned
integer values. Enabling this option will result in field type errors if
existing data has been written.
influx_uint_support = false
influxdb
wget https://dl.influxdata.com/telegraf/releases/telegraf-1.11.3-1.x86_64.rpm
sudo yum localinstall telegraf-1.11.3-1.x86_64.rpm
// 打开配置文件
vi /etc/influxdb/influxdb.conf
// 增加如下配置
[[graphite]]
enabled = true
database = “jmeter”
bind-address = “:2003”
protocol = “tcp”
consistency-level = “one”
重启influxdb
systemctl restart influxdb
启动
docker start influxdb
停止
docker stop influxdb
重启
docker restart influxdb
#创建数据库
create database “db_name”
#显示所有的数据库
show databases
#删除数据库
drop database “db_name”
#使用数据库
use db_name
#显示该数据库中所有的表
show measurements
#创建表,直接在插入数据的时候指定表名
insert test,host=127.0.0.1,monitor_name=test count=1
#删除表
drop measurement “measurement_name”
telegraf(928) influxdb(5496)