---
classes/libvirt.php | 15 +++++++++++++++
lang/cs.php | 3 +++
lang/en.php | 3 +++
pages/info.php | 35 ++++++++++++++++++++++++++++++++++-
4 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/classes/libvirt.php b/classes/libvirt.php
index d8bf892..8def902 100644
--- a/classes/libvirt.php
+++ b/classes/libvirt.php
@@ -1601,5 +1601,20 @@
$tmp = libvirt_node_get_info($this->conn);
return ($tmp) ? $tmp : $this->_set_last_error();
}
+
+ function node_get_cpu_stats() {
+ $tmp = libvirt_node_get_cpu_stats($this->conn);
+ return ($tmp) ? $tmp : $this->_set_last_error();
+ }
+
+ function node_get_mem_stats() {
+ $tmp = libvirt_node_get_mem_stats($this->conn);
+ return ($tmp) ? $tmp : $this->_set_last_error();
+ }
+
+ function connect_get_sysinfo() {
+ $tmp = libvirt_connect_get_sysinfo($this->conn);
+ return ($tmp) ? $tmp : $this->_set_last_error();
+ }
}
?>
diff --git a/lang/cs.php b/lang/cs.php
index f841658..115ef27 100644
--- a/lang/cs.php
+++ b/lang/cs.php
@@ -300,5 +300,8 @@
'password_mismatch' => 'Heslo nebylo ověřeno',
'screenshot-settings-auto-release' => 'Automaticky poslat událost
uvolnění tlačítka myši',
'screenshot-delay' => 'Interval byl změněn na %d sekund',
+ 'cpu_stats' => 'Node CPU stats',
+ 'mem_stats' => 'Node memory stats',
+ 'system_information' => 'System information',
);
?>
diff --git a/lang/en.php b/lang/en.php
index e178067..45d54a4 100644
--- a/lang/en.php
+++ b/lang/en.php
@@ -301,5 +301,8 @@
'password_mismatch' => 'Password mismatch',
'screenshot-settings-auto-release' => 'Send automatic mouse pointer
release event',
'screenshot-delay' => 'Delay has been changed to %d second(s)',
+ 'cpu_stats' => 'Node CPU stats',
+ 'mem_stats' => 'Node memory stats',
+ 'system_information' => 'System information',
);
?>
diff --git a/pages/info.php b/pages/info.php
index 00f3710..8e59f14 100644
--- a/pages/info.php
+++ b/pages/info.php
@@ -122,5 +122,38 @@
<?php unset($tmp) ?>
<div class="section"><?php echo $lang->get('modinfo')
?></div>
<?php echo $out ?>
-
</div>
+
+<div class="section"><?php echo $lang->get('cpu_stats');
?></div>
+<?php
+$tmp = $lv->node_get_cpu_stats();
+foreach ($tmp as $id => $data) {
+ echo '<div class="label">CPU #'.$id.'</div>';
+ echo '<div class="value">';
+ foreach ($data as $key => $val) {
+ echo '<div class="label">'.$key.'</div><div
class="value" style="text-align:
right">'.$val.'</div>';
+ }
+ echo '</div>';
+}
+?>
+<div style="clear:both"></div>
+<div class="section"><?php echo $lang->get('mem_stats');
?></div>
+<?php
+$tmp = $lv->node_get_mem_stats();
+foreach ($tmp as $id => $data) {
+ echo '<div class="label">CPU #'.$id.'</div>';
+ echo '<div class="value">';
+ foreach ($data as $key => $val) {
+ echo '<div class="label">'.$key.'</div><div
class="value" style="text-align:
right">'.$val.'</div>';
+ }
+ echo '</div>';
+}
+?>
+<div style="clear:both"></div>
+<div class="section"><?php echo
$lang->get('system_information'); ?></div>
+<pre>
+<?php
+ $tmp = $lv->connect_get_sysinfo();
+ echo htmlentities($tmp);
+?>
+</pre>
--
1.7.4