Mary said: chubby, part of the request can not deal with the recent case of the test environment is always present, you see what happens? Chubby face with a smile, said: I came to see why. By looking at the gateway log and found that not all requests have been rejected, the analysis found that there is a feature request is rejected, the request is too many arguments. Chubby like a long time thought to understand why. So chubby quickly help with Zhang. After watching Zhang found that this is a bit strange, Zhang jokingly asked, not local hard drive full of it. Chubby say, this did not concern me yet. Inspection and found that indeed full. After a wave of local hard disk clean-up and found that all requests really normal. Chubby told Zhang: Thank you for reminding. Chubby said that although we have built a promethues monitoring system, but this one is really monitoring gaps, through access to information, chubby finally put a blank piece of monitoring to make up. Chubby I thought, this was down.
The first step, the installation node_exporter
Download: wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
Decompression: tar -xf node_exporter-0.18.1.linux-amd64.tar.gz
MOBILE: cp node_exporter-0.18.1.linux-amd64 / node_exporter / usr / local / bin /
The second step, configure the startup script
vim /usr/lib/systemd/system/node_exporter.service
Follows
[Unit]
the Description = Prometheus node_exporter
[Service]
the User = the nobody
ExecStart = / usr / local / bin / node_exporter --log.level = error
ExecStop = / usr / bin / killall node_exporter
the MemoryLimit = # 300M memory usage limit up to 300M
CPUQuota = # 100% limit at most one CPU core
[the Install]
WantedBy = default.target
The third step is to start (here to centos7 for example)
Reload the configuration file: systemctl daemon-reload
Set service at startup: systemctl enable node_exporter
Start Service: systemctl start node_exporter
Fourth, verification
netstat -anlptu|grep 9100
So far node_exporter has been successfully installed
Next you need to increase the allocation in promethues.yml profile promethues monitoring system, the configuration items as follows:
- job_name: 'node' ### 新增加job static_configs: - targets: ['192.168.229.139:9100','192.168.229.138:9100'] ### 主机列表
And then execute the command, make the configuration take effect
curl -X POST http: // localhost: 9090 // reload
final image below
There are some piece of expression, examples are as follows:
Memory usage
equation: (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes )) * 100
available memory (unit: M)
equation: node_memory_MemAvailable_bytes / 1024/1024
total disk size (unit: G)
the formula: node_filesystem_size_bytes {fstype = ~ "ext4 | xfs" } / 1024/1024/1024
remaining disk size (unit: G)
the formula: node_filesystem_avail_bytes {fstype = ~ "ext4 | xfs"} / 1024/1024/1024
disk usage
formula: (1- (node_filesystem_free_bytes {fstype = ~ "ext4 | xfs "} / node_filesystem_size_bytes {fstype = ~" ext4 | xfs "})) * 100
collecting system network monitoring information (ip add view card information)
card network traffic (like a specific NIC)
formula: irate (node_network_receive_bytes_total {device = ' ens33 '} [5m])
card outgoing traffic (like a specific NIC)
formula: irate (node_network_transmit_bytes_total {device =' ens33 '} [5m])
See dense publicity, I am sure that this is too difficult. But chubby is diligent in thinking person.
Small piece of interested partners, can focus on the back of the chubby blog