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

Annotation of /misc/xenconsole/server.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1895 - (hide annotations) (download)
Sun Dec 9 19:57:00 2012 UTC (11 years, 5 months ago) by torben
File size: 1197 byte(s)
also show the xen/hostname
1 torben 1876 <?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 torben 1882 echo "<pre>";
16 torben 1892 //var_dump($host_metrics);
17 torben 1876
18 torben 1892 $data = $xenserver->host__get_data_sources($hosts_array[0]);
19 torben 1895 var_dump($host);
20 torben 1876
21 torben 1892
22 torben 1876 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