grafana中主机巡检
######################################################## - job_name: 'netdata-scrape' metrics_path: '/api/v1/allmetrics' params: format: [prometheus] honor_labels: true file_sd_configs: - refresh_interval: 1m files: - "/data/prometheus/prometheus/conf/uat-qp.yml" - "/data/prometheus/prometheus/conf/uat-dy.yml" - "/data/prometheus/prometheus/conf/prod.yml" - "/data/prometheus/prometheus/conf/gcp.yml" - "/data/prometheus/prometheus/conf/bigdata.yml" relabel_configs: - source_labels: [__address__] target_label: host_ip ############################################################### 包含的配置文件的配置 - targets: ['172.18.221.62:19999'] labels: instance: gitlab group: qp env: prod ############################################################### table表中的设置: instant:表示只显示当前值
cpu使用率 sum(netdata_system_cpu_percentage_average{dimension!="idle", group="$group", env="$env"}) by (instance) 要点解释: dimension:维度 idle:闲置的 内存使用率 sum(netdata_system_ram_MiB_average{dimension="used", group="$group", env="$env"}) by (instance) / sum(netdata_system_ram_MiB_average{group="$group", env="$env"}) by (instance) * 100 磁盘总使用率 sum(netdata_disk_space_GiB_average{dimension="used",group="$group",env="$env"}) by (instance) / sum(netdata_disk_space_GiB_average{group="$group", env="$env"}) by (instance) * 100 /分区使用率 sum(netdata_disk_space_GiB_average{dimension="used",family="/", group="$group",env="$env"}) by (instance) / sum(netdata_disk_space_GiB_average{group="$group", family="/", env="$env"}) by (instance) * 100 /data分区使用率 sum(netdata_disk_space_GiB_average{dimension="used",family="/data", group="$group",env="$env"}) by (instance) / sum(netdata_disk_space_GiB_average{group="$group", family="/data", env="$env"}) by (instance) * 100