From: Buchan M. <bg...@st...> - 2008-04-29 07:52:29
|
On Tuesday 22 April 2008 22:28:48 Epp, Matthew Mr CTR USA USAASC wrote: > I've created a small modification that causes devmon to obey the > BBLOCATION identifier. Nice. I've been wanting to implement this myself (in the meantime I was planning on using different tags instead (e.g. DEVMONxxx). > It should now simply skip any entries in your > bb-hosts that aren't set to that server's network. Let me know if there > are any bugs in this. See in-line. > I haven't seen any yet on my own systems. > > Make these changes in the modules directory It would be much more convenient if you could send a diff from subversion (checkout, merge/copy your changes in, then run 'svn diff'). If that's not easy, a context diff (diff -u) would be more readable. If you're on a system without a decent diff, this will have to do ... > : > -------------------------------------------- > $diff dm_config.pm.orig dm_config.pm.new > 56a57 > > > 'bbnet' => '', > > 123a125,128 > > > 'bbconf' => { 'default' => > > '/home/hobbit/server/etc/hobbitserver.cfg', > > > 'regex' => '.+', > > 'set' => 0, > > 'case' => 1 }, > > 127a133,136 > > > 'bbnet' => { 'default' => '', > > 'regex' => '\w+', > > 'set' => 0, > > 'case' => 1 }, > > 240a250,259 > > > # Read the BBLOCATION from the hobbitserver.cfg file > > open(CONFFILE, "$g{'bbconf'}") || do_log("Error opening conf It would probably be better to test if bbconf is set, instead of logging an error message for people who aren't using this feature. > file $g{'bbconf'}.\n"); > > > while(<CONFFILE>) { > > if (/^BBLOCATION\=\"(.+)\"/) { > > print "NET is $1\n"; > > $g{'bbnet'} = $1; > > } > > } > > close (CONFFILE); > > 865d883 > < > 1269a1288,1293 > > > # Skip if the NET tag does not match this site > > unless($bbopts =~ /NET:$g{'bbnet'}/) { > > do_log("The NET for $host is not $g{'bbnet'}. > > Skipping.",0); > > > next; > > } > > --------------------------------------- > > And add this section to your devmon.cfg file: > --------------------------------------- > # BBSERVERCONF: Location of the hobbitserver.cfg file. We use this to > read in > # the BBLOCATION variable so we can ignore tests not meant for this site. > # (case sensitive) [DEFAULT: /home/hobbit/server/etc/hobbitserver.cfg] > BBCONF=/home/hobbit/server/etc/hobbitserver.cfg > --------------------------------------- I'll take a look in more detail during the day, and may consider merging it in today if I have time (as I should probably implement this on our production system so I can start merging configs from 3 different Hobbit/Devmon systems). If I don't get to it today, an improved patch would be great (yes, I am trying to improve participation :-P). Regards, Buchan |