1 |
root |
1 |
<?php
|
|
|
2 |
/***************************************************************************
|
|
|
3 |
* Copyright (C) 2006 by phpSysInfo - A PHP System Information Script *
|
|
|
4 |
* http://phpsysinfo.sourceforge.net/ *
|
|
|
5 |
* *
|
|
|
6 |
* This program is free software; you can redistribute it and/or modify *
|
|
|
7 |
* it under the terms of the GNU General Public License as published by *
|
|
|
8 |
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
9 |
* (at your option) any later version. *
|
|
|
10 |
* *
|
|
|
11 |
* This program is distributed in the hope that it will be useful, *
|
|
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
14 |
* GNU General Public License for more details. *
|
|
|
15 |
* *
|
|
|
16 |
* You should have received a copy of the GNU General Public License *
|
|
|
17 |
* along with this program; if not, write to the *
|
|
|
18 |
* Free Software Foundation, Inc., *
|
|
|
19 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
20 |
***************************************************************************/
|
|
|
21 |
|
|
|
22 |
// $Id: vitals.php,v 1.32 2007/02/18 18:59:54 bigmichi1 Exp $
|
|
|
23 |
|
|
|
24 |
// xml_vitals()
|
|
|
25 |
|
|
|
26 |
function xml_utilisateur () {
|
|
|
27 |
global $sysinfo;
|
|
|
28 |
global $loadbar;
|
|
|
29 |
global $show_vhostname;
|
|
|
30 |
|
|
|
31 |
$strLoadavg = "";
|
|
|
32 |
$arrBuf = ( $loadbar ? $sysinfo->loadavg( $loadbar ) : $sysinfo->loadavg() );
|
|
|
33 |
|
|
|
34 |
foreach( $arrBuf['avg'] as $strValue) {
|
|
|
35 |
$strLoadavg .= $strValue . ' ';
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
$_text = " <Portail>\n"
|
|
|
39 |
. " <Utilisateur>" . htmlspecialchars( $show_vhostname ? $sysinfo->vhostname() : $sysinfo->chostname(), ENT_QUOTES ) . "</Utilisateur>\n"
|
|
|
40 |
. " <Groupe>" . htmlspecialchars( $show_vhostname ? $sysinfo->vip_addr() : $sysinfo->ip_addr(), ENT_QUOTES ) . "</Groupe>\n";
|
|
|
41 |
$_text .= " </Portail>\n";
|
|
|
42 |
|
|
|
43 |
return $_text;
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
// html_vitals()
|
|
|
47 |
function html_utilisateur () {
|
|
|
48 |
global $webpath;
|
|
|
49 |
global $XPath;
|
|
|
50 |
global $text;
|
|
|
51 |
|
|
|
52 |
$textdir = direction();
|
|
|
53 |
$scale_factor = 2;
|
|
|
54 |
$strLoadbar = "";
|
|
|
55 |
$uptime = "";
|
|
|
56 |
|
|
|
57 |
if( $XPath->match( "/phpsysinfo/Portail/User" ) )
|
|
|
58 |
$strLoadbar = "<br>" . create_bargraph( $XPath->getData( "/phpsysinfo/Vitals/CPULoad" ), 100, $scale_factor ) . " " . $XPath->getData( "/phpsysinfo/Portail/User" ) . "%";
|
|
|
59 |
|
|
|
60 |
$_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n"
|
|
|
61 |
. " <tr>\n"
|
|
|
62 |
. " <td valign=\"top\"><font size=\"-1\">" . $text['utilisateur'] . "</font></td>\n"
|
|
|
63 |
. " <td><font size=\"-1\">" . $XPath->getData( "/phpsysinfo/Portail/Utilisateur" ) . "</font></td>\n"
|
|
|
64 |
. " </tr>\n"
|
|
|
65 |
. " <tr>\n"
|
|
|
66 |
. " <td valign=\"top\"><font size=\"-1\">" . $text['groupe'] . "</font></td>\n"
|
|
|
67 |
. " <td><font size=\"-1\">" . $XPath->getData( "/phpsysinfo/Portail/Groupe" ) . "</font></td>\n"
|
|
|
68 |
. " </tr>\n"
|
|
|
69 |
. "</table>\n";
|
|
|
70 |
|
|
|
71 |
return $_text;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
function wml_utilisateur () {
|
|
|
75 |
global $XPath;
|
|
|
76 |
global $text;
|
|
|
77 |
|
|
|
78 |
$_text = "<card id=\"vitals\" title=\"" . $text['vitals'] . "\">\n"
|
|
|
79 |
. "<p>" . $text['hostname'] . ":<br/>\n"
|
|
|
80 |
. "- " . $XPath->getData( "/phpsysinfo/Vitals/Hostname" ) . "</p>\n"
|
|
|
81 |
. "<p>" . $text['ip'] . ":<br/>\n"
|
|
|
82 |
. "- " . $XPath->getData( "/phpsysinfo/Vitals/IPAddr" ) . "</p>\n"
|
|
|
83 |
. "</card>\n";
|
|
|
84 |
|
|
|
85 |
return $_text;
|
|
|
86 |
}
|
|
|
87 |
?>
|