Service Management
Use this page to operate the collector as a background Linux service.
Prerequisites
Section titled “Prerequisites”- Linux host with
systemd - Root privileges (
sudo) - Stable config file path (absolute path recommended)
Recommended License Path
Section titled “Recommended License Path”Store the license in a root-owned path that the service can always read:
sudo mkdir -p /etc/ms-teams-observability-agentsudo cp ./license.lic /etc/ms-teams-observability-agent/license.licsudo chmod 640 /etc/ms-teams-observability-agent/license.licSet the same absolute path in your config:
collection_config: license_file: /etc/ms-teams-observability-agent/license.licEnable the Service
Section titled “Enable the Service”sudo ./ms-teams-agent.bin --config /absolute/path/to/config.yaml --enable_boot_startEnable a Named Instance (Optional)
Section titled “Enable a Named Instance (Optional)”sudo ./ms-teams-agent.bin --config /path/to/config-prod.yaml --enable_boot_start --service_name_suffix=-prodsudo ./ms-teams-agent.bin --config /path/to/config-staging.yaml --enable_boot_start --service_name_suffix=-stagingCommon Operations
Section titled “Common Operations”# Check service statussudo systemctl status <service_name>
# Follow live logssudo journalctl -u <service_name> -f
# Restart service after config changesudo systemctl restart <service_name>Update Configuration Safely
Section titled “Update Configuration Safely”-
Back up the current config.
-
Update config values.
-
Restart the service:
Terminal window sudo systemctl restart <service_name> -
Verify status and recent logs:
Terminal window sudo systemctl status <service_name>sudo journalctl -u <service_name> -n 50
Replace an Existing Service
Section titled “Replace an Existing Service”If a service with the same name already exists, force recreation:
sudo ./ms-teams-agent.bin --config /absolute/path/to/config.yaml --enable_boot_start --force_service_creationDisable the Service
Section titled “Disable the Service”sudo ./ms-teams-agent.bin --config /absolute/path/to/config.yaml --disable_boot_startThis stops and removes the systemd service.