EZ Server Monitor does not have an official package or standardized installation method. This tool is a bash script-based monitoring solution that requires manual installation.
EZ Server Monitor is a lightweight bash script-based monitoring tool that:
---
- name: Install EZ Server Monitor
hosts: ez-server-monitor
become: true
vars:
esm_version: "10.6"
esm_dir: "/opt/ez-server-monitor"
esm_admin_email: "admin@example.com"
tasks:
- name: Install prerequisites
package:
name:
- wget
- unzip
- php
- php-cgi
- lighttpd
- sqlite3
- mailutils
- snmp
state: present
when: ansible_os_family == "Debian"
- name: Create EZ Server Monitor directory
file:
path: "{{ esm_dir }}"
state: directory
mode: '0755'
- name: Download EZ Server Monitor
get_url:
url: "https://www.ezservermonitor.com/downloads/ezservermonitor{{ esm_version }}_linux.zip"
dest: "/tmp/esm.zip"
mode: '0644'
register: download_result
failed_when: false
- name: Extract EZ Server Monitor
unarchive:
src: /tmp/esm.zip
dest: "{{ esm_dir }}"
remote_src: true
when: download_result.succeeded
- name: Set permissions
file:
path: "{{ esm_dir }}"
mode: '0755'
recurse: true
- name: Configure EZ Server Monitor
copy:
dest: "{{ esm_dir }}/config.inc.php"
mode: '0644'
content: |
<?php
$admin_email = "{{ esm_admin_email }}";
$sms_enabled = false;
$snmp_enabled = false;
?>
- name: Create systemd service
copy:
dest: /etc/systemd/system/ezservermonitor.service
mode: '0644'
content: |
[Unit]
Description=EZ Server Monitor
After=network.target
[Service]
Type=oneshot
ExecStart={{ esm_dir }}/scripts/check.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
- name: Create cron job for monitoring
cron:
name: "EZ Server Monitor check"
minute: "*/5"
job: "{{ esm_dir }}/scripts/check.sh"
- name: Display installation status
debug:
msg: |
EZ Server Monitor {{ esm_version }} installed!
Directory: {{ esm_dir }}
IMPORTANT: Complete configuration via web interface or edit config.inc.php
If a Docker image is available:
---
- name: Install EZ Server Monitor via Docker
hosts: ez-server-monitor
become: true
vars:
esm_data_dir: "/opt/ez-server-monitor/data"
tasks:
- name: Create data directory
file:
path: "{{ esm_data_dir }}"
state: directory
mode: '0755'
- name: Create Docker Compose file
copy:
dest: "{{ esm_data_dir }}/docker-compose.yml"
mode: '0644'
content: |
version: '3.8'
services:
ezservermonitor:
image: <docker-image-if-available>
container_name: ezservermonitor
restart: unless-stopped
ports:
- "8080:80"
volumes:
- {{ esm_data_dir }}/config:/config
environment:
- ADMIN_EMAIL=admin@example.com
# Edit configuration file
sudo nano /opt/ez-server-monitor/config.inc.php
# Configure SMTP settings
$smtp_host = "smtp.example.com";
$smtp_port = 587;
$smtp_user = "ezsm@example.com";
$smtp_pass = "password";
$admin_email = "admin@example.com";
# Configure GSM modem settings
$sms_enabled = true;
$sms_device = "/dev/ttyUSB0";
$sms_baud = 9600;
$sms_recipients = "+1234567890";
# Configure SNMP settings
$snmp_enabled = true;
$snmp_manager = "192.168.1.100";
$snmp_community = "public";
EZ Server Monitor can check:
# Check script permissions
ls -la /opt/ez-server-monitor/scripts/
# Test script manually
sudo /opt/ez-server-monitor/scripts/check.sh
# Check logs
tail -f /opt/ez-server-monitor/logs/*.log
# Test mail configuration
echo "Test" | mail -s "Test" admin@example.com
# Check mail logs
tail -f /var/log/mail.log
Consider these alternatives with better Ansible integration:
Beyond this playbook, we offer:
Contact our automation team: office@linux-server-admin.com