Skip to content

Commit 1a75014

Browse files
eseyffarthMattias Schlenker
authored andcommitted
pick-25 KNW-1969 fix powershell blocks in localchecks
1 parent 987caad commit 1a75014

2 files changed

Lines changed: 18 additions & 26 deletions

File tree

src/common/de/localchecks.asciidoc

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -603,22 +603,17 @@ cached(1618580356,600) 2 "My cached service" count=4 Some output of a long runni
603603

604604
In der letzten Zeile erkennen Sie einen zwischengespeicherten Service an der vorangestellten `cached`-Information mit der aktuellen Unixzeit und dem Ausführungsintervall in Sekunden.
605605

606-
Unter Windows können Sie mit der PowerShell und dem „Cmdlet“ `Select-String` ein sehr ähnliches Resultat erreichen wie mit dem `grep`-Befehl unter Linux. Im folgenden Befehl bestimmen die beiden Ziffern hinter dem Parameter `Context`, wie viele Zeilen vor und nach dem Treffer ausgegeben werden sollen:
606+
Unter Windows können Sie mit der PowerShell und dem Cmdlet `Select-String` ein sehr ähnliches Resultat erreichen wie mit dem `grep`-Befehl unter Linux.
607+
Im folgenden Befehl bestimmen die beiden Ziffern hinter dem Parameter `Context`, wie viele Zeilen vor und nach dem Treffer ausgegeben werden sollen:
607608

608-
// ES: HTML-Darstellung angelehnt an vorigen Block-Inhalt https://github.com/Checkmk/checkmk-docs/blob/5765a90fbd731ea099e6be2e9d29cc355f06c919/src/common/de/localchecks.asciidoc?plain=1#L607
609-
610-
++++
611-
<div class="listingblock copybutton">
612-
<div class="content">
613-
<pre
614-
class="pygments highlight"><code data-lang="doscon"><span></span><span class="tok-gp">PS C:\Program Files (x86)\checkmk\service&gt;</span> ./cmk-agent-ctl.exe dump | Select-String -Pattern "&lt;&lt;&lt;local" -Context 0,3
615-
<span class="tok-go">&lt;&lt;&lt;local:sep(0)&gt;&gt;&gt;</span>
616-
<span class="tok-go">0 "My 1st service" - This static service is always OK</span>
609+
[{powershell},subs="+quotes"]
610+
----
611+
PS C:\Users\hhirsch\> & "C:\Program Files (x86)\checkmk\service\cmk-agent-ctl.exe" | Select-String -Pattern "<<<local" -Context 0,3
612+
<<<local:sep(0)>>>
613+
0 "My 1st service" - This static service is always OK
617614
618-
<span class="tok-go">cached(1618580520,600) 1 "My cached service on Windows" count=4 Some output of a long running script</span></code></pre>
619-
</div>
620-
</div>
621-
++++
615+
cached(1618580520,600) 1 "My cached service on Windows" count=4 Some output of a long running script
616+
----
622617

623618

624619
[TIP]

src/common/en/localchecks.asciidoc

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -604,20 +604,17 @@ cached(1618580356,600) 2 "My cached service" count=4 Some output of a long runni
604604

605605
In the last line, you can recognize a cached service by the preceding `cached` information with the current Unix time and the execution interval in seconds.
606606

607-
Under Windows, you can achieve a very similar result with PowerShell and the `Select-String` 'cmdlet' as with the `grep` command under Linux. In the following command, the two digits behind the `Context` parameter determine how many lines are to be output before and after the hit:
607+
Under Windows, you can achieve a very similar result with PowerShell and the `Select-String` Cmdlet as with the `grep` command under Linux.
608+
In the following command, the two digits behind the `Context` parameter determine how many lines are to be output before and after the hit:
608609

609-
++++
610-
<div class="listingblock copybutton">
611-
<div class="content">
612-
<pre
613-
class="pygments highlight"><code data-lang="doscon"><span></span><span class="tok-gp">PS C:\Program Files (x86)\checkmk\service&gt;</span> ./cmk-agent-ctl.exe dump | Select-String -Pattern "&lt;&lt;&lt;local" -Context 0,3
614-
<span class="tok-go">&lt;&lt;&lt;local:sep(0)&gt;&gt;&gt;</span>
615-
<span class="tok-go">0 "My 1st service" - This static service is always OK</span>
610+
[{powershell},subs="+quotes"]
611+
----
612+
PS C:\Users\hhirsch\> & "C:\Program Files (x86)\checkmk\service\cmk-agent-ctl.exe" | Select-String -Pattern "<<<local" -Context 0,3
613+
<<<local:sep(0)>>>
614+
0 "My 1st service" - This static service is always OK
616615
617-
<span class="tok-go">cached(1618580520,600) 1 "My cached service on Windows" count=4 Some output of a long running script</span></code></pre>
618-
</div>
619-
</div>
620-
++++
616+
cached(1618580520,600) 1 "My cached service on Windows" count=4 Some output of a long running script
617+
----
621618

622619
[TIP]
623620
====

0 commit comments

Comments
 (0)