{
    "type": "article",
    "title": "What my Linux boxes check every hour",
    "canonical": "https://www.dealmobile.co.uk/writing/what-my-linux-boxes-check-every-hour",
    "path": "/writing/what-my-linux-boxes-check-every-hour",
    "url": "https://www.dealmobile.co.uk/writing/what-my-linux-boxes-check-every-hour",
    "markdown": "https://www.dealmobile.co.uk/writing/what-my-linux-boxes-check-every-hour.md",
    "json": "https://www.dealmobile.co.uk/writing/what-my-linux-boxes-check-every-hour.json",
    "summary": "What the hourly health check on my two Linux boxes looks at, the numbers it warns on, and the time it failed every hour over a socket that was fine.",
    "published": "2026-11-28T11:30:00+00:00",
    "modified": "2026-11-28T11:30:00+00:00",
    "image": {
        "url": "https://www.dealmobile.co.uk/sites/default/files/content/images/posts/what-my-linux-boxes-check-every-hour/hero.png",
        "alt": "Output of the hourly check: space on three filesystems OK, a warning that one partition is growing 58 GB a day and will be full in about 11 days, then services, updates, backup and kernel all OK."
    },
    "fields": {
        "image_dark": null
    },
    "tags": [
        {
            "name": "Linux",
            "url": "https://www.dealmobile.co.uk/writing/tag/linux",
            "json": "https://www.dealmobile.co.uk/writing/tag/linux.json"
        },
        {
            "name": "Testing",
            "url": "https://www.dealmobile.co.uk/writing/tag/testing",
            "json": "https://www.dealmobile.co.uk/writing/tag/testing.json"
        }
    ],
    "body": {
        "html": "<p>Both my Linux boxes run a health check every hour from a systemd timer. It’s one Python script, standard library only, niced right down, and it prints a line per check. This is most of a run on the box I carry:</p>\n<pre><code>OK   space /        10% used, 780 GB free of 868 GB\nOK   space /data    65% used, 641 GB free of 1814 GB\nWARN growth /data   growing 58 GB a day over the last 7 days: full in about 11 days (room elsewhere: / 780 GB free, /home 587 GB free)\nOK   space /home    35% used, 587 GB free of 906 GB\nOK   services       every enabled service is running\nOK   updates        no security updates waiting (0 other)\nOK   backup         last good run 0 days ago; repository 184 GB\nOK   kernel         no I/O, filesystem or out-of-memory messages since the last run\n</code></pre>\n<p>The <code>/data</code> line is why I wrote it. At 65 per cent that partition passes any check that only reads the level, and it has eleven days left.</p>\n<h2 id=\"what-it-looks-at\">What it looks at</h2>\n<p>Space on every mounted filesystem: a warning at 80 per cent and a failure at 90, and on anything over 100 GB also at 50 GB and 20 GB free. Inodes too, and a filesystem that has gone read-only, which is what ext4 does to itself after errors.</p>\n<p>Growth is the part the old daily check never had. The script keeps an hourly sample of every partition for 60 days and works out when the last week’s growth would fill it. Under 30 days is a warning and under 7 is a failure. It ignores growth below half a gigabyte a day, and it says nothing at all until it has three days of samples. When it does warn it lists the partitions that have room.</p>\n<p>From the journal it takes everything since the last run that looks like trouble: I/O errors, filesystem errors, NVMe resets and timeouts, and out-of-memory kills. It checks that everything in <code>fstab</code> is mounted, that the clock is synced, and that a reboot hasn’t been waiting more than 14 days.</p>\n<p>Services are the enabled-but-not-running ones and any failed unit. There’s one exception. I sometimes stop MySQL, Elasticsearch and Apache on the home box to give a local model the memory, and the check leaves those alone, but it warns if I’ve left the box like that for more than 12 hours.</p>\n<p>Security updates warn after 7 days and fail after 21. The backup warns when the last good run is over two days old and fails at three.</p>\n<p>The last check is the other box. Each one reads the other’s most recent run, and three hours without one is a warning, six a failure. A box that has died can’t raise its own alert, so the other one does it.</p>\n<h2 id=\"how-it-tells-me\">How it tells me</h2>\n<p>A new warning or failure puts a notice on the desktop and sends a push to my phone through <a href=\"https://ntfy.sh\">ntfy</a>, which runs on a Raspberry Pi at home. A failure repeats every 6 hours and a warning every 24 until it’s fixed. There’s a command that sends one test alert down the same path, so I know the phone end works without waiting for something to break.</p>\n<h2 id=\"a-failure-that-wasnt-one\">A failure that wasn’t one</h2>\n<p>Early on the services check failed on both boxes, every hour, over this:</p>\n<pre><code>$ systemctl is-active printmd-api-proxy.socket\ninactive\n$ systemctl --user is-active printmd-api-proxy.socket\nactive\n</code></pre>\n<p>That socket starts <a href=\"/projects/printmd\">PrintMD’s</a> PDF service on the first connection, and it’s a user unit. systemd runs one manager for the system and one for each logged-in user, and the system manager has never heard of my socket, so it answers <code>inactive</code> and exits 4. The service was fine the whole time. The check now asks each unit’s own manager.</p>\n<p>With the repeat, that was a failure alert every six hours for a service that was up, in the same list as the real ones. The first run had found one of those: <code>logrotate.service</code> had been failing on the home box since 00:47 that night, because a backup copy of rsyslog’s config had been left inside <code>/etc/logrotate.d</code>, and logrotate reads every file in there and refused the duplicate entries. The older daily check had been marking that as failed since half past eight and I hadn’t seen it.</p>\n<h2 id=\"what-is-still-off\">What is still off</h2>\n<p>The SMART checks are written and the parsing has a self-test, but they need <code>smartctl</code>, which needs root, and I haven’t yet given an hourly job a standing <code>sudo</code>. Until I do, that line says <code>SKIP</code>.</p>"
    },
    "markdown_text": "---\ntitle: 'What my Linux boxes check every hour'\ncanonical: 'https://www.dealmobile.co.uk/writing/what-my-linux-boxes-check-every-hour'\nurl: 'https://www.dealmobile.co.uk/writing/what-my-linux-boxes-check-every-hour'\ntype: Post\npublished: '2026-11-28'\nsummary: 'What the hourly health check on my two Linux boxes looks at, the numbers it warns on, and the time it failed every hour over a socket that was fine.'\n---\n\n# What my Linux boxes check every hour\n\nPublished 2026-11-28\n\n![Output of the hourly check: space on three filesystems OK, a warning that one partition is growing 58 GB a day and will be full in about 11 days, then services, updates, backup and kernel all OK.](https://www.dealmobile.co.uk/sites/default/files/styles/almanac_shot_md/public/content/images/posts/what-my-linux-boxes-check-every-hour/hero.png.webp?itok=BUIIt0-A)\n\nBoth my Linux boxes run a health check every hour from a systemd timer. It’s one Python script, standard library only, niced right down, and it prints a line per check. This is most of a run on the box I carry:\n\n```\nOK   space /        10% used, 780 GB free of 868 GB\nOK   space /data    65% used, 641 GB free of 1814 GB\nWARN growth /data   growing 58 GB a day over the last 7 days: full in about 11 days (room elsewhere: / 780 GB free, /home 587 GB free)\nOK   space /home    35% used, 587 GB free of 906 GB\nOK   services       every enabled service is running\nOK   updates        no security updates waiting (0 other)\nOK   backup         last good run 0 days ago; repository 184 GB\nOK   kernel         no I/O, filesystem or out-of-memory messages since the last run\n\n```\n\nThe `/data` line is why I wrote it. At 65 per cent that partition passes any check that only reads the level, and it has eleven days left.\n\n## What it looks at\n\nSpace on every mounted filesystem: a warning at 80 per cent and a failure at 90, and on anything over 100 GB also at 50 GB and 20 GB free. Inodes too, and a filesystem that has gone read-only, which is what ext4 does to itself after errors.\n\nGrowth is the part the old daily check never had. The script keeps an hourly sample of every partition for 60 days and works out when the last week’s growth would fill it. Under 30 days is a warning and under 7 is a failure. It ignores growth below half a gigabyte a day, and it says nothing at all until it has three days of samples. When it does warn it lists the partitions that have room.\n\nFrom the journal it takes everything since the last run that looks like trouble: I/O errors, filesystem errors, NVMe resets and timeouts, and out-of-memory kills. It checks that everything in `fstab` is mounted, that the clock is synced, and that a reboot hasn’t been waiting more than 14 days.\n\nServices are the enabled-but-not-running ones and any failed unit. There’s one exception. I sometimes stop MySQL, Elasticsearch and Apache on the home box to give a local model the memory, and the check leaves those alone, but it warns if I’ve left the box like that for more than 12 hours.\n\nSecurity updates warn after 7 days and fail after 21. The backup warns when the last good run is over two days old and fails at three.\n\nThe last check is the other box. Each one reads the other’s most recent run, and three hours without one is a warning, six a failure. A box that has died can’t raise its own alert, so the other one does it.\n\n## How it tells me\n\nA new warning or failure puts a notice on the desktop and sends a push to my phone through [ntfy](https://ntfy.sh), which runs on a Raspberry Pi at home. A failure repeats every 6 hours and a warning every 24 until it’s fixed. There’s a command that sends one test alert down the same path, so I know the phone end works without waiting for something to break.\n\n## A failure that wasn’t one\n\nEarly on the services check failed on both boxes, every hour, over this:\n\n```\n$ systemctl is-active printmd-api-proxy.socket\ninactive\n$ systemctl --user is-active printmd-api-proxy.socket\nactive\n\n```\n\nThat socket starts [PrintMD’s](https://www.dealmobile.co.uk/projects/printmd.md) PDF service on the first connection, and it’s a user unit. systemd runs one manager for the system and one for each logged-in user, and the system manager has never heard of my socket, so it answers `inactive` and exits 4. The service was fine the whole time. The check now asks each unit’s own manager.\n\nWith the repeat, that was a failure alert every six hours for a service that was up, in the same list as the real ones. The first run had found one of those: `logrotate.service` had been failing on the home box since 00:47 that night, because a backup copy of rsyslog’s config had been left inside `/etc/logrotate.d`, and logrotate reads every file in there and refused the duplicate entries. The older daily check had been marking that as failed since half past eight and I hadn’t seen it.\n\n## What is still off\n\nThe SMART checks are written and the parsing has a self-test, but they need `smartctl`, which needs root, and I haven’t yet given an hourly job a standing `sudo`. Until I do, that line says `SKIP`.\n\n- **Tags:** [Linux](https://www.dealmobile.co.uk/writing/tag/linux.md), [Testing](https://www.dealmobile.co.uk/writing/tag/testing.md)\n\n---\n\nIndex of this site: [llms.txt](https://www.dealmobile.co.uk/llms.txt)\n"
}