Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #13050] "Bad escape sequence found: \/" when adding a assign where with "/" in service.name #558

Closed
icinga-migration opened this issue Nov 4, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@icinga-migration
Copy link

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

Created by Foxeronie on 2016-11-04 11:57:14 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-11-04 11:57:14 +00:00 (in Redmine)


Hi!

When I add a service notification with Assign where service.name = NRPE /scratch/backup/volumebackup Usage Check the configuration looks like:

assign where match("hostxy*", host.name) && service.name == "NRPE \/scratch\/backup\/volumebackup Usage Check"

The result is:

critical/config: Error: Bad escape sequence found: \/
Location: in /var/lib/icinga2/api/packages/director/icinga-master01.desy.de-1478260165-103/zones.d/master/notification_apply.conf: 590:73-590:74
/var/lib/icinga2/api/packages/director/icinga-master01.desy.de-1478260165-103/zones.d/master/notification_apply.conf(588):     import "template_mail_service"
/var/lib/icinga2/api/packages/director/icinga-master01.desy.de-1478260165-103/zones.d/master/notification_apply.conf(589): 
/var/lib/icinga2/api/packages/director/icinga-master01.desy.de-1478260165-103/zones.d/master/notification_apply.conf(590):     assign where match("hostxy*", host.name) && service.name == "NRPE \/scratch\/backup\/volumebackup Usage Check"
                                                                                                                                                                                                   ^^

Best regards,
Patrick

@dgoetz
Copy link
Contributor

dgoetz commented Mar 2, 2017

This bug is caused by writing the assign condition to the database urlencoded when a containing a slash.

grafik

*************************** 1. row ***************************
                   id: 8
          object_name: Icinga
          object_type: apply
             disabled: n
         display_name: NULL
              host_id: NULL
       service_set_id: NULL
     check_command_id: NULL
   max_check_attempts: NULL
      check_period_id: NULL
       check_interval: NULL
       retry_interval: NULL
 enable_notifications: NULL
 enable_active_checks: NULL
enable_passive_checks: NULL
 enable_event_handler: NULL
      enable_flapping: NULL
      enable_perfdata: NULL
     event_command_id: NULL
   flapping_threshold: NULL
             volatile: NULL
              zone_id: NULL
  command_endpoint_id: NULL
                notes: NULL
            notes_url: NULL
           action_url: NULL
           icon_image: NULL
       icon_image_alt: NULL
            use_agent: NULL
            apply_for: NULL
    use_var_overrides: NULL
        assign_filter: host.name=%22director.localdomain%22&host.name=%22foo%5C%2Fbar%22

Perhaps this helps in fixing it.

@Thomas-Gelf Thomas-Gelf self-assigned this Mar 3, 2017
@Thomas-Gelf Thomas-Gelf added this to the 1.3.2 milestone Mar 3, 2017
@Thomas-Gelf
Copy link
Contributor

Yesterday evening I opened one of the bottles I got from you, that helped with fixing this ;-)

@Thomas-Gelf
Copy link
Contributor

NB: Thanks @dgoetz for tracking this down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants