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

Contents of /misc/xenconsole/server.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1892 - (show annotations) (download)
Sun Dec 2 16:30:24 2012 UTC (11 years, 5 months ago) by torben
File size: 1197 byte(s)
add per vm cpu graph
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 var_dump($data);
20
21
22 echo "<h2>" . $host["software_version"]["product_brand"] . " " . $host["software_version"]["product_version"] . "</h2>";
23 echo "<font size='2'>Linux:" . $host["software_version"]["linux"] . " / xen: " . $host["software_version"]["xen"] . " / xapi: " . $host["software_version"]["xapi"] . "</font><br>\n";
24
25 echo "License: " . $host["license_params"]["sku_type"] . ", expires " . $host["license_params"]["expiry"] . "<br>\n";
26
27 echo "CPU: " . $host["cpu_info"]["cpu_count"] . " x " . $host["cpu_info"]["modelname"] . "<br>\n";
28 echo "Memory, Total: " . mb( $host_metrics["memory_total"] ) . "mb<br>\n";
29 echo "Memory, Free: " . mb( $host_metrics["memory_free"] ) . "mb<br>\n";
30
31 ?>

  ViewVC Help
Powered by ViewVC 1.1.20