/[projects]/misc/xenconsole/server.php
ViewVC logotype

Contents of /misc/xenconsole/server.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1882 - (show annotations) (download)
Fri Nov 30 10:58:49 2012 UTC (11 years, 5 months ago) by torben
File size: 1108 byte(s)
only show console icon if the vm is running
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);
17
18
19 echo "<h2>" . $host["software_version"]["product_brand"] . " " . $host["software_version"]["product_version"] . "</h2>";
20 echo "<font size='2'>Linux:" . $host["software_version"]["linux"] . " / xen: " . $host["software_version"]["xen"] . " / xapi: " . $host["software_version"]["xapi"] . "</font><br>\n";
21
22 echo "License: " . $host["license_params"]["sku_type"] . ", expires " . $host["license_params"]["expiry"] . "<br>\n";
23
24 echo "CPU: " . $host["cpu_info"]["cpu_count"] . " x " . $host["cpu_info"]["modelname"] . "<br>\n";
25 echo "Memory, Total: " . mb( $host_metrics["memory_total"] ) . "mb<br>\n";
26 echo "Memory, Free: " . mb( $host_metrics["memory_free"] ) . "mb<br>\n";
27
28 ?>

  ViewVC Help
Powered by ViewVC 1.1.20