The GESA_PWSH_REMOTE and CHECK_PWSH_REMOTE plugins enable Windows scripts/executables to be run remotely and their screen output (stdout) and the value returned by them to be retrieved. These remote scripts can be signed for added security.
This is how the Esia plugin works: it asks for the following parameters:
You need to have set the authentication parameters in esia and activate powershell on the remote machine: Activating powershell in Esia
Here are the default settings:
-H $IP -A $AUTH_FILE_PASSWORD -T remote -p <path> -a "<args>"
And an example of settings :
-H $IP -A $AUTH_FILE_PASSWORD -T remote -p "c:\plugins\mypluginvalue.ps1" -a "-warning 10 -critical 70"
Or :
-H $IP -A $AUTH_FILE_PASSWORD -T remote -p "c:\plugins\mypluginvalue.ps1"
The password must be configured via the device's advanced configuration settings.
Here are the default settings:
-u -S $GESASN -t 50 -c check_pwsh_remote -a main.pwsh $IP <path> "<args>"
And an example of settings:
-u -S $GESASN -t 50 -c check_pwsh_remote -a main.pwsh $IP "c:\plugins\mypluginvalue.ps1"
Or :
-u -S $GESASN -t 50 -c check_pwsh_remote -a main.pwsh $IP "c:\plugins\mypluginvalue.ps1" '"-warning 10 -critical 70"'
Or else :
-u -S $GESASN -t 50 -c check_pwsh_remote -a main.pwsh $IP "c:\plugins\mypluginvalue.ps1" '"10 70"'
The password must be configured on the Unity
'"<args>"'
See here for information on how Esia plugins work: How to create a plugin
The powershell plugins used by GESA_PWSH_REMOTE and CHECK_PWSH_REMOTE work in the same way.
The examples below are in powershell, but you can use any other language.
Settings :
'c:\plugins\alreadyOK.ps1'
Or
'c:\plugins\alreadyOK.ps1' ""
Script content :
Write-Output "Hello world" exit 0;
Parameterization :
'c:\plugins\mypluginvalue.ps1' '"-warning 10 -critical 70"'
Or :
'c:\plugins\mypluginvalue.ps1' '"10 70"'
Script content : <ignore>
Param( [Parameter(Mandatory=$True)] [String] $warning, [Parameter(Mandatory=$True)] [String] $critical ) $value = 50; if( $value -gt $critical ) { Write-Output "CRITICAL : value is $value (> $critical)" exit 2; } if( $value -gt $warning ) { Write-Output "WARNING : value is $value (> $warning)" exit 1; } Write-Output "OK : value is $value (<ignore> < $warning)" exit 0;
</ignore></ignore>