Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Basic Network Info and VM Type #56

Merged
merged 4 commits into from
Feb 26, 2023
Merged

Add Basic Network Info and VM Type #56

merged 4 commits into from
Feb 26, 2023

Conversation

su-haris
Copy link
Contributor

@su-haris su-haris commented Jan 21, 2023

Thought having a VM Type in Basic System Info and a Basic Network Info would make the YABS more informative/complete.

Sample outputs:

OpenVZ, IPv6

Basic System Information:
---------------------------------
Uptime     : 45 days, 8 hours, 34 minutes
Processor  : AMD EPYC 7452 32-Core Processor
CPU cores  : 1 @ 2113.623 MHz
AES-NI     : ✔ Enabled
VM-x/AMD-V : ✔ Enabled
RAM        : 256.0 MiB
Swap       : 128.0 MiB
Disk       : 3.9 GiB
Distro     : Ubuntu 18.04.6 LTS
Kernel     : 4.15.0
VM Type    : OpenVZ

Basic Network Information:
---------------------------------
Protocol   : IPv6
ISP        : NextGenWebs, S.L.
ASN        : AS41608 NextGenWebs, S.L.
Host       : NextGenWebs, S.L.
Location   : Amsterdam, North Holland (NH)
Country    : Netherlands

KVM, IPv4

Basic System Information:
---------------------------------
Uptime     : 13 days, 19 hours, 48 minutes
Processor  : AMD Ryzen 9 3900X 12-Core Processor
CPU cores  : 1 @ 3792.872 MHz
AES-NI     : ✔ Enabled
VM-x/AMD-V : ❌ Disabled
RAM        : 1.4 GiB
Swap       : 1.5 GiB
Disk       : 20.1 GiB
Distro     : Ubuntu 22.04 LTS
Kernel     : 5.15.0-57-generic
VM Type    : KVM

Basic Network Information:
---------------------------------
Protocol   : IPv4
ISP        : ColoCrossing
ASN        : AS36352 ColoCrossing
Host       : RackNerd LLC
Location   : Buffalo, New York (NY)
Country    : United States

Windows

Basic System Information:
---------------------------------
Uptime     : 0 days, 0 hours, 10 minutes
Processor  : AMD Ryzen 7 5800H with Radeon Graphics
CPU cores  : 16 @ 3193.915 MHz
AES-NI     : ✔ Enabled
VM-x/AMD-V : ✔ Enabled
RAM        : 6.7 GiB
Swap       : 2.0 GiB
Disk       : 250.9 GiB
Distro     : Ubuntu 22.04.1 LTS
Kernel     : 5.15.79.1-microsoft-standard-WSL2
VM Type    : WSL

Added a function to display basic details from IP Address lookup. Use ip-api.com free API for this.
Add Virtualization type in basic info.
Inspired from bench.sh
Most modern Linux systems use systemd as the system and service manager. The systemd package ships with the systemd-detect-virt utility, which we can use to detect a virtualization technology.
@su-haris
Copy link
Contributor Author

su-haris commented Feb 3, 2023

@masonr It would be great if you could have a look! Thanks!

@masonr
Copy link
Owner

masonr commented Feb 19, 2023

Sorry for the delay! Will be reviewing this during this weekend.

@masonr masonr merged commit f075baf into masonr:master Feb 26, 2023
@masonr
Copy link
Owner

masonr commented Feb 26, 2023

This PR has been merged. I've made some tweaks in 84f47e8 to add wget calls (if curl isn't installed), eliminated the extra call to ip6.me, and added an opt-out flag to allow users to skip the network info lookup/output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants