{"id":13533954,"url":"https://github.com/alexmyczko/ruptime","last_synced_at":"2025-04-05T06:05:25.790Z","repository":{"id":114230840,"uuid":"460081388","full_name":"alexmyczko/ruptime","owner":"alexmyczko","description":"poor man’s ruptime","archived":false,"fork":false,"pushed_at":"2024-10-23T22:02:27.000Z","size":368,"stargazers_count":149,"open_issues_count":3,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-24T10:49:45.905Z","etag":null,"topics":["cli","client-server","gui","internet","inventory","linux","macos","monitoring","multinetwork","ruptime","rwho","rwhod","uptime","webinterface"],"latest_commit_sha":null,"homepage":"https://wedonthaveaprivacyproblem.com/ruptime","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexmyczko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-16T16:17:24.000Z","updated_at":"2024-10-24T10:14:20.000Z","dependencies_parsed_at":"2024-01-07T03:00:10.501Z","dependency_job_id":"86ad885a-7d10-4a07-9ba5-8dad1c0f9792","html_url":"https://github.com/alexmyczko/ruptime","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmyczko%2Fruptime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmyczko%2Fruptime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmyczko%2Fruptime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmyczko%2Fruptime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmyczko","download_url":"https://codeload.github.com/alexmyczko/ruptime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294538,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","client-server","gui","internet","inventory","linux","macos","monitoring","multinetwork","ruptime","rwho","rwhod","uptime","webinterface"],"created_at":"2024-08-01T07:01:24.697Z","updated_at":"2025-04-05T06:05:25.774Z","avatar_url":"https://github.com/alexmyczko.png","language":"Shell","funding_links":[],"categories":["Software"],"sub_categories":["Trends","Monitoring","Monitoring \u0026 Status Pages"],"readme":"![ruptime](.ruptime.png?raw=true \"ruptime\")\n\npoor man’s ruptime\n\nHistorically the original ruptime[^1] was using broadcast udp/513[^2] in a network.\nSince it's not 1982 anymore, but 2022 today, here's a version for multiple networks with encrypted traffic and\nclient-server architecture.\n\nYou will automatically get instant list of hosts (down or up), inventory of hardware, software overview,\ncomparable list of benchmark results.\n\nWhile it was\n- `rcp` (remote copy)\n- `rexec` (remote execution)\n- `rlogin` (remote login)\n- `rstat`\n- `ruptime`\n- `rwho` (remote who)\n- `rwall` (remote wall)\n\nIt is now\n- `ruptime` (remote uptime) - the classic\n- `runame` (remote uname and OS/release) - keep track what OS/release you run\n- `rsw` (remote software) - what kind of package managers did sneak in\n- `rhw` (remote hardware, inventory) - what hardware you have\n- `rload` (remote load of CPU/MEM/GPU/GPUMEM) - usage of hardware\n- `rbench` (remote benchmark) - comparable list of your hardware\n- `rnet` (remote network) - networking details (interface name, connection speed)\n- `rdisk` (remote disk) - overview of local disks and their speeds\n- `rac` (remote users' connect time) - overview of usage (see ac[^7])\n- `rwho` (remote who) - show who is logged in\n\n## Never heard of ruptime, what does it look like?\nThe output shows how long the system has been up, the number of  users currently on the\nsystem, and the load averages[^6]. The load average numbers give the number of jobs in the\nrun queue averaged over 1, 5 and 15 minutes.\n\n```\n$ ruptime # FQDN   State Uptime    Users    Load Averages 1' 5' 15'\ndolphin.ocean.net   up   15+05:57  0 users  load 0.04 0.08 0.07\nfish.ocean.net      up    4+21:27  0 users  load 0.22 0.25 0.25\ntuna.ocean.net      up    4+21:27  0 users  load 0.20 0.30 0.42\n```\n\n```\n$ runame # FQDN              Kernel Release Architecture, OS Version Code\nbanana.ocean.net             Darwin 19.0.0 x86_64, MacOSX 10.15.1 19B77a\nfish.ocean.net               Linux 5.15.0-17-generic x86_64, Ubuntu 22.04 jammy\nlemon.ocean.net              GNU/kFreeBSD 11.4-0-amd64 x86_64, Debian unreleased sid\ntuna.ocean.net               Darwin 21.1.0 arm64, macOS 12.0.1 21A559\n```\n\n```\n$ rload # FQDN               CPU %  MEM %  GPU %  MEM %\nwhale.ocean.net               19.00   3.37  51.20  42.12\n```\n\n```\n$ rsw # FQDN                 pkg number...\nseahorse.ocean.net           dpkg 7243 rpm 0 pip3 393 \n```\n\n```\n$ rhw # FQDN                 age        efi? cores memory\nfish.ocean.net               2008/09/08 BIOS 8 31\nlemon.ocean.net              2021/08/09 UEFI 16 16\nbanana.ocean.net             2019/12/10 UEFI 64 377\n```\n\n```\n$ rnet # FQDN                interface linkspeed wlanquality%\nfish.ocean.net               wlp3s0     144Mb/s 86\norca.ocean.net               enp4s0 \t 2500Mb/s\n```\n\n```\n$ rbench # FQDN              Memory   Total CPU      Cores\norca.ocean.net               MEM 5.05 94 GB CPU 6.16 32\n```\n\n```\n$ rac # FQDN                 hours users\norca.ocean.net               15122.94 4\n```\n\n```\n$ rwho # user host                   date              IP\nroot     fish.ocean.net:pts/0        2023-06-12 07:28 (1.1.1.1)\nme       fish.ocean.net:pts/1        2022-06-23 15:54 (127.0.0.1)\nyou      fish.ocean.net:pts/3        2023-06-28 06:33 (12.34.56.78)\nwe       fish.ocean.net:pts/3        1995-06-28 06:33 (100.200.100.200)\nus       fish.ocean.net:pts/3        2023-06-28 06:33 (44.44.44.44)\n```\n\n## Command line options\n```\n-a   Show all information about host\n-h   Help\n-i   Initialize the software\n-m   Multisite ruptime\n-o   Overview\n-u   Upload information to the server\n-v   Print license/version and quit\n```\n\nNo option queries the server for the information.\n\n## Why would I want this?\n- it's simple[^5]\n- monitoring systems have no or not very useful CLI tools\n- you don't want to manually keep a list of hosts\n- you want to see what hosts are down\n- you want to see what hosts are not idle\n- you want to run something on all running hosts with `parallel`\n- get rid of non-standard/in-house solutions that do not scale or are cumbersome in some other way\n\n## Real life examples\nGet an overview of your operating systems and releases\n```\n$ runame | awk '{i[$NF]++} END {for (n in i) print i[n] \" \" n}' | sort -nr\n```\n\nFind hosts that are least used by CPU\n```\n$ rload | sort -k2n\n```\n\nFind hosts that have 90%+ usage of either CPU/MEM/GPU/GPUMEM\n```\n$ rload -c | grep \" [9][0-9].\\| [0-9][0-9][0-9].\"\n```\n\nUpdate `rnet` output for all online hosts\n```\n$ for a in `ruptime | grep -v \" down \" | awk '{print $1}'`; do echo $a; ssh root@$a \"runame -u\"; done\n```\n\nList all hosts sorted by network speed\n```\n$ rnet | sort -k3nr\n```\n\nCombined `ruptime` and `rload` output\n```\n$ join \u003c(ruptime) \u003c(rload) | column -t\n```\n\nFind missing reports\n```\n$ diff -y \u003c(ruptime|awk '{print $1}') \u003c(rhw|awk '{print $1}') | grep '\u003c\\|\u003e\\||'\n```\n\nRun something on all hosts having Ubuntu 22.04\n```\n$ runame | grep jammy | awk '{print $1}' | parallel -j0 'ssh root@{} \"something\"'\n```\n\nGet total cores and memory of all your machines\n```\n$ rhw|awk '{print $3 \" \" $4}'|datamash -t\" \" sum 1-2\n```\n\nAverage age of computers, oldest and newest (by BIOS date)\n```\n$ rhw|awk '{print $2}'|sed \"s,/.*,,g\"|datamash -t\" \" median 1 min 1 max 1\n```\n\nRight adjusted `rhw` output\n```\n$ rhw|column -t -R3,4\n```\n\nYour total diskspace\n```\n$ rdisk | sed \"s,sd.,,g;s,nvme... ,,g;s,md.,,g;s,mmcblk.,,g\" |sed \"s,.*ethz.ch,,g\" | awk '{for(i=t=0;i\u003cNF;) t+=$++i; $0=t}1' |datamash sum 1\n```\n\nNumber of users\n```\n$ rac | awk '{print $3}' |grep -v ^$ |datamash sum 1\n483\n```\n\nFind hosts without ruptime\n```\n$ diff -y \u003c(ruptime|awk '{print $1}') \u003c(arp -a|sort|awk '{print $1}') | grep '\u003e\\||'\n```\n\nSometimes `nl` or `ts` (from `moreutils`) are useful as well.\n\n## Installation\n\nTo install the client run\n```\napt install ruptime\n```\n\nTo install the server run\n```\napt install ruptimed\n```\n\nInstalling on macOS\n\nhttps://github.com/alexmyczko/homebrew-mac/blob/main/ruptime.rb\n\nInstalling on Alpine Linux\n\n```\napk install cmd:lsb_release netcat-openbsd cmd:ac\n```\n\n## Configuration\nThe defaults for rwhod/ruptime is downtime after 11' (11\\*60 seconds)[^3] (ISDOWN), status messages are originally generated approximately every 3' (AL_INTERVAL)[^4].\n```\nSERVER=aiei.ch\nPORT=51300\nHOSTNAMECMD='hostname -f'\n```\n\nCreate a key for the encryption with `openssl`. You will need this on server and client for symmetric encryption.\n```\nCOLUMNS=160 dd if=/dev/urandom bs=1 count=60 2\u003e/dev/null \u003e /etc/ruptime/ruptime.key\n```\n\nCreate a local user to run the daemon.\n```\nadduser --disabled-password --quiet --system --home /var/spool/ruptime --gecos \"ruptime daemon\" --group ruptime\n```\n\nRunning the daemon.\n```\ndaemon --user=ruptime:ruptime mini-inetd 51300 /usr/sbin/ruptimed\n```\n\n## Classic Mode\nIf you set `HOSTNAMECMD='hostname -s'` you will have the same mode as original rwho/ruptime/rwhod.\nYou can even limit the thing to your single one network with\n```\niptables -A INPUT -p tcp --dport 51300 --match ttl --ttl-gt 1 -j REJECT\n```\n\n## Requirements\n- Client: `nc` `xz` `bc` `cron` `memtester` `timeout` `wireless-tools` `acct`\n- Server: `nc` `xz` `tcputils` `daemon`\n- Optionals: `pen` `trickle` `iptables` `wireless-tools` `nvidia-smi` `lm-sensors`\n\n## Supported Systems\n- macOS\n- Linux\n- FreeBSD\n\n## Starting it\n- FreeBSD: rc.d\n- Debian GNU/Linux: daemon, init.d, cron @reboot, systemd\n- macOS: https://launchd.info\n\n- without systemd\n```\n# crontab -l\n*/1 * * * *  /usr/bin/ruptime -u\n*/3 * * * *  /usr/bin/rload -u\n@reboot      /usr/bin/runame -u\n@reboot      /usr/bin/rsw -u\n```\n\nSome metrics are not useful to have at regular intervals, nor at every boot, so collect them when needed, examples:\n\n```\nrnet -u\n```\n\nOn first setup and hardware changes (memory upgrade, disks added):\n\n```\nrbench -u\nrdisk -u\nrhw -u\n```\n\n## More Details\nLogin to host and try these commands\n```\nac -p\nethtool -i $(ifconfig|grep -v \"^$\"|sed \"s,:.*,,\"|grep -v \"^ \"|grep -v ^lo|head -1)\nnvme smart-log /dev/nvme0n1\nbadblocks -sv /dev/sda\nsensors\nrmmod usbhid                      # disable usb input devices\ndmidecode --type 0                # check if your hw is uefi capable\nefivar -l |grep -i PasswordMode   # check if a uefi bios password is set (no output, no password)\nipmitool dcmi power reading       # power usage\n```\n\n## Other r commands\n- `rdate`, https://github.com/resurrecting-open-source-projects/openrdate\n\n## Links to related software\n\n- https://github.com/rfmoz/tuptime\n- https://github.com/dylanaraps/neofetch\n- https://github.com/glpi-project/glpi-agent\n- https://github.com/snipe/snipe-it\n- https://github.com/PRTG/PythonMiniProbe/\n- https://github.com/ganglia/monitor-core\n\n## Special Files\n- https://manpages.debian.org/unstable/manpages/nologin.5.en.html\n- https://manpages.debian.org/unstable/manpages/issue.5.en.html\n- https://manpages.debian.org/unstable/manpages/motd.5.en.html\n- https://manpages.debian.org/unstable/proftpd-basic/ftpusers.5.en.html\n- https://manpages.debian.org/unstable/cron/crontab.1.en.html references cron.allow cron.disallow\n- https://manpages.debian.org/unstable/login/login.1.en.html\n- https://manpages.debian.org/unstable/manpages/services.5.en.html\n- https://manpages.debian.org/unstable/finger/finger.1.en.html\n\n[^1]: https://en.wikipedia.org/wiki/Berkeley_r-commands\n[^2]: https://manpages.debian.org/unstable/manpages/services.5.en.html\n[^3]: https://sources.debian.org/src/netkit-rwho/0.17-14/ruptime/ruptime.c/\n[^4]: https://sources.debian.org/src/netkit-rwho/0.17-14/rwhod/rwhod.c/\n[^5]: https://www.gkogan.co/blog/simple-systems/\n[^6]: https://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html\n[^7]: https://manpages.debian.org/unstable/acct/ac.1.en.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmyczko%2Fruptime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmyczko%2Fruptime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmyczko%2Fruptime/lists"}