tutorial

Monitoring IceHRM with Vigilmon

IceHRM is a self-hosted HR management system built on PHP and MySQL. Learn how to monitor web availability, PHP-FPM health, MySQL connectivity, payroll services, and employee data APIs with Vigilmon.

IceHRM is an open-source human resource management system you can host on your own infrastructure — handling leave management, payroll processing, employee records, and document storage without sending sensitive HR data to a third-party SaaS. But running it yourself means you own its uptime. A failed PHP-FPM worker, a locked MySQL table during payroll processing, or a misconfigured email relay can silently block employees from submitting leave requests or managers from approving payroll runs. Vigilmon gives you visibility into every layer of your IceHRM stack before complaints roll in.

What You'll Set Up

  • HTTP uptime monitor for the IceHRM web interface
  • PHP-FPM process health via a status endpoint
  • MySQL database connectivity check
  • Leave management workflow endpoint monitor
  • Payroll processing service heartbeat
  • Employee data API health check
  • Email notification delivery heartbeat
  • Document management service monitor

Prerequisites

  • IceHRM installed and running (PHP 7.4+, MySQL 5.7+, port 80 or 443)
  • Nginx or Apache serving the application
  • PHP-FPM configured with the status endpoint enabled
  • A free Vigilmon account

Step 1: Monitor the IceHRM Web Interface

The first thing to confirm is that IceHRM's PHP application is reachable and returning a valid response.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your IceHRM URL: https://hr.yourdomain.com (or http://YOUR_SERVER_IP).
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Under Keyword match, enter IceHRM to confirm the login page is rendering — not just returning an empty 200.
  7. Click Save.

If you serve IceHRM over HTTPS, enable Monitor SSL certificate on the same monitor and set the expiry alert threshold to 21 days.


Step 2: Expose and Monitor PHP-FPM Status

PHP-FPM's built-in status page reports active workers, idle workers, and request queue depth. Exposing it lets Vigilmon detect worker exhaustion before PHP stops serving requests.

Enable the status endpoint in your FPM pool config (/etc/php/8.x/fpm/pool.d/www.conf):

pm.status_path = /fpm-status

Then restrict it to localhost in your Nginx config:

location /fpm-status {
    access_log off;
    allow 127.0.0.1;
    deny all;
    fastcgi_pass unix:/run/php/php8.x-fpm.sock;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

Reload both services:

systemctl reload php8.x-fpm
systemctl reload nginx

Add a Vigilmon monitor:

  1. Add MonitorHTTP / HTTPS.
  2. URL: http://127.0.0.1/fpm-status (use a local probe agent if Vigilmon can't reach your server directly, or proxy it through a secure internal path).
  3. Keyword match: idle processes — confirms FPM is reporting status, not just returning a blank page.
  4. Check interval: 1 minute.

Alternatively, wrap this check in a small script on your server and use a Vigilmon heartbeat:

#!/bin/bash
IDLE=$(curl -s http://127.0.0.1/fpm-status | grep "idle processes" | awk '{print $NF}')
if [ "$IDLE" -gt 0 ]; then
  curl -s https://vigilmon.online/heartbeat/YOUR_HEARTBEAT_ID
fi

Run this via cron every minute:

* * * * * /usr/local/bin/check-fpm.sh

Step 3: Monitor MySQL Database Connectivity

IceHRM stores all HR data in MySQL. A dropped connection or full disk on the database host renders the entire application non-functional.

Create a lightweight health-check script:

#!/bin/bash
RESULT=$(mysql -u icehrm_user -p'YOUR_PASSWORD' -h 127.0.0.1 icehrm_db \
  -e "SELECT 1;" 2>/dev/null | grep "1")
if [ "$RESULT" = "1" ]; then
  curl -s https://vigilmon.online/heartbeat/MYSQL_HEARTBEAT_ID
fi

Save it to /usr/local/bin/check-icehrm-mysql.sh, make it executable, and add a cron entry:

* * * * * /usr/local/bin/check-icehrm-mysql.sh

In Vigilmon:

  1. Add MonitorCron Heartbeat.
  2. Set Expected ping interval to 2 minutes (gives one missed cron cycle before alerting).
  3. Copy the heartbeat URL into the script above.

If your MySQL instance is exposed on a TCP port (default 3306), add a TCP monitor for an additional layer:

  1. Add MonitorTCP Port.
  2. Host: your database server IP.
  3. Port: 3306.
  4. Check interval: 1 minute.

Step 4: Monitor the Leave Management Workflow

The leave management module is one of IceHRM's core employee-facing features. Add a monitor that confirms the leave request API endpoint is responding.

IceHRM exposes REST-style API endpoints under /api/. The leave module can be probed with:

https://hr.yourdomain.com/api/?t=LeaveAllocation&a=load

Add a Vigilmon HTTP monitor:

  1. Add MonitorHTTP / HTTPS.
  2. URL: https://hr.yourdomain.com/api/?t=LeaveAllocation&a=load.
  3. Expected HTTP status: 200.
  4. Keyword match: LeaveAllocation or status to confirm the response contains valid JSON.
  5. Check interval: 2 minutes.

If the leave API requires authentication, use a dedicated monitoring service account and pass credentials via query parameter or header as your IceHRM version supports.


Step 5: Heartbeat for Payroll Processing

IceHRM's payroll module runs batch calculations that may be triggered by cron or a background PHP process. Add a heartbeat monitor that fires after each successful payroll run.

In your payroll processing script or scheduled task, append a ping after the batch completes successfully:

<?php
// ... payroll processing logic ...

if ($payroll->process() === true) {
    // Notify Vigilmon that payroll completed
    file_get_contents('https://vigilmon.online/heartbeat/PAYROLL_HEARTBEAT_ID');
}

In Vigilmon:

  1. Add MonitorCron Heartbeat.
  2. Set the Expected ping interval to match your payroll schedule (e.g., 1440 minutes for daily, 10080 minutes for weekly).
  3. Use the heartbeat URL in your payroll script.

An alert fires if payroll processing crashes or the cron trigger is misconfigured and no ping arrives within the expected window.


Step 6: Monitor the Employee Data API

IceHRM provides an internal API used by the dashboard, reports, and integrations. Monitor the employee list endpoint to confirm the application layer is healthy end-to-end:

  1. Add MonitorHTTP / HTTPS.
  2. URL: https://hr.yourdomain.com/api/?t=Employee&a=load.
  3. Expected HTTP status: 200.
  4. Keyword match: Employee.
  5. Check interval: 5 minutes.

This check exercises the full PHP → MySQL path, so a failure here pinpoints either the application or database layer depending on which other monitors are also alerting.


Step 7: Email Notification Delivery Heartbeat

IceHRM sends email notifications for leave approvals, payroll slips, and HR announcements. A broken SMTP relay silently drops these without affecting the web UI.

Add a heartbeat to your mail queue processor or create a test script:

#!/bin/bash
# Send a test email via IceHRM's configured mailer and check exit code
php /var/www/icehrm/core/cli/send_test_email.php 2>/dev/null
if [ $? -eq 0 ]; then
  curl -s https://vigilmon.online/heartbeat/MAIL_HEARTBEAT_ID
fi

Alternatively, if you use a system MTA (Postfix, Exim), monitor the mail queue depth:

#!/bin/bash
QUEUE=$(mailq 2>/dev/null | grep -c "^[A-F0-9]")
if [ "$QUEUE" -lt 50 ]; then
  curl -s https://vigilmon.online/heartbeat/MAIL_HEARTBEAT_ID
fi

Set the heartbeat interval to 30 minutes — a 30-minute gap without a ping means something is wrong with your mail pipeline.


Step 8: Monitor the Document Management Service

IceHRM's document management feature stores employee files (contracts, payslips, certificates) on disk or in a configured storage path. Monitor that the upload/download path is accessible:

  1. Create a small health file at YOUR_ICEHRM_ROOT/documents/health.txt with content ok.
  2. Add MonitorHTTP / HTTPS.
  3. URL: https://hr.yourdomain.com/documents/health.txt.
  4. Expected HTTP status: 200.
  5. Keyword match: ok.
  6. Check interval: 5 minutes.

This confirms that the web server has read access to the document storage path and that directory permissions haven't silently changed.


Step 9: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add your preferred channel (Slack, email, PagerDuty, webhook).
  2. Set Consecutive failures before alert to 2 on web and API monitors — a single slow probe shouldn't page your team.
  3. For the payroll heartbeat, set it to 1 — a missed payroll run is always urgent.
  4. Use Maintenance windows to suppress alerts during IceHRM upgrades or scheduled database maintenance.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web interface | https://hr.yourdomain.com | Application down, PHP error | | PHP-FPM status | /fpm-status heartbeat | Worker exhaustion, PHP crash | | MySQL TCP | :3306 | Database server unreachable | | MySQL heartbeat | Cron script | Connection failure, disk full | | Leave API | /api/?t=LeaveAllocation | Module or DB failure | | Payroll heartbeat | Post-run ping | Payroll job crash or missed cron | | Employee data API | /api/?t=Employee | Full-stack PHP → MySQL path | | Email heartbeat | Mail queue script | SMTP relay failure | | Document storage | /documents/health.txt | Permissions or storage mount failure |

IceHRM gives your organization full control over sensitive HR data — but that control requires you to own the uptime too. With Vigilmon monitoring every layer from PHP-FPM workers to MySQL connectivity and payroll cron jobs, your HR platform stays as reliable as the team depending on it.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →