1
0
Fork
You've already forked zora
0
a Temperature Monitor Kernel Module with Multi-Daemon Netlink Support
  • C 97.2%
  • Makefile 2.8%
2025年07月19日 12:44:22 +03:00
client.c use linux code format 2025年07月19日 10:05:25 +03:00
client.h use linux code format 2025年07月19日 10:05:25 +03:00
common.h use linux code format 2025年07月19日 10:05:25 +03:00
LICENSE use gpl v2 2025年07月19日 12:44:22 +03:00
main.c use linux code format 2025年07月19日 10:05:25 +03:00
Makefile zora 2025年07月18日 08:39:36 +03:00
netlink.c use linux code format 2025年07月19日 10:05:25 +03:00
netlink.h use linux code format 2025年07月19日 10:05:25 +03:00
proc.c use linux code format 2025年07月19日 10:05:25 +03:00
proc.h use linux code format 2025年07月19日 10:05:25 +03:00
README.md use gpl v2 2025年07月19日 12:44:22 +03:00
thermal.c use linux code format 2025年07月19日 10:05:25 +03:00
thermal.h use linux code format 2025年07月19日 10:05:25 +03:00

Zora

a Temperature Monitor Kernel Module with Multi-Daemon Netlink Support

Name Meaning

Zora is derived from the Slavic word "Zora", meaning "dawn" or "sunrise". The name symbolizes clarity, new beginnings, and illumination, reflecting the module’s purpose: to provide clear, real-time visibility into system thermal conditions. Just as dawn brings light to the day, Zora brings transparency and monitoring insight to Linux thermal zones.

Overview

This Linux kernel module provides advanced thermal zone monitoring with multi-daemon Netlink support. It monitors system temperature sensors and broadcasts temperature changes to registered user-space daemons via a custom Netlink protocol.

Features

  • Supports up to 256 thermal zones
  • Exposes monitoring data via /proc/temp_monitor
  • Real-time temperature change detection
  • Netlink-based communication with up to 32 clients
  • Automatic client cleanup and heartbeat monitoring
  • Provides detailed sensor descriptions and trip point information
  • Broadcasts temperature changes only when threshold exceeded
  • Protocol Number: 31 (defined as NETLINK_THERMAL)
  • Supported Message Types:
    • THERMAL_MSG_REGISTER (3) — Register client
    • THERMAL_MSG_UNREGISTER (4) — Unregister client
    • THERMAL_MSG_TEMP_CHANGE (1) — Temperature change notification
    • THERMAL_MSG_ZONE_UPDATE (2) — Full zone update
    • THERMAL_MSG_CLIENT_LIST (5) — Reserved
    • THERMAL_MSG_HEARTBEAT (6) — Keep-alive
      • THERMAL_MSG_ZONE_STATUS (7) — Request: send current status of all zones

/proc Interface

After loading the module, /proc/temp_monitor will be created. It displays:

  • Summary of detected thermal zones
  • Netlink status
  • Connected client information
  • Detailed sensor readings, descriptions, and trip points

Sample output:


\==========================================
Temperature Monitor with Multi-Daemon
=====================================
?? Detected thermal zones: 4
?? Netlink monitoring: ENABLED
?? Connected clients: 1/32
?? Polling interval: 2 seconds
??? Change threshold: 1.0°C
?? Connected Clients:
• my\_daemon (PID: 12345) - Messages: 8, Connected: 30 sec ago
??? Zone: thermal\_zone0
?? Sensor Type: x86\_pkg\_temp
?? Description: CPU temperature sensor - monitors processor core temperature
??? Current Temperature: 55.2°C (131.4°F)
?? Raw Value: 55200 millidegrees
?? Trip points: 95.0°C, 100.0°C
?? Broadcast monitoring: ACTIVE
?? Last notified temp: 55.2°C

Building and Installing

make
make install

To remove the module:

make uninstall

Client Communication

Clients must use Netlink to:

  • Register themselves (send a struct with msg_type = 3)
  • Receive broadcast temperature changes
  • Send heartbeat messages to stay active
  • Unregister gracefully

Clients receive:

  • Initial zone info upon registration
  • Real-time notifications if temperature change exceeds threshold

Notes

  • Temperature threshold for notifications is 1000 millidegrees (1.0°C)
  • Polling interval is 2 seconds
  • Max 32 concurrent clients; exceeding this will reject new clients
  • Stale clients are cleaned up after 60 seconds of inactivity

Known Limitations

  • Only works with systems that support /sys/class/thermal
  • Assumes temperature readings are in millidegrees

Acknowledgments

Thanks to the Linux kernel community and documentation that made this possible.

Contact

For bug reports, feedback, or contributions:

Developer: Ali Miracle Email: alimiracle@riseup.net

License

This module is licensed under the GPL v2 License - see the LICENSE file for details.