tutorial

Monitoring Krayin CRM with Vigilmon

Krayin is a self-hosted open-source CRM for sales teams — but a downed login page or broken API silently blocks your team during critical selling hours. Here's how to monitor Krayin availability, API health, SSL certificates, and pipeline integrity with Vigilmon.

Krayin gives your sales team a fully self-hosted CRM — leads, pipelines, contacts, email integration, and reporting — without surrendering data to Salesforce or HubSpot. But self-hosting means you own the uptime. A database connection failure takes down the login page while your team is in the field. A broken email integration silently stops syncing correspondence. An expired SSL certificate blocks access during working hours with no browser bypass option. Vigilmon watches your Krayin instance across all these failure modes so your sales team is never silently locked out.

What You'll Set Up

  • Krayin web application availability monitor
  • Login page readiness check (database connectivity signal)
  • API health monitor (authenticated or unauthenticated)
  • SSL certificate expiry alerts
  • Heartbeat monitor for the lead pipeline and email integration

Prerequisites

  • Krayin CRM installed and running on port 80/443
  • A free Vigilmon account

Step 1: Monitor the Krayin Web Application

The application root redirects to the login page when a user is not authenticated. A 200 or 302 response confirms that nginx/Apache and the Laravel application server are running.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Krayin URL: https://crm.yourcompany.com.
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200 (or 302 if your server issues a redirect before following to the login page — use 200 if Vigilmon follows redirects).
  6. Click Save.

Step 2: Monitor the Krayin Login Page (Database Signal)

The Krayin login page at /user/session is the most valuable health endpoint in the application. Laravel renders it by loading a CSRF token from the database session store — if MySQL or the Redis session backend is down, this page returns a 500 error instead of the login form. A 200 response with the Krayin login page content confirms both the web server and database are healthy.

  1. Click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter: https://crm.yourcompany.com/user/session.
  4. Set Expected HTTP status to 200.
  5. Under Keyword check, enter Krayin or CRM.
  6. Click Save.

This is your primary database health signal. A storefront check at the root URL confirms nginx is running; the login page check confirms the full Laravel + MySQL stack is operational.


Step 3: Monitor the Krayin API

The Krayin REST API is used by integrations, mobile apps, and automation workflows. You can monitor it with or without authentication:

Without authentication (confirms API routes are registered):

  1. Click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter: https://crm.yourcompany.com/api/v1.
  4. Set Expected HTTP status to 401 — an unauthenticated request to the API returns 401, which confirms the API routes are registered and the application is running.
  5. Click Save.

With authentication (confirms API + database reads):

If you have a Krayin API token (generated under Settings → API Tokens), monitor an authenticated endpoint instead:

  1. Create the monitor as above but for https://crm.yourcompany.com/api/v1/settings.
  2. Set Expected HTTP status to 200.
  3. Under Request headers, add: Authorization: Bearer YOUR_API_TOKEN.

A 500 response on either variant indicates an application error — typically a database failure, a failed queue worker, or a misconfigured .env.


Step 4: SSL Certificate Alerts

Krayin handles sensitive sales data: customer contact details, deal values, negotiation notes, and email correspondence. HTTPS is mandatory in any production deployment. An expired SSL certificate doesn't just show a browser warning — it hard-blocks your sales team from accessing the CRM during their working hours, with no way to bypass the error on modern browsers.

  1. Open the web application monitor created in Step 1.
  2. Scroll to the SSL certificate section.
  3. Enable Monitor SSL certificate.
  4. Set Alert when certificate expires in less than 21 days.
  5. Click Save.

For sales teams working across time zones, a 21-day alert window ensures you have time to renew even if the initial alert arrives on a Friday before a long weekend.


Step 5: Heartbeat Monitoring for Pipeline and Email Integration

Krayin's core workflows — lead creation, pipeline movement, email sync — can fail silently without affecting the login page. A queue worker crash stops email notifications. An IMAP misconfiguration after a password rotation silently breaks email threading. A database write failure during lead creation may surface as a vague error to the user, not an HTTP 500.

Use a heartbeat monitor to run an hourly automated pipeline health check:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set Expected ping interval to 60 minutes.
  3. Copy the heartbeat URL: https://vigilmon.online/heartbeat/YOUR_TOKEN.

Write a test script that creates and deletes a test lead via the API:

#!/bin/bash
set -e

CRM_URL="https://crm.yourcompany.com"
API_TOKEN="YOUR_API_TOKEN"
HEARTBEAT_URL="https://vigilmon.online/heartbeat/YOUR_TOKEN"

# Create a test lead
CREATE_RESPONSE=$(curl -sf -X POST \
  "$CRM_URL/api/v1/leads" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Heartbeat Test Lead",
    "lead_value": 0,
    "status": 1,
    "tags": ["heartbeat-test"]
  }')

LEAD_ID=$(echo "$CREATE_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['data']['id'])")

# Delete the test lead
curl -sf -X DELETE \
  "$CRM_URL/api/v1/leads/$LEAD_ID" \
  -H "Authorization: Bearer $API_TOKEN"

# Signal success
curl -sf "$HEARTBEAT_URL"

Schedule with cron:

0 * * * * /path/to/krayin-pipeline-test.sh >> /var/log/krayin-heartbeat.log 2>&1

Email integration heartbeat (optional but recommended):

If Krayin email integration is configured with IMAP/SMTP, add a second heartbeat monitor for email health:

#!/bin/bash
# Test that Krayin can queue an outbound email via the API
curl -sf -X POST \
  "$CRM_URL/api/v1/mails/outbox" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"to": "heartbeat@yourcompany.com", "subject": "Krayin heartbeat test", "body": "ok"}'

curl -sf "$HEARTBEAT_URL_EMAIL"

Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, or a PagerDuty webhook.
  2. Set Consecutive failures before alert to 2 for the web application monitor — brief Laravel restarts during deployment won't trigger a false alarm.
  3. Set Consecutive failures before alert to 1 for the SSL certificate monitor — any detection of near-expiry is immediately actionable.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web application | https://crm.yourcompany.com | Laravel/nginx crash | | Login page | /user/session | Database/Redis session failure | | API health | /api/v1 (401 expected) | API routing failure, application error | | SSL certificate | CRM domain | Let's Encrypt renewal failure | | Pipeline heartbeat | Hourly cron → Vigilmon | Lead DB writes broken, queue worker down | | Email heartbeat | Hourly cron → Vigilmon | IMAP/SMTP integration failure |

Krayin's self-hosted model keeps your sales data on your own infrastructure — and Vigilmon ensures your sales team can always reach it. With login page health checks catching database failures and hourly pipeline tests confirming CRM workflows are intact, you have the observability coverage a sales-critical application demands.

Monitor your app with Vigilmon

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

Start free →