Anonymous_User Absent Member.
Absent Member.
470 views

Tip to help identify script output when using 'debugprint'


I have been using the 'debugprint' command to troubleshoot some NSL
Windows scripts, and it's actually quite difficult to interpret the
output sometimes due to the fact that you will have multiple copies of
the script being launched simultaneously by SecureLogin and any debug
messages you see may be out of order.

To help identify which instance of the script is doing what, I first
initialize a random local variable at the start of the script, and add
this to the output of every 'debugprint' command.

So the first few lines of the script are similar to this:


Code:
--------------------
Local ?ThreadID
RestrictVariable ?ThreadID threadpol
ChangePassword ?ThreadID random
--------------------


This will generate a local variable for per instance of the script
following my password policy. I tend to set the policy to be an 8
character alpha-numeric so that it's fairly easy to differentiate the
various scripts' output.

I then add the variable to the 'debugprint' command such that it has
the following format:


Code:
--------------------
DebugPrint "[" ?ThreadID "] - <whatever helpful debug message you want to see goes here>"
--------------------


Hopefully you will find this as useful as me !


--
clovercne
------------------------------------------------------------------------
clovercne's Profile: https://forums.netiq.com/member.php?userid=1699
View this thread: https://forums.netiq.com/showthread.php?t=42694

0 Likes
2 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Tip to help identify script output when using 'debugprint'

Neat!

Thanks
Dave

On 05/10/2012 16:44, clovercne wrote:
>
> I have been using the 'debugprint' command to troubleshoot some NSL
> Windows scripts, and it's actually quite difficult to interpret the
> output sometimes due to the fact that you will have multiple copies of
> the script being launched simultaneously by SecureLogin and any debug
> messages you see may be out of order.
>
> To help identify which instance of the script is doing what, I first
> initialize a random local variable at the start of the script, and add
> this to the output of every 'debugprint' command.
>
> So the first few lines of the script are similar to this:
>
>
> Code:
> --------------------
> Local ?ThreadID
> RestrictVariable ?ThreadID threadpol
> ChangePassword ?ThreadID random
> --------------------
>
>
> This will generate a local variable for per instance of the script
> following my password policy. I tend to set the policy to be an 8
> character alpha-numeric so that it's fairly easy to differentiate the
> various scripts' output.
>
> I then add the variable to the 'debugprint' command such that it has
> the following format:
>
>
> Code:
> --------------------
> DebugPrint "[" ?ThreadID "] - <whatever helpful debug message you want to see goes here>"
> --------------------
>
>
> Hopefully you will find this as useful as me !
>
>


0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Tip to help identify script output when using 'debugprint'


One warning on using this...

Because SecureLogin will be launching multiple "threads" you can quickly
fill up your Windows 'Application' Event Log. Each time the random
?ThreadID is generated it adds a Windows event for each character. This
can very quickly build up especially if your ?ThreadID variable is 8
characters or similar !

You can always turn off Windows Event logging though in SecureLogin
Preferences to prevent this being an issue.


--
clovercne
------------------------------------------------------------------------
clovercne's Profile: https://forums.netiq.com/member.php?userid=1699
View this thread: https://forums.netiq.com/showthread.php?t=42694

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.