Skip to content

Add read-only health check script / Salt okunur sağlık kontrolü betiği - #12

Merged
schematrix merged 1 commit into
schematrix:mainfrom
efeesrefinal:feat/status-check
Nov 6, 2026
Merged

schematrix merged 1 commit into
schematrix:mainfrom
efeesrefinal:feat/status-check

Conversation

@efeesrefinal

Copy link
Copy Markdown
Contributor

EN

Adds scripts/status.sh, a read-only health check for a running box. It needs no sudo and changes nothing.

It checks:

  • free space on the SD card and on /library, and whether /library is its own disk
  • nginx, kiwix-serve, hostapd, dnsmasq and kolibri services (not installed ones are listed, not counted as errors)
  • the hotspot interface in AP mode, its SSID, the number of connected clients and the br0 bridge
  • the homepage and Kiwix answering through nginx
  • ZIMs from config/content.conf that are missing, unfinished .part downloads, and ZIMs on disk that are not in library.xml yet (so they don't show up on the homepage)
  • CPU temperature, under-voltage and throttling from vcgencmd get_throttled, plus the Pi 5 input voltage

Every finding points to the existing fix (the README troubleshooting entry, download-content.sh or iiab-make-kiwix-lib). Exit code is 1 when a problem is found, so it can also run from cron. The README gets a line in the repo layout and a short paragraph at the top of Troubleshooting, in both languages.

It only adds a new file and two README paragraphs, so it does not overlap with #3, #4 or #5. It reads content.conf in the same <folder> <prefix> format that #3 keeps.

Testing: ShellCheck is clean. I ran it in a throwaway Debian container in three setups: a bare system, a box with stubbed systemctl, iw, ip, curl and vcgencmd reporting failures (failed hostapd, br0 down, Kiwix not answering, missing and unlisted ZIMs, a .part file, throttled=0x50005), and a healthy box (exit 0). I have not run it on real Pi 5 hardware yet, so a run on a real box would be very welcome.

TR

Çalışan bir kurulum için salt okunur bir sağlık kontrolü olan scripts/status.sh ekler. sudo gerektirmez, hiçbir şeyi değiştirmez.

Kontrol ettikleri:

  • SD kart ve /library üzerindeki boş alan, /library'nin ayrı bir disk olup olmadığı
  • nginx, kiwix-serve, hostapd, dnsmasq ve kolibri servisleri (kurulu olmayanlar hata sayılmaz, sadece listelenir)
  • hotspot modundaki arayüz, ağ adı, bağlı cihaz sayısı ve br0 köprüsü
  • ana sayfanın ve Kiwix'in nginx üzerinden yanıt verip vermediği
  • config/content.conf içindeki ZIM'lerden eksik olanlar, yarım kalan .part indirmeleri ve diskte olup library.xml'de olmadığı için ana sayfada görünmeyen ZIM'ler
  • vcgencmd get_throttled ile işlemci sıcaklığı, düşük voltaj ve yavaşlama, ayrıca Pi 5 giriş voltajı

Her bulgu mevcut çözüme yönlendirir (README sorun giderme maddesi, download-content.sh ya da iiab-make-kiwix-lib). Sorun bulursa 1 koduyla çıkar, cron ile de çalıştırılabilir. README'ye iki dilde repo yapısı satırı ve sorun giderme başına kısa bir paragraf eklendi.

Yalnızca yeni bir dosya ve iki README paragrafı eklediği için #3, #4 ve #5 ile çakışmaz. content.conf'u #3'ün de koruduğu <klasör> <ön ek> biçiminde okur.

Test: ShellCheck temiz. Kullan-at bir Debian konteynerinde üç durumda çalıştırdım: çıplak sistem, hata döndüren sahte systemctl, iw, ip, curl ve vcgencmd ile arızalı kurulum (çökmüş hostapd, kapalı br0, yanıt vermeyen Kiwix, eksik ve kütüphanede olmayan ZIM'ler, .part dosyası, throttled=0x50005) ve sağlıklı kurulum (çıkış 0). Gerçek Pi 5 üzerinde henüz denemedim; gerçek bir cihazda deneyen olursa çok sevinirim.

scripts/status.sh checks the things that usually go wrong on a running box,
without changing anything and without sudo:

* free space on the SD card and on /library, and whether /library is its own disk
* nginx, kiwix-serve, hostapd, dnsmasq and kolibri services
* hotspot interface in AP mode, SSID, connected clients and the br0 bridge
* homepage and Kiwix answering through nginx
* ZIMs from config/content.conf that are missing, unfinished .part downloads,
  and ZIMs on disk that are not in the Kiwix library yet
* CPU temperature, under-voltage and throttling via vcgencmd

Each finding points to the existing fix in the README. The script exits 1
when it finds a problem, so it can also run from cron.

Also documents it in the repo layout and at the top of Troubleshooting,
in English and Turkish.
@schematrix

schematrix commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Eline sağlık, sorunu bulunca direkt çözümü göstermesi çok iyi fikir. Kendi Pi'mde çalıştırıp sonucu buraya yazarım, sorun çıkmazsa merge ederim.

Great work, pointing straight to the fix is a really nice idea. I'll run it on my Pi and post the results here, will merge if nothing breaks.

@efeesrefinal

Copy link
Copy Markdown
Contributor Author

Teşekkürler! Çıktıda tuhaf bir şey görürsen buraya yapıştır, düzeltirim.

Thanks! If anything looks off in the output, paste it here and I'll fix it.

@schematrix

Copy link
Copy Markdown
Owner

Kendi Pi 5'imde, gerçek kurulumda denedim ve her şey kusursuz çalıştı. Disk, servisler, hotspot ve br0 köprüsü, web, 22 içeriğin tamamı, sıcaklık ve voltaj, hepsi doğru okundu ve sonuç "her şey yolunda" çıktı. En çok da her bulgunun README'deki çözüme yönlendirmesini sevdim, sorun giderme artık tek komutla başlıyor. Hiçbir şeyi değiştirmeden sadece okuması da tam olması gerektiği gibi. Projeye ilk katkılardan biri olarak merge ediyorum, emeğine çok teşekkürler.

Screenshot 2026-11-06 at 23 03 54 ---

I tested it on my own Pi 5 with the real install and everything worked perfectly. Disk, services, hotspot and the br0 bridge, web, all 22 pieces of content, temperature and voltage were all read correctly, and the result came out "all good". What I liked most is that every finding points to the fix in the README, so troubleshooting now starts with a single command. Only reading and never changing anything is exactly how it should be. Merging this as one of the first contributions to the project, thanks a lot for your work.

@schematrix
schematrix merged commit bea8f1a into schematrix:main Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants