Thanks Jim for the reply. It pointed me in the right direction.
What threw me was that when I tested in the interactive powershell console on the server it wasn’t wrapping the same so I initially ruled it out. It turns out though the interactive console has a different wrap
point than the one called from check_mk.
I had to make a couple of changes to my script to make it force a longer line. I had to
-
Add the following to the top of my script
$host.UI.RawUI.BufferSize = new-object System.Management.Automation.Host.Size(512,150);
-
Change my write line to
cmd.exe /c “echo $Crit SQLJOB-$jobname - Critical - The last run $jobLastRunOutcome @ $jobLastRunText” | Write-Output
The second bit may not be needed but it works on my rough test.
So, solved, using these lines in the scripts and we’re all good.
Just as an additional; whilst researching word wrap other articles suggested this improves in PS3.
Thanks for your help
Regards
Dave
···
From: checkmk-en-bounces@lists.mathias-kettner.de
[mailto:checkmk-en-bounces@lists.mathias-kettner.de] On Behalf Of David Field
Sent: 23 March 2014 23:02
To: checkmk-en@lists.mathias-kettner.de
Subject: [Check_mk (english)] How to stop Check_mk truncating output from local checks (text wrapping)
Hi,
I’ve got a powershell script that I’m messing with to output the status of SQL jobs. Its all working fine except due to the length of the service name its truncating the returned data. If I inventory I see:
local SQLJOB-DeleteMaintContracts SQLJOB-DeleteMaintContracts OK - Succeeded 03/23/2014 20:00:00
local SQLJOB-Deletenotrequiredjobs SQLJOB-Deletenotrequiredjobs OK - Succeeded 03/23/2014 03:00:00
local SQLJOB-GeneralMaintenance.BackupCleanupFiles SQLJOB-GeneralMaintenance.BackupCleanupFiles OK - Succeeded 03/23/2014 04:0
local SQLJOB-GeneralMaintenance.BackupSystemDatabases SQLJOB-GeneralMaintenance.BackupSystemDatabases OK - Succeeded 03/23/2014 1
local SQLJOB-GeneralMaintenance.BackupTransactionLogs SQLJOB-GeneralMaintenance.BackupTransactionLogs OK - Succeeded 03/23/2014 2
local SQLJOB-GeneralMaintenance.BackupUserDatabase SQLJOB-GeneralMaintenance.BackupUserDatabase OK - Succeeded 03/23/2014 11:3
If you look at the end the time is being trunctated this appears to be where the text has gone passed a certain length. Any ideas how to allow more characters to be passed back ? If I run the test locally using “test” I can see the text
has cut off where its wrapped onto another line
OUTPUT from TEST
<<>>
0 SQLJOB-DeleteMaintContracts - OK - Succeeded 03/23/2014 20:00:00
<<>>
0 SQLJOB-Deletenotrequiredjobs - OK - Succeeded 03/23/2014 03:00:00
<<>>
0 SQLJOB-GeneralMaintenance.BackupCleanupFiles - OK - Succeeded 03/23/2014 04:0
0:00
<<>>
0 SQLJOB-GeneralMaintenance.BackupSystemDatabases - OK - Succeeded 03/23/2014 1
1:02:37
<<>>
0 SQLJOB-GeneralMaintenance.BackupTransactionLogs - OK - Succeeded 03/23/2014 2
2:45:00
<<>>
0 SQLJOB-GeneralMaintenance.BackupUserDatabase - OK - Succeeded 03/23/2014 11:3
4:38
Any thoughts on how to stop this behaviour would be very appreciated ?
I’m using 1.2.4
Many thanks
David
The management of Cooper Gay provide the use of email for business purposes. Cooper Gay are deemed not to be the author, editor, or publisher of personal
messages. Personal communication falls outside the scope of an individual’s employment. This message is intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to us, and immediately
and permanently delete it. Do not use, copy or disclose the information contained in this message or in any attachment. Cooper Gay & Co. Ltd. (No. 856973) is authorised and regulated by the Financial Conduct Authority (FCA Register No. 313041). Cooper Gay
Swett & Crawford Ltd. (No. 7254605) is the holding company for Cooper Gay & Co. Ltd. Both companies are registered in England and Wales at 52 Leadenhall Street, London, EC3A 2EB.