Skip to content
This repository has been archived by the owner. It is now read-only.

[dev.icinga.com #3397] faulty macro cleaning, replacing spaces with pluses where they shouldn't be cleaned #1144

Closed
icinga-migration opened this issue Oct 24, 2012 · 7 comments

Comments

Projects
None yet
1 participant
@icinga-migration
Copy link
Member

commented Oct 24, 2012

This issue has been migrated from Redmine: https://dev.icinga.com/issues/3397

Created by mcp on 2012-10-24 19:02:43 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2012-10-24 22:55:06 +00:00)
Target Version: 1.8.1
Last Update: 2012-10-24 22:55:06 +00:00 (in Redmine)

Icinga Version: 1.8.0
OS Version: Debian Squeeze

since Icinga v1.8.0 space is replaced by + sign in notification mails, i.e.:

Subject: ** Service RECOVERY alert - alias/Kernel/System+Errors is OK **
  Notification Type: RECOVERY
            Service: Kernel/System+Errors
               Host: fqdn
            Address: 192.168.0.1
              State: OK for 0d+0h+0m+16s

look at service name which is "Kernel/System Errors" and look at state where you can see 0d+0h+0m+16s.

The above are $SERVICEDESC$ and $SERVICEDURATION$ macro

Bug? Feature?

Attachments

  • 3397.cfg mfriedrich - 2012-10-24 20:33:14 +00:00

Changesets

2012-10-24 21:54:08 +00:00 by mfriedrich b85adb0

fix faulty macro cleaning, replacing spaces with pluses where they shouldn't be cleaned (refs #3397)

leftover from the macro speedup rewrite - the 0 initialize was missing,
and under random circumstances the previous value was taken, making it
impossible to determine which macros to clean, and which not (as this is
now computed when initializing the macros, and not when grabbing their
values).

added a testcase as well.

2012-10-24 22:01:37 +00:00 by mfriedrich e66ef9d

fix faulty macro cleaning, replacing spaces with pluses where they shouldn't be cleaned (refs #3397)

leftover from the macro speedup rewrite - the 0 initialize was missing,
and under random circumstances the previous value was taken, making it
impossible to determine which macros to clean, and which not (as this is
now computed when initializing the macros, and not when grabbing their
values).

added a testcase as well.

2012-10-24 22:19:09 +00:00 by mfriedrich e45ca1c

update Changelog from previous fix (refs #3397)

Relations:

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 24, 2012

Updated by mfriedrich on 2012-10-24 20:33:14 +00:00

  • File added 3397.cfg
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 24, 2012

Updated by mfriedrich on 2012-10-24 21:48:54 +00:00

unpatched 1.8.0

[1351109873.083701] [016.0] [pid=9652] Checking service '3397 macro clean' on host '3397localhost'...
[1351109873.083755] [001.0] [pid=9652] get_raw_command_line_r()
[1351109873.083775] [2320.2] [pid=9652] Raw Command Input: /bin/echo "svc: $SERVICEDESC$ dur: $SERVICEDURATION$"
[1351109873.083792] [2320.2] [pid=9652] Expanded Command Output: /bin/echo "svc: $SERVICEDESC$ dur: $SERVICEDURATION$"
[1351109873.083802] [001.0] [pid=9652] process_macros_r()
[1351109873.083812] [2048.1] [pid=9652] **** BEGIN MACRO PROCESSING ***********
[1351109873.083822] [2048.1] [pid=9652] Processing: '/bin/echo "svc: $SERVICEDESC$ dur: $SERVICEDURATION$"'
[1351109873.083832] [2048.2] [pid=9652]   Processing part: '/bin/echo "svc: '
[1351109873.083843] [2048.2] [pid=9652]   Not currently in macro.  Running output (16): '/bin/echo "svc: '
[1351109873.083853] [2048.2] [pid=9652]   Processing part: 'SERVICEDESC'
[1351109873.083866] [2048.2] [pid=9652]   macros[3] (SERVICEDESC) match.
[1351109873.083877] [2048.2] [pid=9652]   Processed 'SERVICEDESC', Clean Options: 0, Free: 1
[1351109873.083916] [2048.2] [pid=9652]   Processed 'SERVICEDESC', Clean Options: 0, Free: 1
[1351109873.083927] [2048.2] [pid=9652]   Cleaning options: global=0, local=0, effective=0
[1351109873.083937] [2048.2] [pid=9652]   Uncleaned macro.  Running output (32): '/bin/echo "svc: 3397 macro clean'
[1351109873.083947] [2048.2] [pid=9652]   Just finished macro.  Running output (32): '/bin/echo "svc: 3397 macro clean'
[1351109873.083957] [2048.2] [pid=9652]   Processing part: ' dur: '
[1351109873.083967] [2048.2] [pid=9652]   Not currently in macro.  Running output (38): '/bin/echo "svc: 3397 macro clean dur: '
[1351109873.083976] [2048.2] [pid=9652]   Processing part: 'SERVICEDURATION'
[1351109873.083987] [2048.2] [pid=9652]   macros[36] (SERVICEDURATION) match.
[1351109873.083996] [2048.2] [pid=9652]   New clean options: 4
[1351109873.084010] [2048.2] [pid=9652]   Processed 'SERVICEDURATION', Clean Options: 4, Free: 1
[1351109873.084025] [2048.2] [pid=9652]   Processed 'SERVICEDURATION', Clean Options: 4, Free: 1
[1351109873.084040] [2048.2] [pid=9652]   Cleaning options: global=0, local=4, effective=4
[1351109873.084076] [2048.2] [pid=9652]   Uncleaned macro.  Running output (56): '/bin/echo "svc: 3397 macro clean dur: 15637d+20h+17m+53s'
[1351109873.084094] [2048.2] [pid=9652]   Just finished macro.  Running output (56): '/bin/echo "svc: 3397 macro clean dur: 15637d+20h+17m+53s'
[1351109873.084110] [2048.2] [pid=9652]   Processing part: '"'
[1351109873.084121] [2048.2] [pid=9652]   Not currently in macro.  Running output (57): '/bin/echo "svc: 3397 macro clean dur: 15637d+20h+17m+53s"'
[1351109873.084131] [2048.1] [pid=9652]   Done.  Final output: '/bin/echo "svc: 3397 macro clean dur: 15637d+20h+17m+53s"'
[1351109873.084140] [2048.1] [pid=9652] **** END MACRO PROCESSING *************

patched git

[1351115161.134280] [001.0] [pid=8485] process_macros_r()
[1351115161.134290] [2048.1] [pid=8485] **** BEGIN MACRO PROCESSING ***********
[1351115161.134300] [2048.1] [pid=8485] Processing: '/bin/echo "svc: $SERVICEDESC$ dur: $SERVICEDURATION$"'
[1351115161.134342] [2048.2] [pid=8485]   Processing part: '/bin/echo "svc: '
[1351115161.134358] [2048.2] [pid=8485]   Not currently in macro.  Running output (16): '/bin/echo "svc: '
[1351115161.134368] [2048.2] [pid=8485]   Processing part: 'SERVICEDESC'
[1351115161.134460] [2048.2] [pid=8485]   macros[3] (SERVICEDESC) match.
[1351115161.134481] [2048.2] [pid=8485]   Processed 'SERVICEDESC', Clean Options: 0, Free: 1
[1351115161.134532] [2048.2] [pid=8485]   Processed 'SERVICEDESC', Clean Options: 0, Free: 1
[1351115161.134541] [2048.2] [pid=8485]   Cleaning options: global=0, local=0, effective=0
[1351115161.134552] [2048.2] [pid=8485]   Uncleaned macro.  Running output (32): '/bin/echo "svc: 3397 macro clean'
[1351115161.134562] [2048.2] [pid=8485]   Just finished macro.  Running output (32): '/bin/echo "svc: 3397 macro clean'
[1351115161.134572] [2048.2] [pid=8485]   Processing part: ' dur: '
[1351115161.134581] [2048.2] [pid=8485]   Not currently in macro.  Running output (38): '/bin/echo "svc: 3397 macro clean dur: '
[1351115161.134591] [2048.2] [pid=8485]   Processing part: 'SERVICEDURATION'
[1351115161.134601] [2048.2] [pid=8485]   macros[36] (SERVICEDURATION) match.
[1351115161.134615] [2048.2] [pid=8485]   Processed 'SERVICEDURATION', Clean Options: 0, Free: 1
[1351115161.134625] [2048.2] [pid=8485]   Processed 'SERVICEDURATION', Clean Options: 0, Free: 1
[1351115161.134635] [2048.2] [pid=8485]   Cleaning options: global=0, local=0, effective=0
[1351115161.134653] [2048.2] [pid=8485]   Uncleaned macro.  Running output (50): '/bin/echo "svc: 3397 macro clean dur: 0d 1h 28m 8s'
[1351115161.134664] [2048.2] [pid=8485]   Just finished macro.  Running output (50): '/bin/echo "svc: 3397 macro clean dur: 0d 1h 28m 8s'
[1351115161.134674] [2048.2] [pid=8485]   Processing part: '"'
[1351115161.134683] [2048.2] [pid=8485]   Not currently in macro.  Running output (51): '/bin/echo "svc: 3397 macro clean dur: 0d 1h 28m 8s"'
[1351115161.134693] [2048.1] [pid=8485]   Done.  Final output: '/bin/echo "svc: 3397 macro clean dur: 0d 1h 28m 8s"'
[1351115161.134703] [2048.1] [pid=8485] **** END MACRO PROCESSING *************
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 24, 2012

Updated by mfriedrich on 2012-10-24 21:49:52 +00:00

  • Subject changed from Core: Notifications: spaces are replaced with + sign to faulty macro cleaning, replacing spaces with pluses where they shouldn't be cleaned
  • Category changed from Notifications to Macros
  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
  • Priority changed from Normal to High
  • Target Version set to 1.8.1
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 24, 2012

Updated by mfriedrich on 2012-10-24 21:50:36 +00:00

reason - missing 0 initializer on clean_options when not one of the to-be-cleaned macros in init_macros()

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 24, 2012

Updated by mfriedrich on 2012-10-24 21:55:03 +00:00

  • Status changed from Assigned to Feedback
  • Done % changed from 0 to 100

can you test https://git.icinga.org/?p=icinga-core.git;a=commit;h=b85adb0 please?

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 24, 2012

Updated by mcp on 2012-10-24 22:00:55 +00:00

thanks for the quick fix. Works for me :)

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 24, 2012

Updated by mfriedrich on 2012-10-24 22:55:06 +00:00

  • Status changed from Feedback to Resolved

thanks for testing, bugfix 1.8.1 is out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.