美文网首页
CACTI监控ESXI5.5的CPU

CACTI监控ESXI5.5的CPU

作者: hel2o | 来源:发表于2016-08-10 08:48 被阅读0次

    创建的CACTI脚本如下,如果是其它核心数的CPU你可以先用SNMPWALK去读下那个OBJECT_ID这个数组是多少就是多少,最后读取到CPU的值来进行显示

    <?php
    $host = '10.255.255.10';
    $community = 'esxi';
    $object_id = '1.3.6.1.2.1.25.3.3.1';
    $sysdesc = snmpwalk($host, $community, $object_id);
    $cpu1 = substr($sysdesc[0],9);
    $cpu2 = substr($sysdesc[1],9);
    $cpu3 = substr($sysdesc[2],9);
    $cpu4 = substr($sysdesc[3],9);
    $cpu  = ($cpu1+$cpu2+$cpu3+$cpu4)/4;
    echo('cpu1:'.$cpu1.' cpu2:'.$cpu2.' cpu3:'.$cpu3.' cpu4:'.$cpu4.' cpu:'.$cpu);
    ?>
    

    CACTI监控ESXI5.5的CPU


    CACTI监控ESXI5.5的CPU

    相关文章

      网友评论

          本文标题:CACTI监控ESXI5.5的CPU

          本文链接:https://www.haomeiwen.com/subject/goodsttx.html