nagios插件之监控内存使用率(centos7)
来源:互联网 发布:淘宝视频空间在哪里 编辑:程序博客网 时间:2024/06/05 14:44
centos7使用的free命令版本更新后,和centos6的显示结果有差异,导致check_mem.sh脚本执行失败,研究调整后执行正常,上传不了,check_mem_r7.sh新版本,check_mem.sh老版本。
[root@TSP-GGLC-MQAINT ]# free -Vprocps version 3.2.8[root@TSP-GGLC-MQAINT ]# free -m total used free shared buffers cachedMem: 64418 9374 55044 0 319 8019-/+ buffers/cache: 1035 63383Swap: 9999 0 9999[root@TSP-GGLC-MQAINT ]# [root@onlinestore-nginx02 ]# free -Vfree from procps-ng 3.3.10[root@onlinestore-nginx02 ]# free -m total used free shared buff/cache availableMem: 63867 1503 526 3099 61837 58827Swap: 36863 17 36846[root@onlinestore-nginx02 ]#
调整内容如下:井号开头是原来的,下面行是新增的
memory=$(free -mt) (( DEBUG )) && echo "memory=$memory"##phyTotal=$(cut -d' ' -f 8 <<< $memory)phyTotal=$(echo $memory | cut -d ' ' -f 8) (( DEBUG )) && echo "phyTotal=$phyTotal"##swpTotal=$(cut -d' ' -f 19 <<< $memory)swpTotal=$(echo $memory | cut -d ' ' -f 15) (( DEBUG )) && echo "swpTotal=$swpTotal"##phyShared=$(cut -d' ' -f 11 <<< $memory)phyShared=$(echo $memory | cut -d' ' -f 11) (( DEBUG )) && echo "phyShared=$phyShared"##phyBuffers=$(cut -d' ' -f 12 <<< $memory)phyBuffers=$(awk '{if($1~"Buffers:") printf("%d\n",$2/1024)}' /proc/meminfo) (( DEBUG )) && echo "phyBuffers=$phyBuffers"##phyCached=$(cut -d' ' -f 13 <<< $memory)phyCached=$(awk '{if($1~"^Cached:") printf("%d\n",$2/1024)}' /proc/meminfo) (( DEBUG )) && echo "phyCached=$phyCached"##phyUsed=$(cut -d' ' -f 16 <<< $memory)phyUsed=$(echo $memory | cut -d ' ' -f 9) (( DEBUG )) && echo "phyUsed=$phyUsed"##phyAllUsed=$(cut -d' ' -f 9 <<< $memory)phyAllUsed=$(echo $memory | cut -d' ' -f 9) (( DEBUG )) && echo "phyAllUsed=$phyAllUsed"##swpUsed=$(cut -d' ' -f 20 <<< $memory)swpUsed=$(echo $memory | cut -d' ' -f 16) (( DEBUG )) && echo "swpUsed=$swpUsed"
0 0
- nagios插件之监控内存使用率(centos7)
- nagios插件之计算内存使用率
- nagios插件-查看redis的内存使用率
- nagios 监控内存-增加新插件方法
- nagios 监控内存-增加新插件方法
- nagios插件之监控MQA日志文件
- nagios插件之监控POI搜索情况
- nagios插件之监控web页面登陆
- nagios插件之监控获取driverID
- nagios插件之监控casa业务
- nagios插件之监控if8接口日志
- nagios插件之域名超时监控
- nagios插件之监控单个tomcat日志
- nagios插件之监控oracle日志
- nagios插件之监控文件更新时间
- nagios插件之监控udp端口状态
- nagios插件之登录https页面监控
- nagios插件之监控mqa线程数
- Mybatis配置之<properties>属性配置元素详述
- win7 背景设置及常见问题
- 数据结构之双向循环链表
- Xcede打印数据不完整
- 很有趣的亮灯数量问题
- nagios插件之监控内存使用率(centos7)
- 8种基本类型的总结
- 练习题 No.12 多重集组合数
- 解释Learning Rate在Neural Network的作用
- 基于演化博弈数据利用压缩感知方法进行网络重构
- 【图论】洛谷 P1363 幻想迷宫
- as注释风格统一
- 202. Happy Number(C++)
- wordpress如何做到在子目录安装而在根目录访问