Skip to content

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.

  • 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)

Download the binary for your architecture from the Releases Page.

x86_64 (Intel/AMD):

Terminal window
wget -O pankha-agent https://github.com/Anexgohan/pankha/releases/latest/download/pankha-agent-linux_x86_64
chmod +x pankha-agent

ARM64 (Raspberry Pi/SBC):

Terminal window
wget -O pankha-agent https://github.com/Anexgohan/pankha/releases/latest/download/pankha-agent-linux_arm64
chmod +x pankha-agent

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.

Terminal window
./pankha-agent --setup

The wizard will guide you through:

  1. Configuration: Connecting to your server (e.g., ws://192.168.1.50:3143/websocket) and naming the agent.
  2. Auto-Start: Prompting you to install the agent as a systemd service so it starts automatically on boot.
/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 definition

If you skipped the service installation during --setup, or want to manage it manually, you can use these commands:

Install & Start on Boot:

Terminal window
./pankha-agent --install-service

This automatically creates everything needed at /etc/systemd/system/pankha-agent.service and starts the daemon.

Remove Service:

Terminal window
./pankha-agent --uninstall-service

You can always use standard systemd commands for status and logs:

Terminal window
systemctl status pankha-agent
journalctl -u pankha-agent -f
CommandShortDescription
--start-sStart the agent daemon in background
--stop-xStop the agent daemon
--restart-rRestart the agent daemon
--status-iShow agent status
--config-cShow current configuration
--setup-eRun interactive setup wizard
--install-service-IInstall systemd service for auto-start on boot
--uninstall-service-UUninstall systemd service
--log-show [<LOG_SHOW>]-lShow agent logs (tail -f by default, or tail -n if provided)
--log-level <LOG_LEVEL>Set log level (TRACE, DEBUG, INFO, WARN, ERROR). Use with —start/—restart
--checkRun health check (verify config, service, directories)
--testTest mode (hardware discovery only)
--help-hPrint help
--version-VPrint version
Terminal window
./pankha-agent -s # Start daemon
./pankha-agent -i # Check status
./pankha-agent -l # View live logs
./pankha-agent -x # Stop daemon