Internal Process Modifications

Modified on Wed, 10 May 2023 at 01:39 PM

Each five(9)s Console process contains a separate configuration, which allows to extend the process through custom executables.

  • The files are named like the console processes: e.g. P01StatusChange.json.
  • The configuration is separated into different steps which represent a group of actions.
  • The internal action will be called by default if no configuration for the step can be found.
  • The following properties should be defined for each step. 

  • MailTemplates for the five(9)s Console Processes can be found at C:\inetpub\wwwroot\five9sWS\MailTemplates

  • MailTemplate Pictures for the five(9)s Console Processes can be found at C:\inetpub\wwwroot\five9sWS\MailTemplates\Pictures\

Here's an example for the configuration “P01StatusChange.json”:

1. Name

The name for the Step. Each process has the Step “Main” which can be used to replace the complete process with a customer specific executable.

“Step000” is the first step and can be used to call an executable before any internal actions are called.

The other Steps are dependent on the specific five(9)s Console Process.

2. Action

The Action defines the behavior of the given Step.
Action
Description
Default
The default/internal action for this step will be used.
Add
Adds a custom executable to be called after the step.
Replace
Replaces the current step with a custom executable.
Skip
Skips the given step.

3. ProcessFailOnError

Most of the Steps are crucial. When a Step fails the entire Console Process is not finished.
so most of the time this will be set to true. If the success of one step is optional this can be set to false.

4. Executable

For the Step Action add or replace a name for the executable. A name must be provided.

Otherwise the configuration is invalid. The executable files must exist in the same folder (or subfolder) like the configs:

 “C:\inetpub\wwwroot\five9sWS\ConsoleProcess\configs”.

Passing Parameters:

With the setting "parameterlist", you can define which parameter shall be passed to the executable.

In the parameter list you can pass all process parameter (defined in the end of the process.JSON file) For OSD Process (P03Osd) you can use Custom Inventory Parameter as well.

To make use of a parameter, please follow the structure:

 [Parameter:<parametername>]

 for CI Parameter

 [CI:Location]

For Add Device Process (P09AddDevice) the device has to be created. So the input on the website is not yet available as a Custom Inventory Field but as a Parameter. So passing would work like this: [Parameter:Location] ("Location" is the Name of a passed CI Value for Add Device)
Site CI Input > P09AddDevice -> call of GenerateHostName.exe (custom.exe) -> create device.


Be careful with spaces
If you are using a parameter containing spaces, ensure you add double quotes arround the parameter. E.g., Logfile=\"[Parameter:Logfile]\"

Example for Executable:


 {
     "Name": "Step120"
     "Action": "Add",
     "Description": "Will be called after the Ivanti Provisioning Task is finished. Sends a mail that the provisioning is ready. Sets the device state to Active. In case of error the device state is set to the prior state.",
     "ProcessFailOnError": true,
     "Executable": "subfolder\\example.exe",
     "ParameterList": "/Computername=\"[Parameter:DeviceName]\" /pat=123  /logfile=\"C:\\inetpub\\wwwroot\\five9sWS\\ConsoleProcess\\configs\\AssignComputerGroup\\Logs\\ACG_[Parameter:DeviceName].log\""
 }


Receiving Data:

The following Steps can receive data as from an external executable:
  •  OSD Step000 (set NewHostName)
  •  OSD Step070
  •  OSD Step090 (set TemplateId)
  •  OSD Step100
  •  OSD Step120
  •  AddDevice Step000 (set HostName)
  •  AddDevice Step110 (after the device was created set CustomInventory)

This can be used to override the provisioning template id.
 The exit code has to be 0 (no error code / everything ok). The standard output should contain a json string like:
  •  { "TemplateId":"30", "StaticHostname":"NewVm001" }
  •  { "[CI:AssetID]":"XYZ123" }

 Remember to escape the double quote. An example PowerShell script:
  •  Write-Output "{""TemplateId"":""30""}";


Encoding using executable

Please note: If you like to use special characters inside the executable path or parameters to encode accordingly.

\b Backspace (ascii code 08)
\f Form feed (ascii code 0C)
\n New line
\r Carriage return
\t Tab
\" Double quote
\\ Backslash character

Document information

Last Modified Date
02.05.2023

Verified versions
five(9)s Console version 4.2

Disclaimer
Even though every care has been taken by five(9)s GmbH to ensure that the information contained in this publication is correct and complete, it is possible that this is not the case. five(9)s GmbH provides the publication "as is", without any warranty for its soundness, suitability for a different purpose or otherwise. five(9)s GmbH is not liable for any damage which has occurred or may occur as a result of or in any respect related to the use of this publication. five(9)s GmbH may change or terminate this publication at any time without further notice and shall not be responsible for any consequence(s) arising there from. Subject to this disclaimer, five(9)s GmbH is not responsible for any contributions by third parties to this publication.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article