function get_connect_information()
 {
     $tmp = libvirt_connect_get_information($this->conn);
     return $tmp ? $tmp : $this->_set_last_error();
 }
Пример #2
0
    $i = 0;
    while ($row = mysql_fetch_array($result)) {
        $i++;
        echo "<tr><th>OS " . $i . "</th><td>" . $row['os'] . "</td></tr>";
    }
}
?>
			</table>
		</div>
	</div>	-->
	<div id="widget">
		<div id="strip">
			Virtual Machines
			<button type="button" class="primary">-</button>
		</div>
		<div id="widget-main">
			<table style="font:serif;font-size:60%;text-align:left;">
			<?php 
$info = libvirt_connect_get_information($libvirt->conn);
echo "<tr><th>Total Number of VM(s)</th><td>: " . $info['num_total_domains'] . "</td></tr>";
echo "<tr><th>Running VM(s)</th><td>: " . $info['num_active_domains'] . "</td></tr>";
echo "<tr><th>Stopped VM(s)</th><td>: " . $info['num_inactive_domains'] . "</td></tr>";
?>
			</table>
		</div>
	</div>
	</form>
</div>
</body>
</html>
Пример #3
0
 $res = null;
 for ($i = 0; $i < $num; $i++) {
     $ip = $redis->get("cluster:node" . $i);
     echo "<div id=\"widget\" style=\"float:left;font-size:100%;width:30%;margin-left:2.2%;\">";
     echo "<div id=\"strip\">";
     echo "NODE :" . $ip;
     echo "<button type=\"button\" class=\"primary\">-</button>";
     echo "</div>";
     echo "<div id=\"widget-main\">";
     echo "<table style=\"font:serif;font-size:100%;text-align:left;\">";
     $uri = "qemu+tcp://" . $ip . "/system";
     $con = libvirt_connect($uri, false);
     if (!$con) {
         echo libvirt_get_last_error();
     }
     $info = libvirt_connect_get_information($con);
     echo "<tr><th>Hostname</th><td>: " . $info['hostname'] . "</td></tr>";
     echo "<tr><th>Hypervisor</th><td>: " . $info['hypervisor_string'] . "</td></tr>";
     echo "<tr><th>Max VCPU(s) per VM</th><td>: " . $info['hypervisor_maxvcpus'] . "</td></tr>";
     $info1 = libvirt_node_get_info($con);
     echo "<tr><th>CPU(s)</th><td>: " . $info1['cpus'] . "</td></tr>";
     echo "<tr><th>CPU frequency</th><td>: " . $info1['mhz'] . "</td></tr>";
     echo "<tr><th>Architecture</th><td>: " . $info1['model'] . "</td></tr>";
     echo "<tr><th>Memory</th><td>: " . $info1['memory'] . "</td></tr>";
     echo "<tr><th>Total Number of VM(s)</th><td>: " . $info['num_total_domains'] . "</td></tr>";
     echo "<tr><th>Running VM(s)</th><td>: " . $info['num_active_domains'] . "</td></tr>";
     echo "<tr><th>Stopped VM(s)</th><td>: " . $info['num_inactive_domains'] . "</td></tr>";
     echo "</table>";
     echo "</div>";
     echo "</div>";
 }