Windows: OSHI Daemon installation
Overview
If you have to monitor a Windows based system using the RealLoad OSHI Daemon follow the instructions on this page to install the agent as a service and have it started on boot.
Requirements
- The software can be installed on any recent x64 and ARM Windows system.
- It requires about 300 MB of physical memory.
- You’ll need to execute the installation script mentioned on this page using a Windows privileged account (Administrator).
- You’ll need some familiarity with Powershell.
The installation script will:
- Install the Microsoft build of OpenJRE 11, without setting any Java environment variables.
- Deploy the ReaLoad OSHI Daemon as a Windows service and start it.
- Optionally install the RealLoad JavaScript Processor.
- Print the Unique Daemon ID at the end of the process.
- Set a random AuthTokenValue for the OSHI Daemon.
- If the JavaScript Processor is also to be installed, then a random LocalJavaScriptProcessorAuthTokenValue is generated and configured.
The uninstallation script will:
- Stop the OSHI and JSP services.
- Remove the base installation folder. This will remove all software (including JRE) and config files.
- Set the environment variables uniqueDaemonId, installLocalJSP and oshiAlertProcessorHosts. This allows for a simple re-installation.
Installation
Download and unzip the installation kit
Download the latest installation kit from this link: https://download.realload.com/oshi-win-installer . Then unzip the installation kit to a temporary location.
From powershell, you can use these commands:
Invoke-WebRequest -Uri https://download.realload.com/oshi-win-installer -OutFile oshi-installer.zip
Expand-Archive -Path .\oshi-installer.zip -DestinationPath .
Configure optional environment variables used by the installer
Optionally, you can configure the following environment variables which will be used by the installation script:
Env Variable | Description | Default value |
---|---|---|
installLocalJSP | A boolean value (true/false) indicating whether a local copy of the JavaScript Processor is to be installed. | false |
targetDir | The root folder of the OSHI agent installation. | c:\realload |
uniqueDaemonId | The OSHI daemon ID. To be used in order to retain an OSHI instance ID when re-installing the agent. | None - A new ID will be generated on startup |
oshiAlertProcessorHosts | The Alert Processor Host the agent should connect to. | services-ch1.realload.com[8099] |
Examples:
$env:installLocalJSP = $true
Run the installer
- Open a powershell window with administrative privileges and change to the location where the installer was unzipped.
- If required, set any of the above mentioned environment variables.
- You might have to run this powershell command first to give yourself rights to execute unsigned powershell scripts:
Set-ExecutionPolicy Bypass -Scope Process
- Run the installer:
.\install.ps1
Summmarizing, you can automate the installation of the OSHI agent by running these commands in PowerShell (with admin rights):
cd tempfolder
Set-ExecutionPolicy Bypass -Scope Process
Invoke-WebRequest -Uri https://download.realload.com/oshi-win-installer -OutFile oshi-installer.zip
Expand-Archive -Path .\oshi-installer.zip -DestinationPath .
.\install.ps1
The output of the installer will be as follows:
PS C:\Users\Administrator.LAB\Desktop\temp> .\install.ps1
Folder created at C:/realload
Unique Daemon ID provided - Setting to b9dTxxxxxxxLY
Alert Processors value provided - Setting to services-ch1.realload.com[8099]
Setting Alert Processor Hosts to: services-ch1.realload.com[8099]
OSHI service started. Daemon ID: b9dTxxxxxxxLY
The OSHI Daemon and JSP Processor services will be automatically started. The OSHI agent Unique ID will be displayed, so that it can then be configured in the RealLoad Portal.
Operations
Startup
The OSHI Deamon and the optional JavaScript Processor services are configured to automatically start on boot.
Logfiles
You’ll find logfiles in the logs folders:
- OSHI daemon: c:\realload\oshi\log
- JS Processor: c:\realload\javascript\log
Deinstallation
To remove the OSHI daemon and the JavaScript Processor run the uninstaller script. If you’ve installed the software in a location other than the default folder (C:\realload) then set the targetDir environment variable accordingly.
PS C:\installer> .\uninstall.ps1
Installaiton folder found at C:/realload
Stopping service: RealLoadOSHI
Deleting service: RealLoadOSHI
Stopping service: RealLoadJSProcessor
Deleting service: RealLoadJSProcessor
OSHI service stopped. Unique daemon ID: 9zJELbRT0r3TFPQq
Daemon ID was set to env variable uniqueDaemonId
OshiAlertProcessorHosts: services-ch1.realload.com[8099]
OshiAlertProcessorHosts was set to env variable OshiAlertProcessorHosts
Foler deletion attempt 1 failed. Retrying in 5 seconds...
Foler deletion attempt 2 failed. Retrying in 5 seconds...
Foler deletion attempt 3 failed. Retrying in 5 seconds...
Foler deletion attempt 4 failed. Retrying in 5 seconds...
The RealLoad OSHI installation folder was deleted successfully.
The uninstaller will set the following environment variables, which will be used by the installer if it is executed from the same terminal:
- uniqueDaemonId
- installLocalJSP
- oshiAlertProcessorHosts
This should cater for a simple updgrade process by running the deinstaller and re-running the installer.