mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Small fix for Icinga .conf generation
This commit is contained in:
parent
46a046afd1
commit
a9e089fc44
1 changed files with 9 additions and 1 deletions
|
|
@ -466,7 +466,11 @@ function Write-IcingaPlainConfigurationFiles()
|
||||||
if ([string]::IsNullOrEmpty($DataField.description)) {
|
if ([string]::IsNullOrEmpty($DataField.description)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$IcingaConfig += [string]::Format(' description = "{0}"{1}', $DataField.description.Replace("`r`n", ''), (New-IcingaNewLine));
|
$Description = $DataField.description.Replace("`r`n", ' ');
|
||||||
|
$Description = $Description.Replace("`n", ' ');
|
||||||
|
$Description = $Description.Replace("`r", ' ');
|
||||||
|
$Description = $Description.Replace('"', "'");
|
||||||
|
$IcingaConfig += [string]::Format(' description = "{0}"{1}', $Description, (New-IcingaNewLine));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -481,6 +485,8 @@ function Write-IcingaPlainConfigurationFiles()
|
||||||
$IcingaConfig += New-IcingaNewLine;
|
$IcingaConfig += New-IcingaNewLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$IcingaConfig = $IcingaConfig.Substring(0, $IcingaConfig.Length - 2);
|
||||||
|
|
||||||
# Close all arguments content
|
# Close all arguments content
|
||||||
$IcingaConfig += New-IcingaNewLine;
|
$IcingaConfig += New-IcingaNewLine;
|
||||||
$IcingaConfig += ' }'
|
$IcingaConfig += ' }'
|
||||||
|
|
@ -494,6 +500,8 @@ function Write-IcingaPlainConfigurationFiles()
|
||||||
$Value = $CheckCommand.vars[$var];
|
$Value = $CheckCommand.vars[$var];
|
||||||
$IcingaConfig += [string]::Format(' vars.{0} = {1}{2}', $var, $Value, (New-IcingaNewLine));
|
$IcingaConfig += [string]::Format(' vars.{0} = {1}{2}', $var, $Value, (New-IcingaNewLine));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$IcingaConfig += New-IcingaNewLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Close the CheckCommand object
|
# Close the CheckCommand object
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue