1 |
<?php |
2 |
include("config.php"); |
3 |
|
4 |
// http://docs.vmd.citrix.com/XenServer/5.5.0/1.0/en_gb/api/docs/html/browser.html |
5 |
|
6 |
include('xenapi.php'); |
7 |
|
8 |
/* Establish session with Xenserver */ |
9 |
$xenserver = new XenApi($url, $login, $password); |
10 |
|
11 |
$hosts_array = $xenserver->host__get_all(); |
12 |
|
13 |
$host = $xenserver->host__get_record($hosts_array[0]); |
14 |
$host_metrics = $xenserver->host_metrics__get_record($host["metrics"]); |
15 |
|
16 |
|
17 |
echo "<h2>" . $host["software_version"]["product_brand"] . " " . $host["software_version"]["product_version"] . "</h2>"; |
18 |
echo "<font size='2'>Linux:" . $host["software_version"]["linux"] . " / xen: " . $host["software_version"]["xen"] . " / xapi: " . $host["software_version"]["xapi"] . "</font><br>\n"; |
19 |
|
20 |
echo "License: " . $host["license_params"]["sku_type"] . ", expires " . $host["license_params"]["expiry"] . "<br>\n"; |
21 |
|
22 |
echo "CPU: " . $host["cpu_info"]["cpu_count"] . " x " . $host["cpu_info"]["modelname"] . "<br>\n"; |
23 |
echo "Memory, Total: " . mb( $host_metrics["memory_total"] ) . "mb<br>\n"; |
24 |
echo "Memory, Free: " . mb( $host_metrics["memory_free"] ) . "mb<br>\n"; |
25 |
|
26 |
?> |