Re: [cricket-users] Graphing multiple views on one page.

From: pmckenna (pmckenna@uswest.net)
Date: Tue Oct 05 1999 - 19:23:39 PDT


From: pmckenna <pmckenna@uswest.net>

Neal this is cool and thanks.

I had kinda started a similar thing but got hung up on the fact that the rand arg to rrd was different for every graph I wanted to display. In this file yours
are all the same. What's the trick to this ?
This would certainly make life easier as I have hundreds of hosts to keep an eye on.

Thanks

Pete

"Neal S. Pressman" wrote:

> -> The later, many of the views allready have multiple datasources.
> -> I wish to have a single HTML page with all the views for a given target.
> -> Something like 12 datasources 3 or 4 views and all graphs generated for
> -> the views on the same html page.
> ->
>
> you will probally need to write your own script to build your custom
> pages.
>
> for example I user cricket to monitor my solaris servers i have 6 trees
> 2 of which may have multiple instances. to meet my needs i made a perl
> script to read my subtrees and fill in the blanks on a template.
>
> #!/bin/perl
>
> $cell="left";
> $HOST=$ARGV[0];
> print "<HTML>\n";
> print "<HEAD>\n";
> print "<TITLE>System usage $HOST</TITLE>\n";
> print "<META HTTP-EQUIV=\"Refresh\" CONTENT=300 >\n";
> print "<META HTTP-EQUIV=\"Expires\" CONTENT=\"Wed, 29 Oct 1997 21:00:00 GMT\">\n";
> print "</HEAD>\n";
> print "<BODY bgcolor=#ffffff>\n";
> print "\n";
> print "<H1>System Usage $HOST</H1>\n";
> print "<table border=0 width=\"100%\">\n";
> print "\n";
>
> open (TARGETS , "cricket-config/CPU-USAGE/cpus" );
> while (<TARGETS>){
> chop;
> if ( $_ =~ /^target/ ) {
> ($JNK , $target) = split ( ' ' , $_ );
> next if ( $target !~ /$HOST/ );
> ($mach , $cpu ) = split ( /_/ , $target );
>
> if ( "$cell" eq "left" ){
> print "<tr><td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FCPU-USAGE%2F$target&ranges=d%3Aw&view=Usage\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FCPU-USAGE%2F$target&dslist=WT%2CIDL%2CUSR%2CSYS&range=88000&rand=309\"></A>\n";
> print "</td>\n";
> $cell = "right";
> next;
> }
>
> if ( "$cell" eq "right" ){
> print "<td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FCPU-USAGE%2F$target&ranges=d%3Aw&view=Usage\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FCPU-USAGE%2F$target&dslist=WT%2CIDL%2CUSR%2CSYS&range=88000&rand=309\"></A>\n";
> print "</td></tr>\n";
> $cell = "left";
> next;
> }
>
> }
> }
> close (TARGETS);
> print "<tr><td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FMEM-USAGE%2F${HOST}_mem&ranges=d%3Aw&view=Memory\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FMEM-USAGE%2F${HOST}_mem&dslist=MEM%2CFREEMEM%2CSWAP%2CFREESWAP&range=88000&rand=309\"></A>\n";
> print "</td>\n";
>
> print "<td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FCACHE%2F${HOST}_cache&ranges=d%3Aw&view=Cache\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FCACHE%2F${HOST}_cache&dslist=DNLC%2CINODE&range=88000&rand=309\"></A>\n";
> print "</td></tr>\n";
>
> print "<tr><td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FVMSTAT%2F${HOST}_vmstat&ranges=d%3Aw&view=Vmstat\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FVMSTAT%2F${HOST}_vmstat&dslist=RUN%2CBLOCK%2CWAIT&range=88000&rand=309\"></A>\n";
> print "</td>\n";
>
> print "<td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FLOADAVE%2F${HOST}_loadave&ranges=d%3Aw&view=LoadAverage\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FLOADAVE%2F${HOST}_loadave&dslist=ONE%2CFIVE%2CFIFTEEN&range=88000&rand=309\"></A>\n";
> print "</td></tr>\n";
>
> open (TARGETS , "cricket-config/DUN/disks" );
> while (<TARGETS>){
> chop;
> if ( $_ =~ /^target/ ) {
> ($JNK , $target) = split ( ' ' , $_ );
> next if ( $target !~ /$HOST/ );
> ($mach , $cpu ) = split ( /_/ , $target );
>
> if ( "$cell" eq "left" ){
> print "<tr><td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FDUN%2F$target&ranges=d%3Aw&view=Usage\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FDUN%2F$target&dslist=DISK%2CMAX&range=88000&rand=309\"></A>\n";
> print "</td>\n";
> $cell = "right";
> next;
> }
>
> if ( "$cell" eq "right" ){
> print "<td><P><B>\n";
> print "<A HREF=\"../grapher.cgi?target=%2FDUN%2F$target&ranges=d%3Aw&view=Usage\">\n";
> print "<IMG BORDER=0 SRC=\"../grapher.cgi?type=gif&target=%2FDUN%2F$target&dslist=DISK%2CMAX&range=88000&rand=309\"></A>\n";
> print "</td></tr>\n";
> $cell = "left";
> next;
> }
>
> }
> }
> close (TARGETS);
> print "<tr><td><P><B>\n";
> print "</table>\n";
> print "</BODY></HTML>\n";

--------------------------- ONElist Sponsor ----------------------------

Does Windows keep ""bugging"" you? Can't get that PowerPoint slide to fit?
Get FREE real-time live expert support over the Internet at expertcity.com.
         <a href=" http://clickme.onelist.com/ad/expertcity7 ">Click Here</a>

------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Mon Mar 06 2000 - 19:01:03 PST