Skip to content

Commit 44e3ed0

Browse files
author
Jamie Isaacs
committed
Adding my custom procstat, diskstat, and jmx monitoring tools.
1 parent 85e30c5 commit 44e3ed0

17 files changed

Lines changed: 1826 additions & 0 deletions

diskstat/conf.d/diskstat.pyconf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
3+
modules {
4+
module {
5+
name = 'diskstat'
6+
language = 'python'
7+
8+
param devices {
9+
value = 'sda'
10+
}
11+
}
12+
}
13+
14+
collection_group {
15+
collect_every = 30
16+
time_threshold = 30
17+
18+
metric {
19+
name_match = "diskstat_(.+)"
20+
}
21+
}
22+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
/* Pass in by reference! */
4+
function graph_diskstat_disktime_report ( &$rrdtool_graph ) {
5+
6+
global $context,
7+
$hostname,
8+
$graph_var,
9+
$range,
10+
$rrd_dir,
11+
$size,
12+
$strip_domainname;
13+
14+
if ($strip_domainname) {
15+
$hostname = strip_domainname($hostname);
16+
}
17+
18+
$disk = $graph_var;
19+
$title = $disk.' Time on Disk';
20+
if ($context != 'host') {
21+
$rrdtool_graph['title'] = $title;
22+
} else {
23+
$rrdtool_graph['title'] = "$hostname $title last $range";
24+
}
25+
$rrdtool_graph['vertical-label'] = 'ms';
26+
$rrdtool_graph['extras'] = '--rigid';
27+
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
28+
29+
$series = "DEF:'read'='${rrd_dir}/diskstat_${disk}_read_time.rrd':'sum':AVERAGE "
30+
."DEF:'write'='${rrd_dir}/diskstat_${disk}_write_time.rrd':'sum':AVERAGE "
31+
."CDEF:'_write'=write,-1,* "
32+
."AREA:'read'#8F005C:'Reading' "
33+
."AREA:'_write'#002A97:'Writing' "
34+
."LINE1:'0'#00000066:'' "
35+
;
36+
37+
$rrdtool_graph['series'] = $series;
38+
39+
return $rrdtool_graph;
40+
41+
}
42+
43+
?>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/* Pass in by reference! */
4+
function graph_diskstat_iotime_report ( &$rrdtool_graph ) {
5+
6+
global $context,
7+
$hostname,
8+
$graph_var,
9+
$range,
10+
$rrd_dir,
11+
$size,
12+
$strip_domainname;
13+
14+
if ($strip_domainname) {
15+
$hostname = strip_domainname($hostname);
16+
}
17+
18+
$disk = $graph_var;
19+
$title = $disk.' IO Time';
20+
if ($context != 'host') {
21+
$rrdtool_graph['title'] = $title;
22+
} else {
23+
$rrdtool_graph['title'] = "$hostname $title last $range";
24+
}
25+
$rrdtool_graph['lower-limit'] = '0';
26+
$rrdtool_graph['vertical-label'] = 'ms';
27+
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
28+
29+
$series = "DEF:'io'='${rrd_dir}/diskstat_${disk}_io_time.rrd':'sum':AVERAGE "
30+
."DEF:'weighted_io'='${rrd_dir}/diskstat_${disk}_weighted_io_time.rrd':'sum':AVERAGE "
31+
."LINE1:'io'#700004:'IO' "
32+
."LINE1:'weighted_io'#5D868C:'Weighted IO' "
33+
;
34+
35+
$rrdtool_graph['series'] = $series;
36+
37+
return $rrdtool_graph;
38+
39+
}
40+
41+
?>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/* Pass in by reference! */
4+
function graph_diskstat_operations_report ( &$rrdtool_graph ) {
5+
6+
global $context,
7+
$hostname,
8+
$graph_var,
9+
$range,
10+
$rrd_dir,
11+
$size,
12+
$strip_domainname;
13+
14+
if ($strip_domainname) {
15+
$hostname = strip_domainname($hostname);
16+
}
17+
18+
$disk = $graph_var;
19+
$title = $disk.' Operations';
20+
if ($context != 'host') {
21+
$rrdtool_graph['title'] = $title;
22+
} else {
23+
$rrdtool_graph['title'] = "$hostname $title last $range";
24+
}
25+
$rrdtool_graph['vertical-label'] = 'ops';
26+
$rrdtool_graph['extras'] = '--rigid';
27+
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
28+
29+
$series = "DEF:'reads'='${rrd_dir}/diskstat_${disk}_reads.rrd':'sum':AVERAGE "
30+
."DEF:'reads_merged'='${rrd_dir}/diskstat_${disk}_reads_merged.rrd':'sum':AVERAGE "
31+
."DEF:'writes'='${rrd_dir}/diskstat_${disk}_writes.rrd':'sum':AVERAGE "
32+
."DEF:'writes_merged'='${rrd_dir}/diskstat_${disk}_writes_merged.rrd':'sum':AVERAGE "
33+
."CDEF:'_writes'=writes,-1,* "
34+
."CDEF:'_writes_merged'=writes_merged,-1,* "
35+
."AREA:'reads'#FA6900:'Reads' "
36+
."STACK:'reads_merged'#F38630:'Reads Merged' "
37+
."AREA:'_writes'#69D2E7:'Writes' "
38+
."STACK:'_writes_merged'#A7DBD8:'Writes Merged' "
39+
."LINE1:'0'#00000066:'' "
40+
;
41+
42+
$rrdtool_graph['series'] = $series;
43+
44+
return $rrdtool_graph;
45+
46+
}
47+
48+
?>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
/* Pass in by reference! */
4+
function graph_diskstat_readwritekb_report ( &$rrdtool_graph ) {
5+
6+
global $context,
7+
$hostname,
8+
$graph_var,
9+
$range,
10+
$rrd_dir,
11+
$size,
12+
$strip_domainname;
13+
14+
if ($strip_domainname) {
15+
$hostname = strip_domainname($hostname);
16+
}
17+
18+
$disk = $graph_var;
19+
$title = $disk.' Data Transferred';
20+
if ($context != 'host') {
21+
$rrdtool_graph['title'] = $title;
22+
} else {
23+
$rrdtool_graph['title'] = "$hostname $title last $range";
24+
}
25+
$rrdtool_graph['lower-limit'] = '0';
26+
$rrdtool_graph['vertical-label'] = 'Bytes/sec';
27+
$rrdtool_graph['extras'] = '--rigid --base 1024';
28+
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
29+
30+
$series = "DEF:'readKBytes'='${rrd_dir}/diskstat_${disk}_read_kbytes_per_sec.rrd':'sum':AVERAGE "
31+
."DEF:'writeKBytes'='${rrd_dir}/diskstat_${disk}_write_kbytes_per_sec.rrd':'sum':AVERAGE "
32+
."CDEF:'read_bytes'=readKBytes,1024,* "
33+
."CDEF:'write_bytes'=writeKBytes,1024,* "
34+
."LINE1:'read_bytes'#700004:'Read' "
35+
."LINE1:'write_bytes'#5D868C:'Written' "
36+
;
37+
38+
$rrdtool_graph['series'] = $series;
39+
40+
return $rrdtool_graph;
41+
42+
}
43+
44+
?>

0 commit comments

Comments
 (0)