-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.php
executable file
·78 lines (71 loc) · 2.8 KB
/
server.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
require_once("lib/nusoap.php");
require_once("service.php");
class Server extends soap_server
{
function __construct($ns = "http://localhost/status-server/")
{
$this->configureWSDL('ServerStatus', $ns);
$this->wsdl->schemaTargetNamespace = $ns;
$this->wsdl->addComplexType(
'InfoCPU',
'complexType',
'array',
'all',
'',
array(
'modelCPU' => array('name' => 'modelCPU', 'type' => 'xsd:string'),
'numCoreCPU' => array('name' => 'numCoreCPU', 'type' => 'xsd:int')
)
);
$this->wsdl->addComplexType(
'UsageCPU',
'complexType',
'array',
'all',
'',
array(
'userCPU' => array('name' => 'userCPU', 'type' => 'xsd:double'),
'niceCPU' => array('name' => 'niceCPU', 'type' => 'xsd:double'),
'sysCPU' => array('name' => 'sysCPU', 'type' => 'xsd:double'),
'idleCPU' => array('name' => 'idleCPU', 'type' => 'xsd:double')
)
);
$this->wsdl->addComplexType(
'UsageRAM',
'complexType',
'array',
'all',
'',
array(
'sizeRAM' => array('name' => 'sizeRAM', 'type' => 'xsd:integer'),
'usedRAM' => array('name' => 'usedRAM', 'type' => 'xsd:integer'),
'freeRAM' => array('name' => 'freeRAM', 'type' => 'xsd:integer'),
'percentageRAM' => array('name' => 'percentageRAM', 'type' => 'xsd:string')
)
);
$this->wsdl->addComplexType(
'UsageHD',
'complexType',
'array',
'all',
'',
array(
'pathSDA' => array('name' => 'pathSDA', 'type' => 'xsd:string'),
'totalSDA' => array('name' => 'totalSDA', 'type' => 'xsd:int'),
'usedSDA' => array('name' => 'usedSDA', 'type' => 'xsd:int'),
'freeSDA' => array('name' => 'freeSDA', 'type' => 'xsd:int'),
'percentageSDA' => array('name' => 'percentageSDA', 'type' => 'xsd:string')
)
);
$this->register('Service.usageCPU', array(), array('return' => 'tns:UsageCPU'), $ns);
$this->register('Service.infoCPU', array(), array('return' => 'tns:InfoCPU'), $ns);
$this->register('Service.usageRAM', array(), array('return' => 'tns:UsageRAM'), $ns);
$this->register('Service.usageHD', array(), array('return' => 'tns:UsageHD'), $ns);
if (!isset($HTTP_RAW_POST_DATA))
$HTTP_RAW_POST_DATA =file_get_contents('php://input');
$this->service($HTTP_RAW_POST_DATA);
}
}
new Server();
?>