3

I have dozens of devices I need to login to using an API script. One set of devices has a password ending in $. I've tried a bunch of things but I can't seem to escape that $ char. Here is the error I'm seeing.

critical/config: Error: Validation failed for object 'gelt-uk4-gp!HTTP/80: Status Check ' of type 'Service'; Attribute 'vars' -> 'gspass': Closing $ not found in macro format string 'n0t-real#$'.
Location: in /etc/icinga2/zones.d/global-templates/global-services.conf: 55:5-55:31
/etc/icinga2/zones.d/global-templates/global-services.conf(53):   if ( host.vars.company == "gelt-emea" ) {
/etc/icinga2/zones.d/global-templates/global-services.conf(54):     vars.gsuser = "admin"
/etc/icinga2/zones.d/global-templates/global-services.conf(55):     vars.gspass = "n0t-real#$"
                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
mr.zog
  • 533
  • 1
  • 7
  • 26
  • I have other zones whose credentials do not contain control characters and they work fine. I sure wish I could change this particular password but I am not allowed to. – mr.zog Jan 08 '18 at 16:10
  • I have a per-zone {zone_name}-credentials.conf in each zone.d directory. They have lines in them like so: `template Service "gelt-emea-credentials" {` `vars.GELTGSUSER = "admin"` `vars.GELTGSPASS = "n0t-real#$"` – mr.zog Jan 08 '18 at 21:04

1 Answers1

6

You add an extra $ right beside the literal dollar sign. So if the password is word54s$ you type:

vars.geltpass = "word54s$$"
Eduardo Cuomo
  • 17,828
  • 6
  • 117
  • 94
mr.zog
  • 533
  • 1
  • 7
  • 26