Skip to content
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
conf/config.local.php
conf/*local*
plugin/local/*.json
1 change: 1 addition & 0 deletions conf/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
$CONFIG['showload'] = true;
$CONFIG['showmem'] = false;
$CONFIG['showtime'] = false;
$CONFIG['perline'] = 1;

$CONFIG['term'] = array(
'2hour' => 3600 * 2,
Expand Down
4 changes: 4 additions & 0 deletions graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
require_once 'type/GenericIO.class.php';
$obj = new Type_GenericIO($CONFIG, GET());
break;
case 'filled':
require_once 'type/GenericFilled.class.php';
$obj = new Type_GenericFilled($CONFIG, GET());
break;
case 'uptime':
require_once 'type/Uptime.class.php';
$obj = new Type_Uptime($CONFIG, GET());
Expand Down
45 changes: 40 additions & 5 deletions inc/html.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function html_end($footer = false) {
EOT;
}
if ($CONFIG['graph_type'] == 'canvas') {
$html_weburl = htmlentities($CONFIG['weburl']);
if ($CONFIG['rrd_fetch_method'] == 'async') {
$js_async = 'true';
} else {
Expand Down Expand Up @@ -229,17 +230,35 @@ function host_summary($cat, $hosts) {

$row_style = array(0 => "even", 1 => "odd");
$host_counter = 0;
$line_counter = 0;

if($CONFIG['perline']) {
printf('<div class="divTable">');
}

foreach($hosts as $host) {
$host_counter++;

printf('<div class="row %s">', $row_style[$host_counter % 2]);
printf('<label><a href="%shost.php?h=%s">%s</a></label>',
if($CONFIG['perline']) {
$foo = $host_counter % $CONFIG['perline'];
echo "<!--- $host_counter ".$CONFIG['perline']." $foo -->\n";
if($host_counter % $CONFIG['perline'] == 0) {
printf('<div class="divRow %s">', $row_style[$line_counter % 2]);
}
} else {
printf('<div class="row %s">', $row_style[$line_counter % 2]);
}


# printf('<label><a href="%shost.php?h=%s">%s</a></label>',
printf('<div class="divCell"><a href="%shost.php?h=%s">%s</a></div>',
htmlentities($CONFIG['weburl']),
urlencode($host),
htmlentities($host));

echo "<div class=\"hostinfo\">";

if ($CONFIG['showload'] || $CONFIG['showmem'] || $CONFIG['showtime']) {
echo "<div class=\"hostinfo\">";
}

if ($CONFIG['showload']) {
require_once 'type/Default.class.php';
Expand Down Expand Up @@ -307,8 +326,24 @@ function host_summary($cat, $hosts) {
}
}

print "</div></div>\n";
if($CONFIG['perline']) {
if(($host_counter % $CONFIG['perline'] ) == $CONFIG['perline'] - 1) {
print "</div>\n";
$line_counter++;
}
$host_counter++;
} else {
print "</div>\n";
$line_counter++;
if ($CONFIG['showload'] || $CONFIG['showmem'] || $CONFIG['showtime']) {
echo "</div>\n";
}
}
}

if($CONFIG['perline']) {
printf('</div>');
}

echo "</div>\n";
echo "</fieldset>\n";
Expand Down
56 changes: 50 additions & 6 deletions layout/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ h2 {
}

a:link, a:visited, a:active {
text-decoration: none;
color: #222;
text-decoration: none;
color: #222;
}

a:hover {
Expand All @@ -78,11 +78,11 @@ a:hover {
}

.row.even {
/* background: #eeeeee; */
/* background: #aaaaaa; */
}

.row.odd {
/* background: #cccccc; */
/* background: #cccccc; */
}

.row label {
Expand Down Expand Up @@ -161,7 +161,7 @@ hr {

.selected:link, .selected:visited, .selected:active {
font-style: italic;
color: #4D79B5;
color: #4D79B5;
}

.time-range li {
Expand Down Expand Up @@ -194,11 +194,55 @@ legend {

code {
font-family: Consolas,"Liberation Mono",Menlo,Courier,monospace;
background-color: rgba(0,0,0,0.1);
background-color: rgba(0,0,0,0.1);
padding: 0 0.2em;
}

.timeago {
font-size: 0.7em;
opacity: 0.6;
}

.divCell {
float:left;/*fix for buggy browsers*/
display:table-column;
width:20em;
/* background-color:#ccc; */
}

.divTable {
display: table;
width:auto;
background-color:#fff;
/* border:1px solid #666666; */
border-spacing:5px;/*cellspacing:poor IE support for this*/
/* border-collapse:separate;*/
}

.divRow {
display:table-row;
width:auto;
}

.divRow:nth-of-type(odd) {
background: #ccc;
}

.divRow label {
float: left;
width: 20em;
}

.divRow .hostinfo {
float: left;
}

.divRow .field {
float: left;
width: 3.4em;
}

.divRow .field.wide {
width: 8em;
}

43 changes: 43 additions & 0 deletions plugin/aggregation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"cpu": {
"title": "Total CPU usage on {{HOST}}",
"vertical": "Percent",
"rrdtool_opts": ["-u", "100"],
"type": "stacked",
"legend": {
"idle": {
"name": "Idle",
"color": "e8e8e8"
},
"nice": {
"name": "Nice",
"color": "00e000"
},
"user": {
"name": "User",
"color": "0000ff"
},
"wait": {
"name": "Wait-IO",
"color": "ffb000"
},
"system": {
"name": "System",
"color": "ff0000"
},
"softirq": {
"name": "SoftIRQ",
"color": "ff00ff"
},
"interrupt": {
"name": "IRQ",
"color": "a000a0"
},
"steal": {
"name": "Steal",
"color": "000000"
}
},
"legend_format": "%5.2lf"
}
}
2 changes: 1 addition & 1 deletion plugin/cpu.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cpu": {
"title": "CPU-{{PI}} usage on {{HOST}}",
"vertical": "Jiffies",
"rrdtool_opts": ["-u", "100"],
"rrdtool_opts": ["-u","100","-r"],
"type": "stacked",
"legend": {
"idle": {
Expand Down
51 changes: 51 additions & 0 deletions plugin/interface_lif.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"if_octets": {
"title": "Interface Traffic ({{PI}}) on {{HOST}}",
"vertical": "{{ND}} per second",
"type": "io",
"legend": {
"rx": {
"name": "Receive",
"color": "0000ff"
},
"tx": {
"name": "Transmit",
"color": "00b000"
}
},
"legend_format": "%5.1lf%s",
"datasize": true
},
"if_errors": {
"title": "Interface Errors ({{PI}}) on {{HOST}}",
"vertical": "Errors per second",
"type": "io",
"legend": {
"rx": {
"name": "Receive",
"color": "0000ff"
},
"tx": {
"name": "Transmit",
"color": "00b000"
}
},
"legend_format": "%5.1lf%s"
},
"if_packets": {
"title": "Interface Packets ({{PI}}) on {{HOST}}",
"vertical": "Packets per second",
"type": "io",
"legend": {
"rx": {
"name": "Receive",
"color": "0000ff"
},
"tx": {
"name": "Transmit",
"color": "00b000"
}
},
"legend_format": "%5.1lf%s"
}
}
51 changes: 51 additions & 0 deletions plugin/interface_port.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"if_octets": {
"title": "Interface Traffic ({{PI}}) on {{HOST}}",
"vertical": "{{ND}} per second",
"type": "io",
"legend": {
"rx": {
"name": "Receive",
"color": "0000ff"
},
"tx": {
"name": "Transmit",
"color": "00b000"
}
},
"legend_format": "%5.1lf%s",
"datasize": true
},
"if_errors": {
"title": "Interface Errors ({{PI}}) on {{HOST}}",
"vertical": "Errors per second",
"type": "io",
"legend": {
"rx": {
"name": "Receive",
"color": "0000ff"
},
"tx": {
"name": "Transmit",
"color": "00b000"
}
},
"legend_format": "%5.1lf%s"
},
"if_packets": {
"title": "Interface Packets ({{PI}}) on {{HOST}}",
"vertical": "Packets per second",
"type": "io",
"legend": {
"rx": {
"name": "Receive",
"color": "0000ff"
},
"tx": {
"name": "Transmit",
"color": "00b000"
}
},
"legend_format": "%5.1lf%s"
}
}
18 changes: 18 additions & 0 deletions plugin/iops_vol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"disk_ops": {
"title": "Disk Operations ({{PI}}) on {{HOST}}",
"vertical": "Ops per second",
"type": "io",
"legend": {
"read": {
"name": "Read",
"color": "0000ff"
},
"write": {
"name": "Write",
"color": "00b000"
}
},
"legend_format": "%5.1lf%s"
}
}
27 changes: 27 additions & 0 deletions plugin/latency_vol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"netapp_vol_latency": {
"title": "Disk time per operation ({{PI}}) on {{HOST}}",
"vertical": "Avg. Time/Op",
"type": "io",
"legend": {
"read_ops": {
"name": "Read",
"color": "0000ff"
},
"write_ops": {
"name": "Write",
"color": "00b000"
},
"read_latency": {
"name": "Read Latency",
"color": "00b0aa"
},
"write_latency": {
"name": "Write Latency",
"color": "00b0dd"
}
},
"legend_format": "%5.1lf%ss",
"scale": 0.001
}
}
Loading