从入门到精通
预中级
中级
进阶
机房巡检
ipmi
yum -y install OpenIPMI ipmitool
具体参考:https://www.ibm.com/developerworks/cn/linux/l-ipmi/
SNMP
具体参考:https://blog.csdn.net/HandsomeHong/article/details/80016249
安装snmp
yum -y install net-snmp net-snmp-libs net-snmp-utils
修改配置
[root@k8s-m1 ~]# grep ‘^[a-z]‘ /etc/snmp/snmpd.conf
com2sec admin default admin
group admin v2c admin
view admin included .1 80
access admin "" any noauth exact admin admin none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
启动服务
systemctl start snmpd
netstat -lntpu |grep 161
udp 0 0 0.0.0.0:161 0.0.0.0:* 17023/snmpd
获取cpu内存
[root@k8s-m1 ~]# snmpwalk -v2c -c admin 10.201.1.145 .1.3.6.1.4.1.2021.10.1.3
UCD-SNMP-MIB::laLoad.1 = STRING: 0.01
UCD-SNMP-MIB::laLoad.2 = STRING: 0.04
UCD-SNMP-MIB::laLoad.3 = STRING: 0.05
[root@k8s-m1 ~]# snmpget -v2c -c admin 10.201.1.145 .1.3.6.1.4.1.2021.10.1.3.1
UCD-SNMP-MIB::laLoad.1 = STRING: 0.01
[root@k8s-m1 ~]# snmpget -v2c -c admin 10.201.1.145 .1.3.6.1.2.1.25.2.2.0
HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 3880792 KBytes
OID参考文章:https://blog.csdn.net/buster2014/article/details/46925633
参考文章:https://www.cnblogs.com/anyux/p/8195541.html
进程:每个进程至少有一个线程,每个进程可以有多个线程。
负载:单位时间内运行队列中就绪等待的进程平均值
top
top - 14:44:13 up 5 days, 20:50, 1 user, load average: 0.00, 0.01, 0.05
Tasks: 107 total, 2 running, 105 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.0 sy, 0.0 ni, 99.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3880792 total, 778556 free, 164584 used, 2937652 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 3125052 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
虚拟 物理 共享 占用cpu总时间
lscpu
[root@k8s-m1 ~]# lscpu
cat /proc/loadavg
cat /proc/loadavg
0.00 0.01 0.05 1/134 17383
sysstat包带的监控
yum -y install sysstat
vmstat 1 10
mpstat 1 10
虚拟内存、SWAP、物理内存
vmstat
vmstat 1 10
free
free -m
3.io
iotop
yum -y install iotop
iotop
测试io参考:https://elf8848.iteye.com/blog/2089055
原文:https://blog.51cto.com/lingxudong/2367765