Linux Agent
The Pankha Linux agent is a lightweight, single-binary application written in Rust. It interacts directly with the Linux kernel’s sysfs interface to read temperatures and control PWM fans.
Features
Section titled “Features”- Zero Dependencies: No Python or Ruby runtime required.
- Low Resource Usage: Typically uses <10MB RAM and <1% CPU.
- Hardware Support: Supports any sensor supported by
lm-sensors. - Failsafe Mode: Autonomous fan control when disconnected (configurable
failsafe_speed, default 70%).
---
title: Connection & Failsafe Lifecycle
---
stateDiagram-v2
[*] --> Startup
state "Startup Sequence" as Startup
state "Online (Fan Control Active)" as Online
state "Failsafe Mode (Fixed Speed)" as Failsafe
Startup --> Online : Connection Success
Startup --> Failsafe : Connection Failed
Online --> Failsafe : Connection Lost
Failsafe --> Online : Connection Restored
Failsafe --> Failsafe : Retry Interval (Configurable)
Installation
Section titled “Installation”1. Download
Section titled “1. Download”Download the binary for your architecture from the Releases Page.
x86_64 (Intel/AMD):
wget -O pankha-agent https://github.com/Anexgohan/pankha/releases/latest/download/pankha-agent-linux_x86_64chmod +x pankha-agentARM64 (Raspberry Pi/SBC):
wget -O pankha-agent https://github.com/Anexgohan/pankha/releases/latest/download/pankha-agent-linux_arm64chmod +x pankha-agent2. Recommended: Interactive Setup
Section titled “2. Recommended: Interactive Setup”The easiest way to get started is by running the interactive setup wizard. This “all-in-one” command handles everything from initial configuration to systemd service installation.
./pankha-agent --setupThe wizard will guide you through:
- Configuration: Connecting to your server (e.g.,
ws://192.168.1.50:3143/websocket) and naming the agent. - Auto-Start: Prompting you to install the agent as a systemd service so it starts automatically on boot.
Where are files stored?
Section titled “Where are files stored?”/opt/pankha-agent/├── pankha-agent # The binary executable├── config.json # Local configuration file└── hardware-info.json # Cached hardware discovery data
/var/log/pankha-agent/└── agent.log # Running logs (if service is active)
/etc/systemd/system/└── pankha-agent.service # Systemd service definition3. Service Management (Systemd)
Section titled “3. Service Management (Systemd)”If you skipped the service installation during --setup, or want to manage it manually, you can use these commands:
Install & Start on Boot:
./pankha-agent --install-serviceThis automatically creates everything needed at /etc/systemd/system/pankha-agent.service and starts the daemon.
Remove Service:
./pankha-agent --uninstall-serviceManual Control
Section titled “Manual Control”You can always use standard systemd commands for status and logs:
systemctl status pankha-agentjournalctl -u pankha-agent -fCLI Commands
Section titled “CLI Commands”| Command | Short | Description |
|---|---|---|
--start | -s | Start the agent daemon in background |
--stop | -x | Stop the agent daemon |
--restart | -r | Restart the agent daemon |
--status | -i | Show agent status |
--config | -c | Show current configuration |
--setup | -e | Run interactive setup wizard |
--install-service | -I | Install systemd service for auto-start on boot |
--uninstall-service | -U | Uninstall systemd service |
--log-show [<LOG_SHOW>] | -l | Show agent logs (tail -f by default, or tail -n |
--log-level <LOG_LEVEL> | Set log level (TRACE, DEBUG, INFO, WARN, ERROR). Use with —start/—restart | |
--check | Run health check (verify config, service, directories) | |
--test | Test mode (hardware discovery only) | |
--help | -h | Print help |
--version | -V | Print version |
Quick Examples
Section titled “Quick Examples”./pankha-agent -s # Start daemon./pankha-agent -i # Check status./pankha-agent -l # View live logs./pankha-agent -x # Stop daemon