ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/rrdgraphing/graph.pl
(Generate patch)

Comparing projects/cms/source/reports/rrdgraphing/graph.pl (file contents):
Revision 1.11 by tdb, Mon Oct 21 13:02:58 2002 UTC vs.
Revision 1.12 by tdb, Mon Mar 10 11:34:43 2003 UTC

# Line 156 | Line 156 | foreach my $machine (@rrddirlist) {
156              # and add it to the graph
157              push @rawdata, "AREA:peruse#CCCCFF:% memory in use";
158              push @rawdata, "--upper-limit=100";
159 +            push @rawdata, "--base=1024";
160              # add some nice values to the legend
161              &addlegend(\@rawdata, "peruse");
162              # put the total memory on the graph so we can map percentages to real values
163 <            push @rawdata, "GPRINT:total:LAST:Current total memory\\: \%.2lf %sMb\\c";
163 >            push @rawdata, "GPRINT:total:LAST:Current total memory\\: \%.2lf %sb\\c";
164              &makegraph($machine, $1, "Memory Usage for $machine", "% memory in use", \@data, \@rawdata);
165          }
166          if($rrd =~ /^(load)\.rrd$/) {
# Line 191 | Line 192 | foreach my $machine (@rrddirlist) {
192              # and add it to the graph
193              push @rawdata, "AREA:peruse#CCCCFF:% swap in use";
194              push @rawdata, "--upper-limit=100";
195 +            push @rawdata, "--base=1024";
196              # add some nice values to the legend
197              &addlegend(\@rawdata, "peruse");
198              # put the total swap on the graph so we can map percentages to real values
199 <            push @rawdata, "GPRINT:total:LAST:Current total swap\\: \%.2lf %sMb\\c";
199 >            push @rawdata, "GPRINT:total:LAST:Current total swap\\: \%.2lf %sb\\c";
200              &makegraph($machine, $1, "Swap Usage for $machine", "% swap in use", \@data, \@rawdata);
201          }
202          if($rrd =~ /^(users)\.rrd$/) {
# Line 204 | Line 206 | foreach my $machine (@rrddirlist) {
206          }
207          if($rrd =~ /^(paging)\.rrd$/) {
208              my(@data);
209 <            push @data, "LINE2:$1:swapins:swapins#00FF00:OK:swap pages in ";
210 <            push @data, "LINE2:$1:swapouts:swapouts#0000FF:OK:swap pages out";
209 >            push @data, "LINE2:$1:pageins:pageins#00FF00:OK:pages paged in ";
210 >            push @data, "LINE2:$1:pageouts:pageouts#0000FF:OK:pages paged out";
211              &makegraph($machine, $1, "Paging on $machine", "pages per second", \@data);
212          }
213 <        if($rrd =~ /^(disk)-(\S+).rrd$/) {
213 >        if($rrd =~ /^(disk)-(\S+)\.rrd$/) {
214              my(@data);
215              my(@rawdata);
216              # we need this lot for our calculations, but we'll never show them
217 <            push @data, "NONE:$1-$2:kbytes:kbytes#0000FF:NONE:total size\\n";
217 >            push @data, "NONE:$1-$2:total:total#0000FF:NONE:total size\\n";
218              push @data, "NONE:$1-$2:used:used#CCCCFF:NONE:used space";
219              push @data, "NONE:$1-$2:totalinodes:totalinodes#000000:NONE:total inodes";
220              push @data, "NONE:$1-$2:freeinodes:freeinodes#000000:NONE:free inodes";
221              # calculate peruse, add it to the graph, and add a legend
222 <            push @rawdata, "CDEF:peruse=used,kbytes,/,100,*";
222 >            push @rawdata, "CDEF:peruse=used,total,/,100,*";
223              push @rawdata, "AREA:peruse#CCCCFF:% disk used  ";
224              &addlegend(\@rawdata, "peruse");
225              # put the total space on the graph so we can map percentages to real values
226 <            push @rawdata, "GPRINT:kbytes:LAST:Current total space\\: \%.2lf %sKb\\c";
226 >            push @rawdata, "GPRINT:total:LAST:Current total space\\: \%.2lf %sb\\c";
227              # calculate perinodeuse, add it to the graph, and add a legend
228              push @rawdata, "CDEF:perinodeuse=totalinodes,freeinodes,totalinodes,LT,freeinodes,0,IF,-,totalinodes,/,100,*";
229              push @rawdata, "LINE2:perinodeuse#FF4444:% inodes used";
230              push @rawdata, "--upper-limit=100";
231 +            push @rawdata, "--base=1024";
232              &addlegend(\@rawdata, "perinodeuse");
233              # put the total inodes on the graph so we can map percentages to real values
234              push @rawdata, "GPRINT:totalinodes:LAST:Current total inodes\\: \%.2lf %s\\c";
# Line 237 | Line 240 | foreach my $machine (@rrddirlist) {
240              $nicename =~ s/$hex_underscore/_/g;
241              &makegraph($machine, "$type-$name", "Disk Usage for $machine on $nicename", "% usage", \@data, \@rawdata);
242          }
243 +        if($rrd =~ /^(diskio)-(\S+)\.rrd$/) {
244 +            my(@data);
245 +            my(@rawdata);
246 +            push @data, "LINE2:$1-$2:rbytes:rbytes#00FF00:OK:read bytes ";
247 +            push @data, "LINE2:$1-$2:wbytes:wbytes#0000FF:OK:write bytes";
248 +            push @rawdata, "--base=1024";
249 +            &makegraph($machine, "$1-$2", "Disk IO for $machine on $2", "bytes per second", \@data, \@rawdata);
250 +        }
251 +        if($rrd =~ /^(net)-(\S+)\.rrd$/) {
252 +            my(@data);
253 +            my(@rawdata);
254 +            push @data, "LINE2:$1-$2:rx:rx#00FF00:OK:received bytes  ";
255 +            push @data, "LINE2:$1-$2:tx:tx#0000FF:OK:transfered bytes";
256 +            push @rawdata, "--base=1024";
257 +            &makegraph($machine, "$1-$2", "Network IO for $machine on $2", "bytes per second", \@data, \@rawdata);
258 +        }
259          # probably a queue with a name like this :)
260          if($rrd =~ /^(\d+)_0\.rrd$/) {
261              my(@data);
# Line 399 | Line 418 | sub addlegend() {
418      push @$dataref, "GPRINT:$name:LAST:Current\\: \%8.2lf %s";
419      push @$dataref, "GPRINT:$name:AVERAGE:Average\\: \%8.2lf %s";
420      push @$dataref, "GPRINT:$name:MAX:Max\\: \%8.2lf %s\\n";
402    #push @$dataref, "GPRINT:$name:MIN:Min\\: \%8.2lf %s\\n";
421   }
422  
423   # hacky subroutine to return a colour

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines