Nagios Bug and Feature Tracker
Bug and Feature Tracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000407 [Nagios Core] Notifications minor always 2012-12-06 17:01 2014-09-02 15:08
Reporter adamkennedy View Status public  
Assigned To estanley
Priority normal Resolution fixed  
Status closed   Product Version 3.4.3
Summary 0000407: Reloading nagios config causes spaces in notifications to become plus signs
Description If Nagios is issued a reload command through the var/rw/nagios.cmd interface, it appears to have some weird bug where processing macros changes spaces to plus signs. The even stranger thing is that it starts out doing it with the $HOSTDURATION$ macro first. If you let it continue within about a day or so it starts to do the same for $HOSTALIAS$. An example is if $HOSTDURATION$ is "0d 0h 2m 29s" it will change it to be "0d+0h+2m+29s". If you stop the Nagios daemon completely and then start it, the issue goes away. I can trigger it every time by issuing a reload. Service notifications/macros seem to be unaffected.
Additional Information
Tags No tags attached.
Nagios Version 3.4.3
OS CentOS
OS Version 6.3
Attached Files txt file icon nagios-343-debug.txt [^] (1,904 bytes) 2012-12-06 17:01
? file icon 407.patch [^] (469 bytes) 2013-02-21 03:51

- Relationships
has duplicate 0000444closedestanley Nagios 3.5.0 problem with macro $ADMINEMAIL$ : @ is converted to %40 after 2 nagios reload 
has duplicate 0000472closed Plus signs in notifications (macro $LONGDATETIME$) after many Nagios reloads 

-  Notes
(0000660)
cjs226 (reporter)
2013-01-10 09:38

I'm seeing this problem as well with 3.4.3 on Ubuntu 12.04.
(0000676)
Kuba Zakrzewski (reporter)
2013-02-06 07:39
edited on: 2013-02-06 11:46

Same problem on Fedora release 17 with nagios-3.4.4-1.fc17.x86_64. In my case $LONGDATETIME$ in service is affected (Date/Time: Tue+Feb+5+10:06:10+CET+2013) and $HOSTALIAS$

(0000678)
danneh3826 (reporter)
2013-02-12 03:42

Same problem with Nagios 3.4.4 on Ubuntu 10.04.4 LTS. Can't confirm yet whether a restart of Nagios makes the issue go away, I've just come across this ticket, however the problem still persists in 3.4.4.
(0000686)
fredricj (reporter)
2013-02-21 02:17

In the case of $LONGDATETIME$ I partially tracked it down to the call to grab_macro_value_r in common/macros.c:195. There clean_options gets set to 4 (URL_ENCODE_MACRO_CHARS) instead of 0 and hence causes the later code in 237-244 to URL-encode it.
(0000687)
dvoryanchikov (reporter)
2013-02-21 03:56

Pl. test patch below. This works for me.
--- common/macros.c 2012-06-21 14:58:41.000000000 +0400
+++ common/macros.c 2013-02-21 12:24:19.000000000 +0400
@@ -2586,6 +2586,7 @@
     for (x = 0; x < MACRO_X_COUNT; x++) {
         macro_keys[x].code = x;
         macro_keys[x].name = macro_x_names[x];
+ macro_keys[x].clean_options = 0;
 
         /* host/service output/perfdata and author/comment macros should get cleaned */
         if((x >= 16 && x <= 19) || (x >= 49 && x <= 52) || (x >= 99 && x <= 100) || (x >= 124 && x <= 127)) {
(0000689)
fredricj (reporter)
2013-02-24 11:35

The patch looks correct to me and have worked so far on two different instances of nagios
(0000694)
overcrash (reporter)
2013-03-06 09:38

Patch worked for me too !
(0000715)
danneh3826 (reporter)
2013-03-25 06:41

Still a problem in 3.5.0.
(0000717)
ageric (reporter)
2013-03-25 12:02

This should be fixed for Nagios 4, where macro handling is significantly revamped. I'll leave this open for someone (Eric?) to fix on the 3.x branch though, as I'm really uncomfortable working with svn and have no idea how to commit something in just one branch.
(0000724)
mmattern (reporter)
2013-04-29 07:41

Works here too.
Even fixes a problem with On-Demand Group Macros. After a reload the delimiter sign is replaced by the hex ascii code.
E. g.:
  srv1%2Csrv2%2Csrv3
  has to be
  srv1,srv2,srv3
(0000734)
estanley (administrator)
2013-05-06 08:20

Fixed in SVN commit 2754.
(0001029)
estanley (administrator)
2013-11-30 11:37

Released in Nagios Core 3.5.1

- Issue History
Date Modified Username Field Change
2012-12-06 17:01 adamkennedy New Issue
2012-12-06 17:01 adamkennedy File Added: nagios-343-debug.txt
2012-12-06 17:01 adamkennedy Nagios Version => 3.4.3
2012-12-06 17:01 adamkennedy OS => CentOS
2012-12-06 17:01 adamkennedy OS Version => 6.3
2013-01-10 09:38 cjs226 Note Added: 0000660
2013-01-10 09:38 cjs226 Issue Monitored: cjs226
2013-02-06 07:39 Kuba Zakrzewski Note Added: 0000676
2013-02-06 07:39 Kuba Zakrzewski Issue Monitored: Kuba Zakrzewski
2013-02-06 11:46 Kuba Zakrzewski Note Edited: 0000676
2013-02-12 03:42 danneh3826 Note Added: 0000678
2013-02-18 03:46 fredricj Issue Monitored: fredricj
2013-02-20 07:28 dvoryanchikov Issue Monitored: dvoryanchikov
2013-02-21 02:17 fredricj Note Added: 0000686
2013-02-21 03:51 dvoryanchikov File Added: 407.patch
2013-02-21 03:56 dvoryanchikov Note Added: 0000687
2013-02-24 11:35 fredricj Note Added: 0000689
2013-03-06 09:38 overcrash Note Added: 0000694
2013-03-06 09:38 overcrash Issue Monitored: overcrash
2013-03-25 06:41 danneh3826 Note Added: 0000715
2013-03-25 12:02 ageric Note Added: 0000717
2013-04-29 07:36 mmattern Issue Monitored: mmattern
2013-04-29 07:41 mmattern Note Added: 0000724
2013-05-03 08:40 swilkerson Relationship added has duplicate 0000444
2013-05-03 08:41 swilkerson Status new => assigned
2013-05-03 08:41 swilkerson Assigned To => estanley
2013-05-06 08:20 estanley Note Added: 0000734
2013-05-06 08:20 estanley Status assigned => resolved
2013-05-06 08:20 estanley Resolution open => fixed
2013-08-01 04:59 iiro Issue Monitored: iiro
2013-11-30 11:37 estanley Note Added: 0001029
2013-11-30 11:37 estanley Status resolved => closed
2014-09-02 15:08 emislivec Relationship added has duplicate 0000472


Mantis 1.1.7[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker