设为首页 收藏本站
查看: 2578|回复: 0

关于nagios监控远程服务器对服务器性能影响的测试

[复制链接]

尚未签到

发表于 2019-1-14 11:35:39 | 显示全部楼层 |阅读模式
  1.  Nagios监视远程服务器时,是通过在控制端执行以下命令进行数据收集的:
  /usr/local/nagios/libexec/check_http -I 192.168.16.11
  /usr/local/nagios/libexec/check_ssh -H 192.168.16.11
  /usr/local/nagios/libexec/check_ping -H 192.168.16.11 -w 100.0,20% -c 500.0,60% -p 5
  /usr/local/nagios/libexec/check_tcp -H 192.168.16.11 -p 22
  /usr/local/nagios/libexec/check_snmp_load.pl -H 192.168.16.11 -C public -w 70% -c 90% -T netsc -f
  /usr/local/nagios/libexec/check_traffic.sh -V 2c -C public -H 192.168.16.11 -I 0 -w 400,200 -c 600,400 -M -b
  /usr/local/nagios/libexec/check_snmp_storage.pl -H 192.168.16.11 -C public -m "^/" -w 80% -c 90% -f
  /usr/local/nagios/libexec/check_snmp_storage.pl -H 192.168.16.11 -C public -m "memory|Memory" -w 80% -c 90% -f
  /usr/local/nagios/libexec/check_snmp -H '192.168.16.11' -C public -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0,.1.3.6.1.4.1.2021.11.11.0 -l 'CPU usage (user system idle)' -u '%'
  /usr/local/nagios/libexec/check_snmp_load.pl -H 192.168.16.11 -C public -w 3,3,2 -c 4,4,3 -T netsl -f
  2.  测试方法:
  1)通过nagios运行时,监视收集远程服务器资源使用信息;
  2)通过在控制端每s执行监控命令,监视收集远程服务器资源使用信息;
  3.  测试结果:
  方法一:nagios运行时,在远程服务器分别执行top -b -d 2 -p21472 >/tmp/top_snmp.log、top -b -d 2 >/tmp/top_all.log,执行时间约为3小时,分析收集到的日志得知,监视时系统资源使用情况正常。
  top_snmp.log部分信息
  top - 15:17:25 up 192 days, 22:16, 4 users, load average: 0.00, 0.00, 0.00
  Tasks:  1 total,  0 running,  1 sleeping,  0 stopped,  0 zombie
  Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
  Mem: 32933092k total, 21012132k used, 11920960k free,  520748k buffers
  Swap: 16779884k total,    0k used, 16779884k free, 16376668k cached
  

  PID USER   PR NI VIRT RES SHR S %CPU %MEM  TIME+ COMMAND
  root   15  0 157m 8616 4424 S 0.0 0.0  0:12.07 snmpd
  

  top_all.log部分信息
  top - 09:51:22 up 192 days, 16:50, 5 users, load average: 0.00, 0.00, 0.00
  Tasks: 258 total,  1 running, 257 sleeping,  0 stopped,  0 zombie
  Cpu(s): 0.2%us, 0.1%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
  Mem: 32933092k total, 20603272k used, 12329820k free,  520164k buffers
  Swap: 16779884k total,    0k used, 16779884k free, 15974748k cached
  

  PID USER   PR NI VIRT RES SHR S %CPU %MEM  TIME+ COMMAND
  root   15  0 10372 692 584 S 0.0 0.0  0:02.33 init
  root   RT -5   0  0  0 S 0.0 0.0  0:00.23 migration/0
  root   34 19   0  0  0 S 0.0 0.0  0:00.04 ksoftirqd/0
  

  方法二:在控制端执行脚本plugins_test.sh,执行命令为:watch –d –n 1 sh plugins_test.sh,同时在远程服务器上执行top -b -d 1 -p21472 >top_snmp_time.log、watch -d -n 1 vmstatg、watch -d -n 1 free -m,5min后查看日志,分析收集到的日志得知,监视时系统资源使用情况正常。
  Free命令10s之间的变化数
  total   used    free   shared  buffers   cached
  Mem:     32161  20527    11633     0    508   15983
  -/+ buffers/cache:   4035    28125
  Swap:    16386     0    16386
  

  total   used    free   shared  buffers   cached
  Mem:     32161  20528    11632     0    508   15983
  -/+ buffers/cache:   4035    28125
  Swap:    16386     0    16386
  

  vmstat命令10s之间的变化数
  procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
  r b  swpd  free  buff cache  si  so  bi  bo  in  cs us sy id wa st
  0    0 11912152 520788 16367288  0  0   0   3  0  0 0 0 100 0 0
  

  procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
  r b  swpd  free  buff cache  si  so  bi  bo  in  cs us sy id wa st
  0    0 11912484 520788 16367332  0  0   0   3  0  0 0 0 100 0 0
  top_snmp_time.log部分信息
  top - 16:22:15 up 192 days, 23:21, 9 users, load average: 0.00, 0.00, 0.00
  Tasks:  1 total,  0 running,  1 sleeping,  0 stopped,  0 zombie
  Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
  Mem: 32933092k total, 21018792k used, 11914300k free,  520780k buffers
  Swap: 16779884k total,    0k used, 16779884k free, 16374824k cached
  

  PID USER   PR NI VIRT RES SHR S %CPU %MEM  TIME+ COMMAND
  root   15  0 157m 8616 4424 S 0.0 0.0  0:13.08 snmpd
  

  

  top - 16:22:16 up 192 days, 23:21, 9 users, load average: 0.00, 0.00, 0.00
  Tasks:  1 total,  0 running,  1 sleeping,  0 stopped,  0 zombie
  Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
  Mem: 32933092k total, 21018792k used, 11914300k free,  520780k buffers
  Swap: 16779884k total,    0k used, 16779884k free, 16374824k cached
  

  PID USER   PR NI VIRT RES SHR S %CPU %MEM  TIME+ COMMAND
  root   15  0 157m 8616 4424 S 0.0 0.0  0:13.08 snmpd
  

  

  top - 16:22:17 up 192 days, 23:21, 9 users, load average: 0.00, 0.00, 0.00
  Tasks:  1 total,  0 running,  1 sleeping,  0 stopped,  0 zombie
  Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
  Mem: 32933092k total, 21018680k used, 11914412k free,  520780k buffers
  Swap: 16779884k total,    0k used, 16779884k free, 16374824k cached
  

  PID USER   PR NI VIRT RES SHR S %CPU %MEM  TIME+ COMMAND
  root   15  0 157m 8616 4424 S 0.0 0.0  0:13.08 snmpd
  4.  测试结果:
  通过以上数据分析后可知:在利用nagios的自身插件及snmp协议(共对远程服务器的10个服务时行监控)监控远程服务器时,对远程服务器资源使用情况无影响。当大于10个服务时,需要另行评测。
  5.  远程服务器配置情况:
  [root@xxx-xxx ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c &cat /proc/cpuinfo | grep physical | uniq -c
  [1] 13558
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 0
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  physical id  : 1
  address sizes  : 40 bits physical, 48 bits virtual
  Intel(R) Xeon(R) CPU      E5620 @ 2.40GHz
  

  [root@xxx-xxx ~]# cat /etc/issue&free -g
  [1] 13753
  CentOS release 5.6 (Final)
  Kernel \r on an \m
  

  total    used    free   shared  buffers   cached
  Mem:      31     20     11     0     0     15
  -/+ buffers/cache:     3     27
  Swap:      16     0     16
  [1]+ Done          cat /etc/issue
  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-663148-1-1.html 上篇帖子: Nagios+pnp4nagios+rrdtool 安装配置nagios(一) 下篇帖子: 7 nagios 手机客户端软件安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表