From: <buc...@us...> - 2008-01-25 04:39:04
|
Revision: 39 http://devmon.svn.sourceforge.net/devmon/?rev=39&view=rev Author: buchanmilne Date: 2008-01-24 20:38:53 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Switch maximum column to a preproccessor definition Get rid of hardcoded values in do_devmon.c Add initial patch for hobbit (excluding do_devmon.c for now) Modified Paths: -------------- trunk/extras/do_devmon.c Added Paths: ----------- trunk/extras/hobbit-4.2.0-devmon.patch Modified: trunk/extras/do_devmon.c =================================================================== --- trunk/extras/do_devmon.c 2008-01-24 06:14:29 UTC (rev 38) +++ trunk/extras/do_devmon.c 2008-01-25 04:38:53 UTC (rev 39) @@ -13,8 +13,8 @@ int do_devmon_rrd(char *hostname, char *testname, char *msg, time_t tstamp) { - int maxcols = 20; - char *devmon_params[maxcols+7]; +#define MAXCOLS 20 + char *devmon_params[MAXCOLS+7]; static char *devmon_tpl = NULL; char *eoln, *curline; @@ -27,13 +27,13 @@ curline = msg; while (curline) { char *fsline, *p; - char *columns[maxcols]; + char *columns[MAXCOLS]; int columncount; char *ifname = NULL; int pused = -1; int wanteddisk = 1; long long aused = 0; - int ds[maxcols]; + int ds[MAXCOLS]; char *dsval; int i; @@ -49,16 +49,16 @@ } if (in_devmon != 0 ) goto nextline; - for (columncount=0; (columncount<20); columncount++) columns[columncount] = ""; + for (columncount=0; (columncount<MAXCOLS); columncount++) columns[columncount] = ""; fsline = xstrdup(curline); columncount = 0; p = strtok(fsline, " "); - while (p && (columncount < 20)) { columns[columncount++] = p; p = strtok(NULL, " "); } + while (p && (columncount < MAXCOLS)) { columns[columncount++] = p; p = strtok(NULL, " "); } /* DS:ds0:COUNTER:600:0:U DS:ds1:COUNTER:600:0:U */ if (!strncmp(curline, "DS:",3)) { devmon_params[0] = "rrdcreate"; devmon_params[1] = rrdfn; dbgprintf("Looking for DS defintions in %s\n",curline); - while ( numds < 20) { + while ( numds < MAXCOLS) { dbgprintf("Seeing if column %d that has %s is a DS\n",numds,columns[numds]); if (strncmp(columns[numds],"DS:",3)) break; devmon_params[numds+2] = xstrdup(columns[numds]); Added: trunk/extras/hobbit-4.2.0-devmon.patch =================================================================== --- trunk/extras/hobbit-4.2.0-devmon.patch (rev 0) +++ trunk/extras/hobbit-4.2.0-devmon.patch 2008-01-25 04:38:53 UTC (rev 39) @@ -0,0 +1,46 @@ +--- ./hobbit-4.2.0/lib/hobbitrrd.c.devmon 2008-01-22 06:22:11.000000000 +0200 ++++ ./hobbit-4.2.0/lib/hobbitrrd.c 2008-01-25 06:09:27.000000000 +0200 +@@ -221,6 +221,9 @@ static char *hobbit_graph_text(char *hos + else if ((service != NULL) && (strcmp(graphdef->hobbitrrdname, "ncv") == 0)) { + sprintf(rrdservicename, "ncv:%s", service); + } ++ else if ((service != NULL) && (strcmp(graphdef->hobbitrrdname, "devmon") == 0)) { ++ sprintf(rrdservicename, "devmon:%s", service); ++ } + else { + strcpy(rrdservicename, graphdef->hobbitrrdname); + } +--- ./hobbit-4.2.0/hobbitd/etcfiles/hobbitserver.cfg.DIST.devmon 2006-08-09 22:10:07.000000000 +0200 ++++ ./hobbit-4.2.0/hobbitd/etcfiles/hobbitserver.cfg.DIST 2008-01-25 06:28:50.000000000 +0200 +@@ -132,11 +132,11 @@ RRDWIDTH="576" # The RRD's contain 576 + # + # This is also used by the bb-hostsvc.cgi script to determine if the detailed + # status view of a test should include a graph. +-TEST2RRD="cpu=la,disk,inode,qtree,memory,$PINGCOLUMN=tcp,http=tcp,dns=tcp,dig=tcp,time=ntpstat,vmstat,iostat,netstat,temperature,apache,bind,sendmail,mailq,nmailq=mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,files,procs=processes,ports,clock,lines" ++TEST2RRD="cpu=la,disk,inode,qtree,memory,$PINGCOLUMN=tcp,http=tcp,dns=tcp,dig=tcp,time=ntpstat,vmstat,iostat,netstat,temperature,apache,bind,sendmail,mailq,nmailq=mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,files,procs=processes,ports,clock,lines,if_load=devmon" + + # This defines which RRD files to include on the "trends" column webpage, + # and the order in which they appear. +-GRAPHS="la,disk,inode,qtree,files,processes,memory,users,vmstat,iostat,tcp.http,tcp,ncv,netstat,ifstat,mrtg::1,ports,temperature,ntpstat,apache,bind,sendmail,mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,clock,lines" ++GRAPHS="la,disk,inode,qtree,files,processes,memory,users,vmstat,iostat,tcp.http,tcp,ncv,netstat,ifstat,mrtg::1,ports,temperature,ntpstat,apache,bind,sendmail,mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,clock,lines,devmon" + + # These two settings can be used to restrict what filesystems are being + # tracked (i.e. have their utilisation graphed) by Hobbit. +--- ./hobbit-4.2.0/hobbitd/do_rrd.c.devmon 2006-08-09 22:10:05.000000000 +0200 ++++ ./hobbit-4.2.0/hobbitd/do_rrd.c 2008-01-25 06:23:58.000000000 +0200 +@@ -309,6 +309,7 @@ static int pickdata(char *buf, pcre *exp + #include "rrd/do_external.c" + #include "rrd/do_filesizes.c" + #include "rrd/do_counts.c" ++#include "rrd/do_devmon.c" + + #ifdef USE_BEA2 + #include "rrd/do_bea2.c" +@@ -368,6 +369,7 @@ void update_rrd(char *hostname, char *te + else if (strcmp(id, "proccounts") == 0) res = do_counts_rrd("processes", hostname, testname, msg, tstamp); + else if (strcmp(id, "portcounts") == 0) res = do_counts_rrd("ports", hostname, testname, msg, tstamp); + else if (strcmp(id, "linecounts") == 0) res = do_derives_rrd("lines", hostname, testname, msg, tstamp); ++ else if (strcmp(id, "devmon") == 0) res = do_devmon_rrd(hostname, testname, msg, tstamp); + + #ifdef DO_ORCA + else if (strcmp(id, "orca") == 0) res = do_orca_rrd(hostname, testname, msg, tstamp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |