🐧 Linux Agent Setup
Step-by-step guide to install the Monitron Server Agent on a Linux server.
📋 المتطلبات الأساسية
- Any Linux distribution (Ubuntu, Debian, CentOS, etc.)
curlinstalled (almost always pre-installed)bcinstalled (for math calculations)- Outbound HTTPS access to your Monitron instance
📥 Step 1: Download the Agent
# Create a directory for the agent
sudo mkdir -p /opt/monitron
# Copy the agent script (from your Monitron installation's agent/ folder)
sudo cp /path/to/monitron/agent/monitron-agent.sh /opt/monitron/
# Make it executable
sudo chmod +x /opt/monitron/monitron-agent.sh
Or download directly:
sudo curl -o /opt/monitron/monitron-agent.sh https://your-monitron.com/agent/monitron-agent.sh
sudo chmod +x /opt/monitron/monitron-agent.sh
⚙️ Step 2: Configure
Edit the script to set your Monitron URL and Agent Key:
sudo nano /opt/monitron/monitron-agent.sh
Change these two lines at the top:
MONITRON_URL="https://your-monitron-instance.com"
MONITRON_KEY="your-agent-key-here"
Using Environment Variables (Alternative)
Instead of editing the script, you can set environment variables:
export MONITRON_URL="https://your-monitron-instance.com"
export MONITRON_KEY="your-agent-key-here"
⏰ Step 3: Set Up Cron
Add a cron entry to run the agent every minute:
sudo crontab -e
Add this line:
* * * * * /opt/monitron/monitron-agent.sh
✅ Step 4: Verify
Run it manually first:
/opt/monitron/monitron-agent.sh
If it works, you should see the server appear in your Monitron dashboard within a minute.
Check cron is working:
# Wait a minute, then check the Monitron dashboard
# Or check the system log:
grep monitron /var/log/syslog