Skip to Content

Monitoring & Telegram Alerts

Know first when your Odoo site goes down, a backup fails or someone logs in to the server, with alerts on your phone.

WHAT IS WATCHED

You hear about problems before your customers do

🌐 Website and OdooChecked every 2 minutes. One alert when it goes down, one when it is back, with how long it was down.
πŸ’Ύ BackupsEvery nightly result with its size, so a silent failure cannot go unnoticed.
πŸ” Server loginsEach SSH login with the user and address, and a mark when the address has never been seen.
🚨 SecurityRepeated failed logins to Odoo and blocked attackers.
πŸ“¨ Website formsNew contact and support requests, with a link to open them in Odoo.
πŸ›  The alerts themselvesIf any alert workflow fails, that is reported too.
OServer Alertsbot
πŸ”΄ erp.example.com is DOWNHTTP 50209:14
🟒 erp.example.com is back upDown for 5 min09:19
βœ… Backup OK Β· erp.example.com412 MB Β· took 38 s Β· disk 41% used02:31
πŸ” SSH login Β· πŸ†• new IProot from 203.0.113.2411:42
πŸ“© New contact requestTopic: Odoo hosting15:30
HOW IT FITS TOGETHER

One alert hub on your own server

Everything reports to n8n, which decides what is worth a message and sends it to Telegram.

Health checks, backups, SSH logins, Odoo security events and website forms all report to n8n, which sends Telegram messages. 🌐 Health check every 2 min πŸ’Ύ Nightly backup script πŸ” SSH login hook (PAM) 🚨 Odoo security events πŸ“¨ Website contact form n8n filters repeats Β· formats remembers up/down state Telegram your phone or team group
HOW IT IS IMPLEMENTED

Checks, hooks and workflows

Excerpts from the monitoring running on a live Odoo server.

  1. Create the Telegram bot

    In Telegram, @BotFather creates a private bot and gives a token. The token is stored encrypted in n8n; you start a chat with the bot (or add it to a team group) so it may write to you.

  2. Check the site the way a visitor does

    Odoo answers a health URL only when the web server and the database both work. Two failed checks in a row count as down, so a single slow answer does not wake anyone.

    Health URL checked every 2 minutes
    curl -s "https://erp.example.com/web/health?db_server_status=1"
    {"status": "pass", "db_server_status": true}
    n8n Code node: down after 2 failures, up on the first success
    const data = $getWorkflowStaticData('global');   // remembered between runs
    data.sites = data.sites || {};
    const s = data.sites[name] || (data.sites[name] = { up: true, fails: 0 });
    if (ok) {
      if (!s.up) out.push({ json: { text: `🟒 ${name} is back up\nDown for ${mins(Date.now() - s.since)}` } });
      Object.assign(s, { up: true, fails: 0, since: null });
    } else if (s.up && ++s.fails >= 2) {
      Object.assign(s, { up: false, since: Date.now() - 2 * 120000 });
      out.push({ json: { text: `πŸ”΄ ${name} is DOWN\n${why}` } });
    }
    n8n Β· Site monitor β†’ Telegram
    n8n site monitor workflow: schedule, targets, HTTP check, compare with last state, Telegram
    The site monitor in n8n: every 2 minutes, check each site, compare with the last state, message only on a change.
  3. Report every SSH login

    A small hook in the server's login system posts each new SSH session to n8n. It runs in the background, so a stopped n8n can never block a login.

    /odoo/scripts/ssh-login-notify.sh
    [[ "${PAM_TYPE:-}" == open_session ]] || exit 0
    export U="${PAM_USER:-?}" IP="${PAM_RHOST:-?}" H="$(hostname)"
    (
      python3 -c 'import json, os; print(json.dumps({"user": os.environ["U"], "ip": os.environ["IP"], "host": os.environ["H"]}))' \
        | /odoo/scripts/n8n-notify.sh ssh
    ) </dev/null >/dev/null 2>&1 &
    exit 0
    /etc/pam.d/sshd (last line)
    session optional pam_exec.so quiet /odoo/scripts/ssh-login-notify.sh
  4. Send backup results and Odoo events

    The backup wrapper posts its result; a workflow reads new security events from Odoo through its API every 5 minutes; the website form posts each new request.

  5. Watch the watcher

    An error workflow reports any failed alert workflow, with the step that failed and a link to its log in n8n.

    n8n Β· Workflows
    List of alert workflows in n8n
    All alert workflows in one place, each switched on and visible.
HOW YOU BENEFIT

Calm, useful alerts

πŸ“±On your phone

No dashboard to keep open; messages arrive where you already are.

πŸ”•No alert floods

Down and up are sent once; repeated logins from the same place are grouped.

🧭Clear next step

Each message says what happened and links to where to look.

πŸ’ΈNo monthly fees

Runs on your server; no monitoring subscription.

🧩Grows with you

New checks are added as workflows, without new software.

πŸ‘₯Right people

Server alerts to IT, form requests to sales, each in their own chat.

HOW IT IS BUILT

Self-hosted, no monthly fees

The alerts run on n8n, installed on your own server behind HTTPS. Your data stays with you, there is no per-alert price, and new checks can be added later. Alerts go to Telegram; email or Slack are also possible.

What if the whole server goes down?

A monitor on the same server cannot report its own death. For that case a free external uptime check is added as well, which emails or messages you independently.

Can several people receive the alerts?

Yes. Add the bot to a Telegram group, or send different alerts to different people.