Docs / Troubleshooting / Agent Commands

Agent Commands Reference

This guide provides useful commands for troubleshooting and managing the ZEM Cloud agent on endpoints.

Viewing Agent Logs

Agent logs contain detailed information about agent activity, errors, and communication with the server.

Linux (Ubuntu, Debian, Arch, Fedora)

View the last 50 lines of the log:

sudo tail -50 /var/log/zen-update-agent.log

Follow the log in real-time:

sudo tail -f /var/log/zen-update-agent.log

Search for errors in the log:

sudo grep -i error /var/log/zen-update-agent.log

macOS

View the last 50 lines of the log:

sudo tail -50 /var/log/zen-update-agent.log

Follow the log in real-time:

sudo tail -f /var/log/zen-update-agent.log

Windows

View the last 50 lines of the log (PowerShell):

Get-Content "C:\ProgramData\ZenUpdate\logs\agent.log" -Tail 50

Follow the log in real-time (PowerShell):

Get-Content "C:\ProgramData\ZenUpdate\logs\agent.log" -Wait -Tail 20

Search for errors (PowerShell):

Select-String -Path "C:\ProgramData\ZenUpdate\logs\agent.log" -Pattern "error"

Checking Agent Status

Linux (Ubuntu, Debian, Arch, Fedora)

Check the agent timer status:

systemctl status zen-update-agent.timer

Check all ZEM Cloud services:

systemctl list-timers | grep zen

macOS

List all ZEM Cloud services:

launchctl list | grep zeniar

Check if a specific service is loaded:

launchctl print system/com.zeniar.zen-update-agent

Windows

Check the agent service status (PowerShell as Administrator):

Get-Service ZenUpdateAgent

List all ZEM Cloud services:

Get-Service | Where-Object {$_.Name -like "ZenUpdate*"}

Restarting the Agent

Linux (Ubuntu, Debian, Arch, Fedora)

Restart the agent timer:

sudo systemctl restart zen-update-agent.timer

Restart all ZEM Cloud services:

sudo systemctl restart zen-update-agent.timer zen-update-report.timer zen-update-telemetry.timer zen-update-hwinfo.timer

macOS

Unload and reload the agent:

sudo launchctl unload /Library/LaunchDaemons/com.zeniar.zen-update-agent.plist
sudo launchctl load /Library/LaunchDaemons/com.zeniar.zen-update-agent.plist

Restart all ZEM Cloud services:

sudo launchctl unload /Library/LaunchDaemons/com.zeniar.zen-update-*.plist
sudo launchctl load /Library/LaunchDaemons/com.zeniar.zen-update-*.plist

Windows

Restart the agent service (PowerShell as Administrator):

Restart-Service ZenUpdateAgent

Restart all ZEM Cloud services:

Get-Service | Where-Object {$_.Name -like "ZenUpdate*"} | Restart-Service

Testing Server Connectivity

Verify the endpoint can communicate with your ZEM Cloud server.

Linux / macOS

Test basic connectivity:

curl -I https://your-zem-server.com/api/agent_version

Test with verbose output:

curl -v https://your-zem-server.com/api/agent_version

Check DNS resolution:

nslookup your-zem-server.com

Windows

Test basic connectivity (PowerShell):

Invoke-WebRequest -Uri "https://your-zem-server.com/api/agent_version" -UseBasicParsing

Test with detailed output:

Test-NetConnection -ComputerName your-zem-server.com -Port 443

Check DNS resolution:

Resolve-DnsName your-zem-server.com

Forcing a Report

Manually trigger a status report to update the dashboard immediately.

Linux (Ubuntu/Debian)

sudo /usr/local/bin/zen-update-report.sh

Linux (Arch)

sudo /usr/local/bin/zen-update-report-arch.sh

Linux (Fedora)

sudo /usr/local/bin/zen-update-report-fedora.sh

macOS

sudo /usr/local/bin/zen-update-report-macos.sh

Windows

& "C:\Program Files\ZenUpdate\zen-update-report-windows.ps1"

Checking Agent Configuration

View the agent configuration file to verify settings.

Linux

sudo cat /etc/zen-update/agent.conf

macOS

sudo cat "/Library/Application Support/ZenUpdate/agent.conf"

Windows

Get-Content "C:\ProgramData\ZenUpdate\agent.conf"

Checking Agent Version

Verify which version of the agent is installed.

Linux

grep "^VERSION=" /usr/local/bin/zen-update-agent.sh

macOS

grep "^VERSION=" /usr/local/bin/zen-update-agent-macos.sh

Windows

Select-String -Path "C:\Program Files\ZenUpdate\zen-update-agent-windows.ps1" -Pattern '^\$VERSION'