On Debian 13:
sudo apt update
sudo apt install -y rusers
On RHEL 10:
sudo dnf install -y rsh-server
Note: ruptime is typically included in the rusers or rsh-server package.
The rstatd daemon provides system statistics to ruptime clients.
sudo apt install -y rstatd
sudo dnf install -y rsh-server
cd /tmp
wget https://github.com/kristerw/rstatd/archive/refs/heads/master.tar.gz
tar -xzf master.tar.gz
cd rstatd-master
./configure
make
sudo make install
Create systemd service for rstatd:
sudo tee /etc/systemd/system/rstatd.service >/dev/null <<'EOF'
[Unit]
Description=Remote Statistics Daemon
After=network.target
[Service]
Type=simple
ExecStart=/usr/sbin/rpc.rstatd
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now rstatd
Allow rstatd traffic (UDP port 513):
On UFW:
sudo ufw allow 513/udp
On firewalld:
sudo firewall-cmd --permanent --add-port=513/udp
sudo firewall-cmd --reload
Basic usage:
ruptime
Show all hosts including down hosts:
ruptime -a
Sort by load average:
ruptime -l
Sort by number of users:
ruptime -u
Reverse sort order:
ruptime -r
For easier hostname resolution, configure /etc/hosts:
sudo nano /etc/hosts
Add:
192.168.1.100 server1
192.168.1.101 server2
192.168.1.102 server3
server1 up 10:24, 2 users, load 0.05, 0.02, 0.00
server2 up 09:15, 1 user, load 0.12, 0.08, 0.05
server3 down
#!/bin/bash
# check-hosts.sh
LOGFILE="/var/log/ruptime-monitor.log"
echo "=== $(date) ===" >> $LOGFILE
ruptime -a >> $LOGFILE 2>&1
# Check for down hosts
DOWN_HOSTS=$(ruptime -a | grep down | awk '{print $1}')
if [ -n "$DOWN_HOSTS" ]; then
echo "ALERT: Down hosts: $DOWN_HOSTS" | mail -s "Host Down Alert" admin@example.com
fi
sudo crontab -e
Add:
*/5 * * * * /usr/local/bin/check-hosts.sh
#!/bin/bash
# check_ruptime.sh
THRESHOLD=${1:-5} # Minutes before alerting
DOWN_COUNT=$(ruptime -a | grep -c down)
if [ $DOWN_COUNT -gt 0 ]; then
echo "CRITICAL - $DOWN_COUNT host(s) down"
exit 2
fi
echo "OK - All hosts up"
exit 0
#!/bin/bash
# ruptime-exporter.sh
ruptime -a | while read host status rest; do
if [ "$status" = "up" ]; then
echo "host_up{host=\"$host\"} 1"
else
echo "host_up{host=\"$host\"} 0"
fi
done > /var/lib/node_exporter/textfile_collector/ruptime.prom
# Check if rstatd is running
systemctl status rstatd
# Test RPC service
rpcinfo -p localhost | grep rstatd
# Check firewall
sudo iptables -L -n | grep 513
# Test DNS resolution
nslookup server1
# Check /etc/hosts
cat /etc/hosts
# Ensure rstatd can read system stats
ls -la /proc/stat
ls -la /proc/meminfo
rstatd transmits data unencrypted. For secure environments:
See ruptime Hardening.
Setting up monitoring systems can be complex. We offer consulting services for:
Contact us at office@linux-server-admin.com or visit our contact page.
Prefer automation? See ruptime Ansible Setup for an example playbook.
Prefer containers? See ruptime Docker Setup.
See ruptime Configuration for configuration guidance.
See ruptime Security for hardening guidance.