几个工具收集(glances,jq)
glances工具:性能监控,类似top命令,监控cpu,内存,硬盘等性能参数等等
yum -y install epel-release
yum -y install glances
直接执行glances
jq 格式化工具,变成json格式
#########变成json格式
[root@host101 ~]# echo '{"name":"阿良","sex":"男","city":"北京"}' |jq
{
"name": "阿良",
"sex": "男",
"city": "北京"
}
[root@host101 ~]#
[root@host101 ~]#
[root@host101 ~]#
[root@host101 ~]#
########通过jq获取字段值
[root@host101 ~]# echo '{"name":"阿良","sex":"男","city":"北京"}' |jq ".name"
"阿良"
[root@host101 ~]# echo '{"name":"阿良","sex":"男","city":"北京"}' |jq ".city"
"北京"