Re: [Nagios-devel] Bug and (loosely related) patch: Nagios 3.2.1

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

Re: [Nagios-devel] Bug and (loosely related) patch: Nagios 3.2.1

Post by Guest »

This is a multi-part message in MIME format.
--------------080708080400040000010703
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 08/25/2010 01:58 PM, Jochen Bern wrote:
> On 08/24/2010 11:30 PM, Jochen Bern wrote:
>> I wrote a patch for config.c which makes the links display the
>> appropriate "expansion" right away.
> Update:

2nd update (sorry for the spamming :-C ) ...
-- Removed a blob of superseded code
-- Changed the "(undefined/empty)" non(!)-error from #F00 to #00F
-- Explicit message when command_name is undefined
-- Text input field to enter/modify the command on the fly, hence ...
-- ... now listed in top right for direct access, too
-- For all other modes, added an to the to manually
narrow down the listings

Kind regards,
J. Bern
--=20
Jochen Bern, Systemingenieur --- LINworks GmbH
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP =3D D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C2=
7
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Gesch=E4ftsf=FChrer Metin Dogan, Oliver Mic=
hel

--------------080708080400040000010703
Content-Type: text/plain;
name="nagios-3.2.1-CommandExpand-patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="nagios-3.2.1-CommandExpand-patch.txt"

--- config.c.orig 2009-05-15 16:02:47.000000000 +0200
+++ config.c 2010-08-26 14:43:09.000000000 +0200
@@ -65,6 +65,7 @@
#define DISPLAY_HOSTDEPENDENCIES 11
#define DISPLAY_HOSTESCALATIONS 12
#define DISPLAY_SERVICEGROUPS 15
+#define DISPLAY_COMMAND_EXPANSION 16211

void document_header(int);
void document_footer(void);
@@ -84,6 +85,7 @@
void display_serviceescalations(void);
void display_hostdependencies(void);
void display_hostescalations(void);
+void display_command_expansion(void);

void unauthorized_message(void);

@@ -91,9 +93,24 @@
authdata current_authdata;

int display_type=DISPLAY_NONE;
+char to_expand[MAX_COMMAND_BUFFER];
+char *command_args[MAX_COMMAND_ARGUMENTS];
+char hashed_color[8];

int embedded=FALSE;

+void print_expand_input(int type){
+ char *seldesc="";
+
+ if (type==DISPLAY_COMMAND_EXPANSION) return; /* Has its own form, w/ larger */
+ else if (type==DISPLAY_SERVICEDEPENDENCIES){ seldesc=" Dependencies with Host"; }
+ else if (type==DISPLAY_SERVICEESCALATIONS){ seldesc=" Escalations on Host"; }
+ else if (type==DISPLAY_HOSTDEPENDENCIES){ seldesc=" Dependencies on/of Host"; }
+ else if (type==DISPLAY_HOSTESCALATIONS){ seldesc=" Escalations for Host"; }
+ printf("Show Only%s:\n",seldesc);
+ printf("",html_encode(to_expand,FALSE));
+ }

int main(void){
int result=OK;
@@ -153,8 +170,8 @@

if(display_type!=DISPLAY_NONE){

- printf("\n",CONFIG_CGI);
printf("\n");
+ printf("\n",CONFIG_CGI);

printf("Object Type:\n");
printf("");
@@ -171,12 +188,16 @@
printf("Contact Groups\n",(display_type==DISPLAY_CONTACTGROUPS)?"SELECTED":"");
printf("Timeperiods\n",(display_type==DISPLAY_TIMEPERIODS)?"SELECTED":"");
printf("Commands\n",(display_type==DISPLAY_COMMANDS)?"SELECTED":"");
+ printf("Command Expansion\n",(display_type==DISPLAY_COMMAND_EXPANSION)?"SELECTED":"");
printf("\n");
printf("\n");

+ print_expand_input(display_type);
+
printf("\n");
- printf("\n");
printf("\n");
+
+ printf("\n");
}

/* display context-sensitive help */
@@ -217,6 +238,10 @@
case DISPLAY_HOSTESCALATIONS:
dis

...[email truncated]...


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