Installing Agent Connections
To install a Connection, open the Ganymede application in a browser window and navigate to the Connection tab in the left sidebar. Select the desired Agent by name and download the relevant Windows/Linux installation file.
Windows Installation
Step 1: Download the Agent
- Open the Ganymede application in a Google Chrome window: <tenant>.ganymede.bio
- On the top panel, navigate to the appropriate environment (e.g. - development or production, as appropriate) for your tenant (if not already there).
- Navigate to the Connections page by selecting the icon in the left toolbar.
- Select the Agents subsection of the Connections page to view all available Agents.
- Find your Agent and hover over the
- Select the Windows EXE option to download the agent in your browser.
- An executable named <your_agent>_<id>.exe should download to the PC
button.
If you would like to download the Windows Agent through a script, you can do so through the Ganymede API.
Step 2: Run the Agent Installer
- Connection name: The name visible to users on the instrument computer and in the Ganymede UI.
- Variables: Strings in the format "var_name=var_value" that allow users to set context variables for use in user-defined Python code.
- Labels: Strings used to identify and group Connections within Ganymede. The label is visible in the Connections UI.
- After downloading the Agent Connection, launch the agent.exe executable on the instrument PC as an administrator.
- Select "yes" when prompted by the User Account Control dialog to allow the Agent application to make changes to your device.
- Navigate through the installation wizard.
- Specify a descriptive name for the Connection.
- A descriptive name might include the instrument name, asset tag, or other identifiers.
- Leave the "additional params" field blank; while variables and labels can be specified here, they can also be modified later in the Ganymede web app.
- Click Next to complete the configuration.
- Specify an installation directory. The default installation directory is
C:\Program Files\Ganymede\
.- If you install multiple Connections on the same PC, it is recommended that you create an additional directory within the Ganymede folder for each Connection.
- Select Next to continue.
- Click Install to begin the installation process.
- Once the installation is complete, a final popup window will appear.
- Ensure the Launch Ganymede Agent checkbox is checked.
- Click Finish to exit the installer and start the Agent service.
- Specify a descriptive name for the Connection.
The Windows Agent installer can be run headlessly if desired.
Step 3: Check the Connection Status
- Navigate to the Connections page in Ganymede.
- Open the Ganymede application in a browser window: <tenant>.ganymede.bio
- On the top panel, navigate to the <tenant>-<tenant-env> environment
- Navigate to the Connections page.
- Find your Connection and click it to open the detailed Connection page.
- On the top of the Connection settings you should see the Status is “Live”
If the Connection is not showing up in Ganymede, or if the status is anything other than Live, please contact Ganymede Support and send the stderr.log that is in the Agent installation directory
Step 4: Credential Setup (Network drives only)
- Open Windows Service Manager. To do so, press Windows + R, type
services.msc
, and hit Enter. - Find the Ganymede Agent service in the list of services.
- The service name will be in the format
GanymedeAgent-[agent uuid]
. - The Connection ID can be identified by navigating to the Connections pane and selecting the newly created Connection.
-
Right click the Agent service and select Stop.
-
Right click the service again and select properties to open the properties menu.
-
Navigate to the logon section and select the radio button next to “This account:”
-
Fill in the username and password fields with credentials that allow access to the network drive
-
Close the properties menu and start the service by right clicking and selecting “start”.
-
Navigate back to the connections pane in Ganymede to confirm the connection is active and running
There may be a slight delay as the service connection resumes.
Step 5: Set up Connection Tags and Variables
- Navigate to the Connections pane in the Ganymede app by selecting the icon in the left toolbar and selecting the Connections pane.
- Find the Connection you just created. Click the button at the bottom right of the Connection Settings
- Click
- Select the appropriate Tag Type Name from the dropdown
- Add a Display Value which will appear next to each file uploaded to Ganymede via this Connection
- Optionally, specify a Tag ID to associate with the tag. This is generally only used in situations where a non-human interpretable values to identify the tag programmatically
- Click Add Tag to apply the tag to the connection
- The tag will be visible under connection file tags if properly applied.
to open the file tag popup.
- Repeat step 3 for each Tag to be applied to files from this specific Connection.
- Scroll down to the Labels section of the Connection Settings.
- Add Labels to the Connection with desired values, which are strings to associate with the Connection.
Linux Installation
Step 1: Download the Agent
- Open the Ganymede application in a Google Chrome window: <tenant>.ganymede.bio
- On the top panel, navigate to the appropriate environment (e.g. - development or production, as appropriate) for your tenant (if not already there).
- Navigate to the Connections page by selecting the icon in the left toolbar.
- Select the Agents subsection of the Connections page to view all available Agents.
- Find your Agent and hover over the
- Select the Linux option to download the agent in your browser.
- An executable named <your_agent>_<id>.exe should download to the PC
button.
If you would like to download the Linux Agent through a script, you can do so through the Ganymede API.
Step 2: Create the Agent Service file
After downloading the agent, modify permissions for the binary to 755.
chmod 755 agent_name_<timestamp>_agent
Create a systemd service file similar to this:
[Unit]
Description=Ganymede Example Agent
After=network.target
Wants=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=10
TimeoutSec=30
User=jane_doe
ExecStart=/path/to/agent/executable -n GanymedeExampleAgentService -v "input_path=/path/to/watch/dir"
StandardOutput=append:/var/log/ganymede/GanymedeExampleAgentService.log
StandardError=append:/var/log/ganymede/GanymedeExampleAgentService_err.log
[Install]
WantedBy=multi-user.target
- Description: Identifies the Connection in logs.
- After and Wants: Ensures that basic networking has been set up before launching the Connection.
- StartLimitIntervalSec: set to 0 to avoid service from stopping; by default, the service would stop after a certain number of failures within a specific timeframe.
- Restart: Set to restart the Connection on unclean exit code or abnormal exit; does not restart on clean exit.
- User: The user to associate with Agent runs. To see the current user, run
whoami
. - ExecStart: The path to the Agent executable. The executable takes the following command-line arguments:
- -n / --name: The required field for the Connection name used to identify the device and its data, logs, and status throughout Ganymede.
- -v / --var: a string in the format "var_name=var_value" that allows setting user context variables accessible from user-defined agent code. Multiple variables can be specified as shown in the append configuration setting in argparse. This argument specifies the folder to watch; if not specified, the folder watched will be the directory containing the Connection binary.
- StandardOutput: log file for Connection output.
- StandardError: log file for Connection errors.
- WantedBy: Specifies that, if the service has been enabled, it should start when multi-user.target is reached during boot. This occurs when the system is operational and ready for multiple users to log in and use the system in non-graphical mode.
Step 3: Start the Agent Service
Once the service file is created, start the Agent by copying the file to /etc/systemd/system/ and setting permissions of the service file to 644. For example, if the systemd service file were named ganymede_example_agent.service, run:
sudo cp /path/to/ganymede_example_agent.service /etc/systemd/system/
sudo chmod 644 /etc/systemd/system/ganymede_example_agent.service
To launch this service, use the following commands:
# to start the Agent Connection service
sudo systemctl start ganymede_example_agent.service
# to ensure that the Connection service starts on system startup
sudo systemctl enable ganymede_example_agent.service
Additional commands that can be useful:
# observe the status of the Connection service
sudo systemctl status ganymede_example_agent.service
# Reload the systemd service file after changes have been made to a service file
# and restart the Connection service after changes have been made
sudo systemctl daemon-reload
sudo systemctl restart ganymede_example_agent.service
After an Agent binary is executed, a connection.yaml file is generated, similar to the one shown below. When this file is present in the same directory as the Connection binary, the Agent uses this configuration file to determine inputs.
environment: ganymede-dev-multi
id: <agent uuid>
inferredData:
installPath: /path/to/agent/binary
macAddress: <mac address of machine>
machineIP: <IP address of machine>
machineName: <name of machine>
serviceDisplayName: GanymedeAgent-<agent uuid>
labels: []
name: ganymede_example_agent
startTime: '2024-07-17T15:10:00Z'
tagParams: []
variables:
input_path: /path/to/watch/dir/
version: <YYYYMMDD-timestamp>