Rtop does not have an official package in standard repositories. This tool is a Go-based binary that must be downloaded from GitHub releases or compiled from source.
Rtop is a fast, interactive remote server monitoring tool that:
topGitHub Repository: https://github.com/rapiz1/rtop
---
- name: Install Rtop from GitHub Releases
hosts: rtop
become: true
vars:
rtop_version: "1.2.0"
rtop_arch: "amd64"
rtop_os: "linux"
tasks:
- name: Create temporary directory
file:
path: /tmp/rtop
state: directory
mode: '0755'
- name: Download Rtop binary
get_url:
url: "https://github.com/rapiz1/rtop/releases/download/v{{ rtop_version }}/rtop-{{ rtop_os }}-{{ rtop_arch }}"
dest: /tmp/rtop/rtop
mode: '0755'
- name: Install Rtop binary
copy:
src: /tmp/rtop/rtop
dest: /usr/local/bin/rtop
owner: root
group: root
mode: '0755'
remote_src: true
- name: Verify Rtop installation
command: rtop --version
register: rtop_version_check
changed_when: false
failed_when: false
- name: Display Rtop status
debug:
msg: |
Rtop {{ rtop_version }} installed successfully!
Binary location: /usr/local/bin/rtop
Usage examples:
- rtop user@host # Connect to remote server
- rtop -c config.yaml # Use configuration file
- rtop --help # Show help
---
- name: Compile Rtop from Source
hosts: rtop
become: true
vars:
rtop_repo: "https://github.com/rapiz1/rtop.git"
rtop_dir: "/opt/rtop-src"
tasks:
- name: Install Go and build tools
package:
name:
- golang-go
- git
state: present
- name: Clone Rtop repository
git:
repo: "{{ rtop_repo }}"
dest: "{{ rtop_dir }}"
version: main
- name: Build Rtop
command: go build -o rtop
args:
chdir: "{{ rtop_dir }}"
creates: "{{ rtop_dir }}/rtop"
- name: Install Rtop binary
copy:
src: "{{ rtop_dir }}/rtop"
dest: /usr/local/bin/rtop
owner: root
group: root
mode: '0755'
remote_src: true
For passwordless SSH access to monitored servers:
- name: Configure SSH keys for Rtop
hosts: rtop
become: false
tasks:
- name: Generate SSH key pair
openssh_keypair:
path: ~/.ssh/rtop_id_rsa
type: rsa
size: 4096
- name: Copy SSH public key to monitored hosts
authorized_key:
user: "{{ item.user }}"
key: "{{ lookup('file', '~/.ssh/rtop_id_rsa.pub') }}"
state: present
loop: "{{ monitored_hosts }}"
delegate_to: "{{ item.host }}"
Create ~/.config/rtop/config.yaml:
# Rtop Configuration
servers:
- name: "web-server"
host: "192.168.1.50"
user: "monitor"
port: 22
key: "~/.ssh/rtop_id_rsa"
- name: "db-server"
host: "192.168.1.51"
user: "monitor"
port: 22
key: "~/.ssh/rtop_id_rsa"
display:
refresh_rate: 2
show_network: true
show_disk: true
show_processes: true
# Connect to a single server
rtop user@hostname
# Use configuration file
rtop -c ~/.config/rtop/config.yaml
# Specify SSH key
rtop -i ~/.ssh/rtop_id_rsa user@hostname
# Specify custom SSH port
rtop -p 2222 user@hostname
# Show help
rtop --help
- name: Monitor multiple servers with Rtop
hosts: rtop
become: false
vars:
monitored_hosts:
- name: web-1
host: 192.168.1.50
user: monitor
- name: web-2
host: 192.168.1.51
user: monitor
- name: db-1
host: 192.168.1.60
user: monitor
tasks:
- name: Create Rtop configuration
copy:
dest: ~/.config/rtop/config.yaml
mode: '0644'
content: |
servers:
{% for host in monitored_hosts %}
- name: "{{ host.name }}"
host: "{{ host.host }}"
user: "{{ host.user }}"
port: 22
{% endfor %}
display:
refresh_rate: 2
# Test SSH connection
ssh -i ~/.ssh/rtop_id_rsa user@hostname
# Check SSH agent
ssh-add -l
# Verbose connection
rtop -v user@hostname
# Check installation
which rtop
# Verify binary
rtop --version
# Check PATH
echo $PATH
# Fix binary permissions
sudo chmod 755 /usr/local/bin/rtop
# Check file ownership
ls -la /usr/local/bin/rtop
Consider these alternatives with better Ansible integration:
Beyond this playbook, we offer:
Contact our automation team: office@linux-server-admin.com