V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
immike
V2EX  ›  Linux

怎样监控 Esxi 中的 esxtop 中的"GAVG/cmd"参数?

  •  
  •   immike · 2015-04-23 10:21:16 +08:00 · 3270 次点击
    这是一个创建于 3262 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有几台机器只要这个参数大于10, 机器上的虚拟机就卡的不行了;

    这个参数好像是对应vsphere上性能图表的"最长滞后时间"

    菜鸟不知道怎么用nagios之类的对这个参数实时监控,有朋友知道怎么弄吗?

    不能上图吗?

    2 条回复    2015-04-27 13:47:16 +08:00
    yiyiwa
        1
    yiyiwa  
       2015-04-26 15:41:10 +08:00   ❤️ 1
    你这个参数我没监控过, 我现在有的监控硬盘的SMART状态, 因为我的ESXi是组装的服务器,然后有的信息没办法查看, 于是用RUBY写了一个脚本. 定时SSH到ESXi 查询相关信息,脚本如下:

    #!/usr/bin/ruby
    require 'net/ssh'
    require 'net/telnet'
    #0 ok; 1 warning; 2 critical; 3 unknown

    user, pass = "root", "123"

    def test(ip,user,pass)
    begin
    Net::SSH.start(ip, user, :password => pass ) { |ssh|
    result = ssh.exec!('for i in `esxcli storage core device list | grep "Local ATA Disk" | sed "s/.*(\|)//g"`; do esxcli storage core device smart get -d "$i" | grep Health ; done')
    }
    rescue
    end
    end

    status = test('192.168.1.22',user,pass)

    if status.scan("OK").count == status.scan("Health").count
    puts "Disk Smart OK"
    exit 0
    else
    puts "Disk Smart Fail"
    exit 2
    end
    immike
        2
    immike  
    OP
       2015-04-27 13:47:16 +08:00
    @yiyiwa 谢谢, 但是我不懂Ruby;
    打算用crontab执行bash脚本,每10分钟check一次; 触发预警再邮件通知
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1218 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:06 · PVG 02:06 · LAX 11:06 · JFK 14:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.