-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
43 lines (37 loc) · 1.72 KB
/
index.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
// include the main library
// Here is the code for uses of graphite service
// below i have show how to call the class and use of
require_once ('graphite-library.php');
// Create the GraphiteUrlService object.
$gofus = new GraphiteUrlService();
// Set the required config parameters
$gofus->host = "remotetopc.com";
$gofus->port = "8080"; // default 9090
/**
* Fetch the remote uses like CPU,Disk,Memory
*
* @param string $jid [email protected] mandatory
* @param string $service Which type of servie want to fetch mandatory
* @param string $time fetch the data from time string last -1 hours ,-1 minutes etc
* @param string $format Set the height of graph raw, csv, json, svg
* @return array|false Array with data or error, or False when something went fully wrong
*/
$data1 = $gofus->get_remote_uses('[email protected]','cpu_load_sec','-20minute','json');
echo '<pre>';
print_r($data1);
echo '</pre>';
// fetch the remote uses as a graph
/**
* Fetch the remote uses like CPU,Disk,Memory in graph output
*
* @param string $jid [email protected] mandatory
* @param string $service Which type of servie want to fetch mandatory
* @param string $time fetch the data from time string last -1 hours ,-1 minutes etc
* @param string $height Set the height of graph
* @param string $width Set the width of graph
* @return array|false Array with data or error, or False when something went fully wrong
*/
$data = $gofus->get_remote_metrics('[email protected]','cpu_load_sec','-20minute','800','600');
echo '<pre>';
print_r($data);
echo '</pre>';