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 |
echo "<pre>"; |
16 |
//var_dump($host_metrics); |
17 |
|
18 |
//$data = $xenserver->host__get_data_sources($hosts_array[0]); |
19 |
$sr = $xenserver->SR__get_all_records(); |
20 |
var_dump($sr); |
21 |
|
22 |
|
23 |
echo "<h2>" . $host["software_version"]["product_brand"] . " " . $host["software_version"]["product_version"] . "</h2>"; |
24 |
echo "<font size='2'>Linux:" . $host["software_version"]["linux"] . " / xen: " . $host["software_version"]["xen"] . " / xapi: " . $host["software_version"]["xapi"] . "</font><br>\n"; |
25 |
|
26 |
echo "License: " . $host["license_params"]["sku_type"] . ", expires " . $host["license_params"]["expiry"] . "<br>\n"; |
27 |
|
28 |
echo "CPU: " . $host["cpu_info"]["cpu_count"] . " x " . $host["cpu_info"]["modelname"] . "<br>\n"; |
29 |
echo "Memory, Total: " . mb( $host_metrics["memory_total"] ) . "mb<br>\n"; |
30 |
echo "Memory, Free: " . mb( $host_metrics["memory_free"] ) . "mb<br>\n"; |
31 |
|
32 |
?> |