Imported Upstream version 0.6.24+dfsg1
This commit is contained in:
34
share/pnp/templates.special/advanced_loop.php-sample
Normal file
34
share/pnp/templates.special/advanced_loop.php-sample
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
#
|
||||
#
|
||||
#
|
||||
$this->MACRO['TITLE'] = "Interface Traffic for ETH0";
|
||||
$this->MACRO['COMMENT'] = "Inbound Traffc for all Cloud Nodes";
|
||||
#
|
||||
# Get a List of Services by regex
|
||||
# Option 1 = 'Host Regex'
|
||||
# Option 2 = 'Service Regex'
|
||||
#
|
||||
$services = $this->tplGetServices("node","eth0");
|
||||
#
|
||||
# The Datasource Name for Graph 0
|
||||
$ds_name[0] = "RTA Times";
|
||||
$opt[0] = "--title \"Stacked RTA Times\"";
|
||||
$def[0] = "";
|
||||
#
|
||||
# Iterate through the list of hosts
|
||||
|
||||
foreach($services as $key=>$val){
|
||||
#
|
||||
# get the data for a given Host/Service
|
||||
$a = $this->tplGetData($val['host'],$val['service']);
|
||||
#
|
||||
# Throw an exception to debug the content of $a
|
||||
# Just to get Infos about the Array Structure
|
||||
#
|
||||
#throw new Kohana_exception(print_r($a,TRUE));
|
||||
$def[0] .= rrd::def("a$key" ,$a['DS'][0]['RRDFILE'], $a['DS'][0]['DS'], "AVERAGE");
|
||||
$def[0] .= rrd::area("a$key", rrd::color($key), $a['MACRO']['HOSTNAME'], "STACK");
|
||||
$def[0] .= rrd::gprint("a$key", array("MIN", "MAX", "LAST"), "%.2lf%s");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user