illegal_macro_output_chars and $SERVICEOUTPUT$

Matthias Kerk matthias at tuxlife.de
Tue Jan 29 18:57:35 CET 2008


Hi,

Nagios will not filtered illegal chars from $SERVICEOUTPUT$ and so on.


[1201267690.536801] [032.0] [pid=28051] ** Service Notification Attempt ** Host: 'matthiastest', Service: 'TEST', Type: 0, Options: 0, Current State: 1, Last Notification: Thu Jan 1 01:00:00 1970
[1201267690.536857] [032.0] [pid=28051] Notification viability test passed.
[1201267690.536867] [032.1] [pid=28051] Current notification number: 16 (incremented)
[1201267690.536875] [032.2] [pid=28051] Creating list of contacts to be notified.
[1201267690.537221] [032.1] [pid=28051] Service notification will NOT be escalated.
[1201267690.537236] [032.1] [pid=28051] Adding normal contacts for service to notification list.
[1201267690.537245] [032.2] [pid=28051] Adding members of contact group 'matthias' for service to notification list.
[1201267690.537253] [032.2] [pid=28051] Adding contact 'matthias' to notification list.
[1201267690.537302] [032.2] [pid=28051] ** Attempting to notifying contact 'matthias'...
[1201267690.537312] [032.2] [pid=28051] ** Checking service notification viability for contact 'matthias'...
[1201267690.537327] [032.2] [pid=28051] ** Service notification viability for contact 'matthias' PASSED.
[1201267690.537335] [032.2] [pid=28051] ** Notifying contact 'matthias'
[1201267690.537413] [032.2] [pid=28051] Raw notification command: /usr/bin/printf "%b" "***** Nagios 3.0rc1 *****\n\nNotification Type:
[1201267690.537422] [032.2] [pid=28051] Processed notification command: /usr/bin/printf "%b" "***** Nagios 3.0rc1 *****\n\nNotification Type: PROBLEM\n\nService: TEST\nHost: test.example.com\nAddress: 127.0.0.1\nState: WARNING\n\nDate/Time: Fri Jan 25
14:28:10 CET 2008\n\nAdditional Info:\n\nSNMP CRITICAL - 1 "md3 : active 'test' raid1 hdc5[2](F) hda5[0]"\n\nAttempt: 16" | /bin/mail -s "** PROBLEM alert - test.example.com/TEST is WARNING **" matthias-mail at example.com
[1201267690.559551] [032.2] [pid=28051] Raw notification command: /usr/bin/printf "%b" "Service:
[1201267690.559604] [032.2] [pid=28051] Processed notification command: /usr/bin/printf "%b" "Service: TEST\nHost: test.example.com\nAddress: 81.169.135.107\nState: WARNING\nInfo: SNMP CRITICAL - 1 "md3 : active 'test' raid1 hdc5[2](F) hda5[0]"\nDate:
Fri Jan 25 14:28:10 CET 2008" | /bin/mail -s "PROBLEM: test.example.com/TEST is WARNING" matthias-sms at example.com
[1201267690.581757] [032.2] [pid=28051] Calculating next valid notification time...
[1201267690.581811] [032.2] [pid=28051] Default interval: 120.000000
[1201267690.582192] [032.2] [pid=28051] Interval used for calculating next valid notification time: 120.000000
[1201267690.582222] [032.0] [pid=28051] No contacts were notified. Next possible notification time: Fri Jan 25 16:28:10 2008


I believe it is a problem in common/macro.c

  90     int clean_options=0;
...
 153             /* grab the macro value */
 154             result=grab_macro_value(temp_buffer,&selected_macro,&clean_options,&free_macro);
...
 196                 /* include any cleaning options passed back to us */
 197                 options&=clean_options;
...
 393 int grab_macro_value(char *macro_buffer, char **output, int *clean_options, int *free_macro){
...
 584         if(result==OK)
 585             *clean_options&=(STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS);


clean_options & (STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS) = 0

0  & (1|2) = 0

0  &  3  = 0


Best regards,
Matthias

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list