首页 技术 正文
技术 2022年11月23日
0 收藏 839 点赞 4,180 浏览 4193 个字
.操作系统基础监控指标配置标准
基础监控使用通用的全局配置文件telegraf.conf,以下只贴上采集器input部分代码

telegraf -config /etc/telegraf/telegraf.d/telegraf.conf -input-filter http_response -test# Read metrics about cpu usage
[[inputs.cpu]]
interval = “60s”
percpu = true
totalcpu = true
fielddrop = [“time*”]
# Read metrics about disk usage by mount point
[[inputs.disk]]
interval = “10m”
# mount_points = [“/”]
ignore_fs = [“tmpfs”, “devtmpfs”]
# Read metrics about disk IO by device
[[inputs.diskio]]
interval = “60s”
# Get kernel statistics from /proc/stat
[[inputs.kernel]]
interval = “10m”
# Read metrics about memory usage
[[inputs.mem]]
interval = “10m”
# Get the number of processes and group them by status
[[inputs.processes]]
interval = “10m”
fielddrop = [“wait”,”idle”,”unknown”]
# Read metrics about swap memory usage
[[inputs.swap]]
interval = “1h”
fieldpass = [“used_percent”]
# Read metrics about system load & uptime
[[inputs.system]]
interval = “2m”
# # Read metrics about network interface usage
[[inputs.net]]
interval = “60s”
fieldpass = [“packets_*”,”bytes_*”,”drop_*”,”err_*”]
# # Read TCP metrics such as established, time wait and sockets counts.
[[inputs.netstat]]
interval = “5m”
fielddrop = [“tcp_none”,”tcp_closing”,”tcp_close*”]
# # Read ping metrics
[[inputs.ping]]
urls = [“www.qq.com”]
count =
ping_interval = 0.0
timeout = 0.0
interface = “eth0”.docker容器监控配置标准
对于基础监控之外的指标监控,需要使用新的配置文件,指定采集器的采集标准和配置,以及输出数据库(可选非必要),下同。
[[inputs.docker]]
interval = “5m”
endpoint = “unix:///var/run/docker.sock”
container_names = []
timeout = “10s”
perdevice = true
total = false
.mysql监控配置标准
# Read metrics from one or many mysql servers
[root@10-19-6-138 telegraf.d]# cat telegraf_mysql.conf
[[inputs.mysql]]
  interval = "5m" 采集频率
  servers = ["root:kgzg789@tcp(127.0.0.1:3306)/?tls=false"] 采集配置
  perf_events_statements_digest_text_limit  = 120
  perf_events_statements_limit              = 250
  perf_events_statements_time_limit         = 86400
  table_schema_databases                    = [""]
  gather_table_schema                       = false
 
  gather_process_list                       = true
 
  gather_info_schema_auto_inc               = true
 
  gather_slave_status                       = true
  gather_binary_logs                        = false
  gather_table_io_waits                     = false
  gather_table_lock_waits                   = false
  gather_index_io_waits                     = false
  gather_event_waits                        = false
  gather_file_events_stats                  = false
  interval_slow                             = "30m".haproxy配置标准
#vim /etc/telegraf/telegraf.d/mysql.conf[inputs.haproxy]
interval = “60s” #input采集频率
servers = [“/var/run/haproxy.sock”] #input参数配置.nginx配置标准
[[inputs.nginx]]
interval = “60s”
urls = [“http://localhost/server_status”] .kafka配置标准
[[inputs.kafka_consumer]]
topics = [“telegraf”]
zookeeper_peers = [“localhost:”]
consumer_group = “telegraf_metrics_consumers”
metric_buffer =
offset = “oldest”
data_format = “influx”.zookeeper配置标准
[[inputs.zookeeper]]
servers = [“:”].ovirt配置标准
.redis配置标准
# # Read metrics from one or many redis servers
[[inputs.redis]]
interval = “5m”
unix:///var/run/redis.sock
servers = [“tcp://localhost:6379”].http网站监控
[[inputs.http_response]] interval = “1m”
address = “http://abc.com”
response_timeout = “15s”
method = “GET”
follow_redirects = true
.Ceph监控
[[inputs.ceph]]
interval = ‘1m’
ceph_binary = “/usr/bin/ceph”
socket_dir = “/var/run/ceph”
mon_prefix = “ceph-mon”
osd_prefix = “ceph-osd”
socket_suffix = “asok”
ceph_user = “client.admin”
ceph_config = “/etc/ceph/ceph.conf”
gather_admin_socket_stats = true
gather_cluster_stats = false
.ping监控
单独使用场景:主要作为WAN链路监控,URL监控的监测手段
[[inputs.ping]]
urls = [“www.qq.com”]
count =
ping_interval = 0.0
timeout = 0.0
interface = “eth0”.tcp端口监控
使用场景:主要作为本机端口应用监控
# # Generic TCP listener
[[inputs.tcp_listener]]
service_address = “:”
allowed_pending_messages =
max_tcp_connections =
data_format = “influx”
.端口流量监控
使用场景:主要作为入口或者外出服务器或者防火墙的端口流量监控
.IPMI监控
使用场景:主要作为物理机器基础电力设施的指标监控
# #IPMI1# #
[[inputs.ipmi_sensor]]
servers = [“root:password@lanplus(10.8.81.15)”].http-json格式监控
使用场景:在特殊应用无任何匹配模板时,可使用json格式化数据后进行指标收集;
# [[inputs.httpjson]]
name = “webserver_stats”
servers = [
“http://localhost:9999/stats/”,
“http://localhost:9998/stats/”,
]
method = “GET”
tag_keys = [
“my_tag_1”,
“my_tag_2”
].自定义sh脚本监控
使用场景:在以上都没有可用的监控采集配置外,可以使用自定义脚本格式收集指标;
[[inputs.exec]]
commands = [“/tmp/test.sh”,]
timeout = “15s”
data_format = “json”
name_suffix = “_mycollector”
.SQLserver监控
使用场景:用于监控SQLserver数据库性能
[[inputs.sqlserver]]
servers = [
“Server=192.168.1.30;Port=;User Id=telegraf;Password=T$l$gr@f69*;app name=dbname;log=;”
]

原文:http://www.lvkaineng.com/235.html

微信扫一扫

支付宝扫一扫

本文网址:https://www.zhankr.net/141537.html

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:875 阅读:5,091
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:806 阅读:3,509
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:565 阅读:4,320
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:730 阅读:4,315
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:4,920
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:3,105
发表评论
暂无评论

还没有评论呢,快来抢沙发~

助力内容变现

将您的收入提升到一个新的水平

点击联系客服

在线时间:8:00-16:00

客服电话

400-888-8888

客服邮箱

ceotheme@ceo.com

扫描二维码

关注微信公众号

扫描二维码

手机访问本站