Icinga / Icinga/icinga2

Duplicated Line Breaks in Powershell Check Output

Open
#9,617 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/windows
Dominant language
C++
Stars
2.2k
Forks
616
Avg merge
5d 6h
Merged PRs (30d)
10

Description

When executing a Powershell Check command remotely on a Windows machine, line breaks are duplicated on the check output. For example, when executing the command get-module -ListAvailable icinga |ft -Property Name,Version the powershell result is:

Name                        Version
----                        -------
icinga-powershell-framework 1.10.1
icinga-powershell-plugins   1.10.1

but it is shown in Icingaweb2 and IcingaDB Web like so:

Name                        Version

----                        -------

icinga-powershell-framework 1.10.1 

icinga-powershell-plugins   1.10.1

To Reproduce

Create a check service based on the native powershell check command and execute any powershell command that returns multi-line text output.

Expected behavior

The plugin output should look exactly like the powershell output and should not add extra line breaks.

Your Environment

Icinga Server:
Icinga r2.13.6-1 on Debian 11
Icinga Web 2 2.11.3
IcingaDB 1.0.2
director 1.10.2

Agent machine:
Windows Server 2022 Standard German
Icinga Agent 2.13.6
icinga-powershell-framework 1.10.1
icinga-powershell-plugins 1.10.1

Additional context

Check Output of Powershell-Framework-commands, native agent commands or any other commands are all OK, only the result of the native powershell check command is affected. Occurs on both Firefox and Chrome and with Icingaweb2 and IcingaDB web as well, so it seems like the blank line duplication does not occur in the backend but already when the Windows agent interprets the PS result and sends it to Icinga.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a native Powershell check command that returns multi-line text on a Windows agent, then trace how its output is interpreted and sent to Icinga. Done means the output shown in Icingaweb2 and IcingaDB Web preserves the Powershell line breaks without inserted blank lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.