[patch] "config" download area is now a setting

Charles Goyard cgoyard at cvf.fr
Fri Dec 1 18:45:50 CET 2006


Hi Henrik,

here is a small but convenient patch, that helps keep the etc/ directory
of the hobbit server tidy.

Something handy would be to have a automatic suffix-with-hostname before
opening the file, and fallback on the straight requested filename. That
is, requesting bb-mysql.cfg from "foo.bar.com" would search for
"bb-mysql.cfg-foo.bar.com" and then for "bb-mysql.cfg". I may add this
early next week if you didn't already :).


Regards,

-- 
Charles Goyard - cgoyard at cvf.fr - (+33) 1 45 38 01 31
-------------- next part --------------
--- upstream-2006-10-03/hobbitd/hobbitd.c	2006-11-24 17:18:57.000000000 +0100
+++ cvf/hobbitd/hobbitd.c	2006-12-01 18:30:49.000000000 +0100
@@ -1910,7 +1910,7 @@
 	strbuffer_t *inbuf, *result;
 
 	dbgprintf("-> get_config %s\n", fn);
-	sprintf(fullfn, "%s/etc/%s", xgetenv("BBHOME"), fn);
+	sprintf(fullfn, "%s/%s", xgetenv("CLIENTEXTCFG"), fn);
 	fd = stackfopen(fullfn, "r", NULL);
 	if (fd == NULL) {
 		errprintf("Config file %s not found\n", fn);
--- upstream-2006-10-03/lib/environ.c	2006-11-24 17:18:08.000000000 +0100
+++ cvf/lib/environ.c	2006-12-01 18:29:43.000000000 +0100
@@ -89,6 +89,7 @@
 	{ "BBHOSTHISTLOG", "TRUE" },
 	{ "SAVESTATUSLOG", "TRUE" },
 	{ "CLIENTLOGS", "$BBVAR/hostdata" },
+	{ "CLIENTEXTCFG", "$BBHOME/etc" },
 	{ "MAILC", "mail" },
 	{ "MAIL", "$MAILC -s" },
 	{ "SVCCODES", "disk:100,cpu:200,procs:300,svcs:350,msgs:400,conn:500,http:600,dns:800,smtp:725,telnet:723,ftp:721,pop:810,pop3:810,pop-3:810,ssh:722,imap:843,ssh1:722,ssh2:722,imap2:843,imap3:843,imap4:843,pop2:809,pop-2:809,nntp:819,test:901" },
--- upstream-2006-10-03/common/hobbitserver.cfg.5	2006-11-24 17:18:09.000000000 +0100
+++ cvf/common/hobbitserver.cfg.5	2006-12-01 18:20:16.000000000 +0100
@@ -183,6 +183,13 @@
 module.
 Default: $BBVAR/hostdata/
 
+.IP CLIENTEXTCFG
+Directory for storing client-side configuration files. They can be
+retrieved from within extension scripts with the "config" command of
+the
+.I bb(1)
+utility.
+Default: $BBHOME/etc
 
 .SH SYSTEM FILES
 


More information about the Xymon mailing list