[Nagios-devel] patch: comments in configs

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] patch: comments in configs

Post by Guest »

--=-F7J+X9mgd7uQ57MThdCp
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Tiny patch to keep a couple comment variations in main and object
configuration files from failing the pre-flight check.

--
Matthew Kent \ SA \ bravenet.com \ 1-250-954-3203 ext 108

--=-F7J+X9mgd7uQ57MThdCp
Content-Disposition: attachment; filename=nagios-2.0a1-comments.patch
Content-Type: text/x-patch; name=nagios-2.0a1-comments.patch; charset=
Content-Transfer-Encoding: 7bit

diff -U 3 -r nagios-cvs_orig/base/config.c nagios-cvs/base/config.c
--- nagios-cvs_orig/base/config.c Thu Mar 25 22:04:04 2004
+++ nagios-cvs/base/config.c Fri Mar 26 21:15:03 2004
@@ -3,7 +3,7 @@
* CONFIG.C - Configuration input and verification routines for Nagios
*
* Copyright (c) 1999-2004 Ethan Galstad ([email protected])
- * Last Modified: 03-25-2004
+ * Last Modified: 03-26-2004
*
* License:
*
@@ -237,12 +237,16 @@
/* process all lines in the config file */
for(current_line=1,fgets(input,MAX_INPUT_BUFFER-1,fp);!feof(fp);current_line++,fgets(input,MAX_INPUT_BUFFER-1,fp)){

- /* skip blank lines and comments */
- if(input[0]=='#' || input[0]=='\x0' || input[0]=='\n' || input[0]=='\r')
+ /* skip blank lines */
+ if(input[0]=='\x0' || input[0]=='\n' || input[0]=='\r')
continue;

strip(input);

+ /* skip comments */
+ if(input[0]=='#' || input[0]==';')
+ continue;
+
/* skip external data directives */
if(strstr(input,"x")==input)
continue;
diff -U 3 -r nagios-cvs_orig/xdata/xodtemplate.c nagios-cvs/xdata/xodtemplate.c
--- nagios-cvs_orig/xdata/xodtemplate.c Wed Mar 24 17:03:56 2004
+++ nagios-cvs/xdata/xodtemplate.c Fri Mar 26 21:17:07 2004
@@ -3,7 +3,7 @@
* XODTEMPLATE.C - Template-based object configuration data input routines
*
* Copyright (c) 2001-2004 Ethan Galstad ([email protected])
- * Last Modified: 03-24-2004
+ * Last Modified: 03-26-2004
*
* Description:
*
@@ -463,7 +463,7 @@

/* grab data before comment delimiter - faster than a strtok() and strncpy()... */
for(x=0;input[x]!='\x0';x++)
- if(input[x]==';')
+ if(input[x]==';' || input[x]=='#')
break;
input[x]='\x0';


--=-F7J+X9mgd7uQ57MThdCp--






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked