Remote control of computers via MQTT Client + Server | Python 3 | Systemd | i18n
Net Ctrl PC is a system for centralized management of computers in a local network using an MQTT broker.
The system consists of two components:
- Server — receives commands from the administrator, sends them to clients, and waits for confirmations.
- Client — runs on workstations, accepts commands, and performs corresponding actions (poweroff, reboot, custom scripts, etc.).
Full localization support is implemented using gettext.
- Sends commands to clients
- Receives status updates (received, executing, done, error)
- Logging with rotation
- Runs as a systemd service
- Connects to MQTT broker
- Listens to its command topic
- Executes actions based on configuration:
- poweroff
- reboot
- running bash scripts
- custom commands
- Sends status back to the server
- Fully localized (uk/en)
- Clone the repository
git clone https://github.com/yourname/net-ctrl-pc.git
cd net-ctrl-pc- Install the Python package
sudo python3 setup.py install- Create service user and directories
sudo useradd -r -s /usr/bin/nologin -d /var/lib/netctrl -c "net-ctrl-pc user" netctrl
sudo install -d -m 750 -o netctrl -g netctrl /var/log/net-ctrl-pc
sudo install -d -m 750 -o netctrl -g netctrl /var/lib/net-ctrl-pc- Create configuration directory and copy config files
sudo mkdir -p /etc/net-ctrl-pc
sudo cp configs/*.yaml /etc/net-ctrl-pc/- Install systemd service files and reload daemon
sudo cp systemd/*.service /usr/lib/systemd/system/
sudo systemctl daemon-reloadExamples of configuration files actions.yaml, client.yml, server.yaml, they need to be adjusted to your needs
To create or update translation templates (.pot) and translation files (.po), use the localization scripts located in:
net_ctrl_pc/data/scripts/Run manually:
python3 -m net_ctrl_pc.serverOr enable and start via systemd:
sudo systemctl enable --now net-ctrl-pc-serverRun manually:
python3 -m net_ctrl_pc.clientOr enable and start via systemd:
sudo systemctl enable --now net-ctrl-pc-clientSend a command:
mosquitto_pub -t "net-ctrl-pc/pc001/commands" -m '{"cmd": "poweroff"}'Expected responses:
- received
- executing
- done
MIT License