<?php
// 메모리 사용량 구하기
$host = "www.*****.com";
$oid = ".1.3.6.1.4.1.2021.4.11.0";
$timeout = 200000;
// enterprises.ucdavis.memory.memTotalFree.0
$memTotalFree = @snmpget($host, "public", $oid, $timeout);
if ($memTotalFree === false) {
memTotalFree = "Error";
} else {
$memTotalFree = $memTotalFree . "K";
}
id = ".1.3.6.1.4.1.2021.4.5.0";
// enterprises.ucdavis.memory.memTotalReal.0
$memTotalReal = @snmpget($host, "public", $oid, $timeout);
if ($memTotalReal === false) {
$memTotalReal = "Error";
} else {
$memTotalReal = $memTotalReal . "K";
}
echo "메모리 크기 : " . $memTotalReal;
echo "메모리 free : " . $memTotalFree;
?>
|