---
title: "Raspberry Pi uptime monitor that works behind NAT | Logdash"
description: "One crontab line that pushes a heartbeat from your Pi every 10 seconds, so a crash, a power cut or a dead home connection ends in a Telegram alert."
url: https://logdash.io/monitor/raspberry-pi
---

# Raspberry Pi uptime monitor

Have the Pi send a heartbeat out to a hosted monitor every 10 seconds from cron, so a crash, a power cut or a dead home connection all end the same way: the heartbeats stop and an alert reaches your phone.

A Pi at home sits behind your router with no public address. A classic uptime monitor calls in from the internet, so it cannot reach the Pi without port forwarding, dynamic DNS or a tunnel, and each of those is one more thing that breaks at 2am. A monitor running on the Pi itself has the opposite problem: when the Pi loses power, it loses its monitor too.

So flip the direction. The Pi calls out, and outbound HTTPS works from behind any home router with no ports opened. A Logdash push monitor expects a ping in every check window and alerts when one goes missing. That silence covers every way a Pi fails: a corrupted SD card, a kernel panic, a tripped fuse, someone borrowing the power supply.

## The crontab line

 crontab -e 

```bash
# Cron fires once a minute. The loop pings six times, 10 seconds apart,
# because a Pro push monitor expects a ping in every 15-second window.
* * * * * for i in 1 2 3 4 5 6; do curl -fsS -m 4 -o /dev/null -X POST https://api.logdash.io/ping/YOUR_MONITOR_ID; sleep 10; done
```

Push monitors are a Pro feature, $15 a month, and on Pro Logdash looks for a heartbeat every 15 seconds. One empty window marks the monitor down. Plain cron cannot run more often than once a minute, which is why the line starts a short loop instead of a single curl. The -m 4 caps each request at 4 seconds, so the gap between two pings never stretches past 14\. The ping is a bare POST with no body and no auth header, so there is nothing to install beyond curl, which Raspberry Pi OS ships with.

## Raspberry Pi internet uptime monitor

The ping leaves through your home connection, so a dead line looks exactly like a dead Pi: the heartbeats stop, the monitor flips to down, and the alert reaches your phone over mobile data. When the line comes back, the next ping flips it up and a second message says so, which gives you the outage length for the call with your ISP. It cannot tell the two causes apart on its own. Run uptime -s on the Pi afterwards: a boot time older than the outage means the Pi stayed up and the line did not.

1. **Create a push monitor** Add a service in Logdash, switch the monitor to push and copy the ping URL. The id at the end is the only thing the line above needs.
2. **Install the line** Run crontab -e on the Pi as your normal user, paste the line with your id, save. Within a minute the monitor turns green, and the first heartbeat sends an up message to Telegram, which proves the alert path before you need it.
3. **Pull the plug** Unplug the Pi or its network cable. Within 30 seconds of the last ping the monitor goes down, and a Telegram alert lands naming the monitor, status code 0 and the reason: no call received for this time range.

### Logdash vs Uptime Kuma on the Pi

| Feature                             | Logdash                                     | Uptime Kuma                                        |
| ----------------------------------- | ------------------------------------------- | -------------------------------------------------- |
| Works behind NAT                    | Yes, the Pi calls out                       | Yes, it runs inside your network                   |
| Alerts when the Pi loses power      | Yes, the missing heartbeat is the alert     | No, the monitor is off too                         |
| Alerts when the home internet drops | Within 30 seconds, to your phone            | Sees it, cannot send until the line is back        |
| Checks other devices on the LAN     | No, HTTP checks only reach public addresses | HTTP, ping, TCP and DNS to anything on the network |
| Notification channels               | Telegram and webhook                        | Around 90 providers                                |
| Price                               | Push monitors need Pro, $15 a month         | Free, on the Pi you already own                    |

### When Uptime Kuma is the better pick

- You want to watch the other boxes on your network: the NAS, the printer, Home Assistant. Kuma on the Pi does that and Logdash cannot reach a private address.
- You do not want to pay for a hobby Pi. Kuma is free, and for the outside heartbeat Healthchecks.io monitors 20 jobs on its free plan, with Telegram among its integrations.
- You already run Kuma. Keep it for the LAN and add one heartbeat out, so something outside notices when Kuma itself goes dark.

### How do I set up a Raspberry Pi uptime monitor? 

Create a push monitor, paste one crontab line that POSTs to its ping URL every 10 seconds, and connect Telegram. The Pi calls out, so it works behind NAT with no port forwarding and no static IP.

### Can I use a Raspberry Pi as an internet uptime monitor? 

Yes. The same heartbeat leaves through your home connection, so when the line drops the pings stop and the alert reaches your phone over mobile data. The up message when the line returns gives you the outage length.

### What should Raspberry Pi monitoring cover besides uptime? 

Temperature and throttling, which vcgencmd get\_throttled reports, and free space on the SD card. Logdash runs no agent on the Pi, but the Python SDK can chart any number you read yourself, such as the value in /sys/class/thermal/thermal\_zone0/temp.

### Does a Raspberry Pi uptime monitor need port forwarding? 

Not with a push monitor. Only outbound HTTPS to api.logdash.io is needed, which every home router allows by default. An HTTP monitor would need a public URL, and Logdash refuses private addresses such as 192.168.x.x.

## Keep reading

[All platforms](https://logdash.io/monitor): One page per platform, each with what it already monitors, the gap, and a Telegram alert in three steps.

[WordPress uptime monitoring](https://logdash.io/monitor/wordpress): Point an outside HTTP monitor at a URL that has to run PHP and reach MySQL, not only the cached homepage, and send the alert somewhere you read within minutes; no plugin is required.

[Shopify store uptime monitoring](https://logdash.io/monitor/shopify): Shopify keeps its own servers up, so the useful thing to monitor is what Shopify does not watch for you: your storefront on your custom domain and any app or webhook endpoint you host yourself, each with an HTTP check that sends a Telegram alert when it stops answering.

[Vercel uptime monitoring](https://logdash.io/monitor/vercel): Vercel does not request your production domain from outside on any plan, so uptime monitoring on Vercel means a health route that cannot be cached plus an external monitor that calls it every few minutes and alerts you when it stops answering 200.

[Uptime monitoring](https://logdash.io/features/monitoring): HTTP checks as often as every 15 seconds. When one fails, Telegram tells you before your users do.
