Skip to content

Commit b044925

Browse files
author
Petr Razumov
authored
Merge pull request #175 from tidalmigrations/rzmv/machine-stats-updates
Update Machine Stats guides
2 parents 9568c0a + ce035b4 commit b044925

File tree

1 file changed

+58
-18
lines changed

1 file changed

+58
-18
lines changed

pages/tidal tools/machine_stats.md

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Gather Machine Stats
33
keywords:
4-
last_updated: April, 2021
4+
last_updated: December, 2021
55
summary: "Gather machine stats from remote environments"
66
sidebar: main_sidebar
77
permalink: machine_stats.html
@@ -32,11 +32,14 @@ Migrations." %}
3232

3333
### Introduction
3434

35-
This is a simple and effective way to gather machine stats (RAM, Storage,
36-
CPU) from a Windows Server environment. It uses
35+
This is a simple and effective way to gather machine stats (RAM, Storage, CPU)
36+
from a Windows Server environment. For better results, we recommend using it
37+
with
3738
[WinRM](https://docs.microsoft.com/en-us/windows/win32/winrm/installation-and-configuration-for-windows-remote-management)
38-
to `Invoke-Command` across your servers, creating a JSON file to securely send
39-
to your Tidal Migrations instance using the tidal command.
39+
to `Invoke-Command` across your servers. However, it is also possible to
40+
execute in non-WinRM environments, though not all of the stats will be
41+
available to gather in such case. As a result it outputs JSON data which can be
42+
securely sent to your Tidal Migrations workspace using the `tidal` command.
4043

4144
### Requirements and Dependencies
4245

@@ -46,31 +49,35 @@ dependencies setup:
4649
- To get started you will need to have Tidal Tools installed. You can check out
4750
[Getting Started with Tidal Tools](tidal-tools.html) guide on how to install
4851
it.
49-
- You will need [WinRM
50-
enabled](https://support.auvik.com/hc/en-us/articles/204424994-How-to-enable-WinRM-with-domain-controller-Group-Policy-for-WMI-monitoring)
52+
- To gather additional data, such as CPU utilization and process stats, you
53+
will need [WinRM
54+
enabled](https://support.auvik.com/hc/en-us/articles/204424994-How-to-enable-WinRM-with-domain-controller-Group-Policy-for-WMI-monitoring)
5155
across your environment for this.
5256
- The scripts needed for this process can be found in [Machine Stats for
5357
Windows GitHub
54-
repository](https://github.com/tidalmigrations/machine_stats/tree/master/windows).
58+
repository](https://github.com/tidalmigrations/machine_stats/tree/master/windows).
5559

5660
### Running the Script
5761

58-
Start syncing your servers with Tidal Migrations, by running the script:
59-
`runner.ps1`.
60-
6162
{% include note.html content="Be sure to set PowerShell's Execution policy to
6263
execute this script before running it. [This
6364
guide](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-6)
6465
will help you in doing so." %}
6566

66-
1. It will prompt you to set your username.
67-
68-
2. Then, run the script: `save_password.ps1` and enter your password when
67+
1. To start, run the script `.\save_password.ps1` and enter your password when
6968
prompted. This will save your credentials securely in a text file.
7069

71-
3. Save a list of the server hostnames that you would like to sync in a file
72-
called: _servers.txt_. The data of these servers will be shown in a table,
73-
with numerical values rounded to the nearest second decimal.
70+
2. Save a list of the server hostnames that you would like to sync in a file.
71+
By default, Machine Stats script will search for file called `servers.txt`
72+
in the current folder. If a list was saved in some other file, you can specify
73+
its path using the `-ServersPath` parameter for `runner.ps1` script.
74+
75+
3. Run the script `.\runner.ps1`. It will prompt for username. Alternatively,
76+
you can specify the username using the `-UserName` parameter. The data of
77+
the list of servers will be shown as a JSON.
78+
79+
4. You can pipe the output of the Machine Stats script directly to the Tidal
80+
Tools: `.\runner.ps1 | tidal sync servers`
7481

7582
{% include note.html content="We recommend that you set this script to run
7683
periodically so that your servers are synced on a daily basis and the
@@ -84,7 +91,7 @@ And there you have it! Your servers will be synced to Tidal Migrations.
8491

8592
### Introduction
8693

87-
Machine Stats for Linux/Unix leverages [Ansible](https://www.ansible.com/) to
94+
Machine Stats for Unix-like Systems leverages [Ansible](https://www.ansible.com/) to
8895
gather facts in a cross-platform way.
8996

9097
### Requirements and Dependencies
@@ -126,3 +133,36 @@ dependencies setup:
126133
For more details on configuration and usage, please check Machine Stats for
127134
Unix-like systems [technical
128135
documentation](https://github.com/tidalmigrations/machine_stats/blob/master/unix/README.md).
136+
137+
## Hypervisors (QEMU/KVM) <span class="label label-info">new</span>
138+
139+
### Introduction
140+
141+
Machine Stat for Hypervisors is built ontop of [libvirt](https://libvirt.org)
142+
and it gathers facts from virtual machines within a QEMU/KVM environment.
143+
144+
### Requirements and Dependencies
145+
146+
- To get started you will need to have Tidal Tools installed. You can check out
147+
[Getting Started with Tidal Tools](tidal-tools.html) guide on how to install
148+
it.
149+
- You need to install **Python 3.6+** on your local workstation.
150+
- You need to have **libvirt 3.0+** on your local workstation and on a remote machine which hosts the QEMU/KVM environment.
151+
152+
Please refer to the Machine Stats for Hypervisors [technical
153+
documentation](https://github.com/tidalmigrations/machine_stats/blob/master/libvirt/README.md)
154+
for installation instructions.
155+
156+
### Running the Script
157+
158+
1. Make up the [connection URI](https://libvirt.org/uri.html) to communicate with a remote environment.
159+
160+
2. Execute `virt-stats` and pipe its output to Tidal Tools:
161+
162+
```
163+
virt-stats --connection qemu+ssh://myuser@myhost/system | tidal sync servers
164+
```
165+
166+
For more details on configuration and usage, please check Machine Stats for
167+
Hypervisors [technical
168+
documentation](https://github.com/tidalmigrations/machine_stats/blob/master/libvirt/README.md).

0 commit comments

Comments
 (0)