From: Sam A. <s_...@as...> - 2007-07-20 16:04:10
|
One question regarding your note. Where can I find the body of the the PERL script extra-rrd.pl, which you reference? I searched the system and then googled it to no avail. Kind thanks, -Samuel xbgmsharp wrote: > Hello, > > This mail describe how to graph all if_* data from Devmon to Hobbit. > I am currently running hobbit 4.2.0/all-in-one patch and devmon 0.3-beta2 > > 1) > First you need a curently working hobbit and devmon. > > 2) > Then make sure, than the file devmon/templates/modele/if_load/message > TABLE:rrd() > This will show data in a htmltable and add rrd information in the > status page. > > In order to check, you should see RRD data information in the status > page of the service corresponding to your devmon modele when showing > source html. > > 3) > Now make parse the data to create a rrd file (one par interfaces), > this is done via extra-rrd.pl. > In etc/hobbitlaunch.cfg > > [rrdstatus] > ENVFILE /data/hobbit/server/etc/hobbitserver.cfg > NEEDS hobbitd > CMD hobbitd_channel --channel=status \ > --log=$BBSERVERLOGS/rrd-status.log hobbitd_rrd \ > --rrddir=$BBVAR/rrd \ > --extra-script=$BBHOME/ext/extra-rrd.pl \ > --extra-tests=if_load > > In ext/extra-rrd.pl > > if ( $TESTNAME eq "if_load" ) { > > # Analyze the message we got > foreach $line (@input) { > if ($line =~ /(^[A-Z].*) (\d+):(\d+)$/ ) { > > # The RRD dataset definitions > print "DS:in:DERIVE:600:0:U\n"; > print "DS:out:DERIVE:600:0:U\n"; > > # The filename > print "if_load_$1.rrd\n"; > > # The data > print "$2:$3\n"; > } > } > } > > 4) > Modify etc/hobbitgraph.cfg > > [if_load] > FNPATTERN if_load(.*).rrd > TITLE Network Traffic > YAXIS Bits/second > DEF:in@RRDIDX@=@RRDFN@:in:AVERAGE > CDEF:inbytes@RRDIDX@=in@RRDIDX@,8,* > DEF:out@RRDIDX@=@RRDFN@:out:AVERAGE > CDEF:outbytes@RRDIDX@=out@RRDIDX@,8,* > LINE1:inbytes@RRDIDX@#@COLOR@:@RRDPARAM@ In > GPRINT:inbytes@RRDIDX@:LAST: %8.2lf %s (cur) > GPRINT:inbytes@RRDIDX@:MAX: %8.2lf %s (max) > GPRINT:inbytes@RRDIDX@:MIN: %8.2lf %s (min) > GPRINT:inbytes@RRDIDX@:AVERAGE: %8.2lf %s (avg)\n > LINE1:outbytes@RRDIDX@#@COLOR@:@RRDPARAM@ Out > GPRINT:outbytes@RRDIDX@:LAST: %8.2lf %s (cur) > GPRINT:outbytes@RRDIDX@:MAX: %8.2lf %s (max) > GPRINT:outbytes@RRDIDX@:MIN: %8.2lf %s (avg) > GPRINT:outbytes@RRDIDX@:AVERAGE: %8.2lf %s (avg)\n > > > 4) > In etc/hobbitserver.cfg > Modify the following. > See help/howtograph.html > > TEST2RRD="cpu=la,disk,...,if_load" > GRAPHS="la,disk,if_load::1" > The ::1 set the maxcount in order to make one graph form each rrd file > create. > > 5) > In etc/hobbitcgi.cfg > Modify the following. > See hobbitsvc.cgi man > > CGI_SVC_OPTS="--env=/data/hobbit/server/etc/hobbitserver.cfg > --no-svcid --history=top --multi-grahs=if_load,if_err..." > > 6) > The hardest part. > The hobbit parsing doesn't remove html table table so you will see > many graph link. > In order to fix than, you need to modify the hobbit source: > > lib/htmllog.c > > patch -p0 < htmllog.path > > Here is the path, this only set a new counter for all if_* services. > This is allready working for the trends colunms because, it is > checking all rrd file in the directory. > > Henrik, do you have any tips to get the nice counter without editing > the source code of htmllog.c file ? > > That's all folks. > > --Thanks for using xbgm# > http://xbgm.sourceforge.net/ > Please feedback. > ------------------------------------------------------------------------ > > Index: htmllog.c > =================================================================== > --- htmllog.c (revision 33) > +++ htmllog.c (working copy) > @@ -318,6 +318,7 @@ > } > if (rrd && graph) { > char *p, *multikey; > + int if_load, if_loadcount = 0; > if (multigraphs == NULL) multigraphs = ",disk,inode,qtree,"; > > /* > @@ -332,7 +333,8 @@ > if (strstr(multigraphs, multikey)) { > /* The "disk" report from the NetWare client puts a "warning light" on all entries */ > int netwarediskreport = (strstr(firstline, "NetWare Volumes") != NULL); > - > + if (strncmp(service, "if_", 3) == 0) > + if_load = 1; > /* Count how many lines are in the status message. This is needed by hobbitd_graph later */ > linecount = 0; p = restofmsg; > do { > @@ -347,6 +349,9 @@ > /* We found something that is not blank, so one more line */ > if (!netwarediskreport) linecount++; > } > + if ((if_load == 1) && (isalpha(*p)) && > + ((*(p+1) != 'n') && (*(p+1) != 'u') && (*(p+1) != 'l') && (*(p+1) != 'S') && (*(p+1) != 'e'))) > + if_loadcount++; > /* Then skip forward to the EOLN */ > p = strchr(p, '\n'); > } > @@ -357,6 +362,8 @@ > } > xfree(multikey); > > + if (if_load == 1) > + linecount = if_loadcount; > fprintf(output, "<!-- linecount=%d -->\n", linecount); > fprintf(output, "%s\n", hobbit_graph_data(hostname, displayname, service, color, graph, linecount, HG_WITHOUT_STALE_RRDS, HG_PLAIN_LINK)); > } > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ------------------------------------------------------------------------ > > _______________________________________________ > Devmon-support mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/devmon-support > -- ************** The information in this email, and in any attachments, may contain confidential information and is intended solely for the attention and use of the named addressee(s). It must not be disclosed to any person without the written authorization of Sam Asher Computing Services, Inc. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorized to, and must not, disclose, copy, distribute, or retain this message or any part of it. *************** |