You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve machine stats for Unix documentation (#191)
* Added more detail on the different ways to run machine stats, and the use cases for each
* Small grammar tweaks, removed uneccessary lines from example scripts
* Updated docs in tidal offline to link to instructions, rather than duplicating them
* Added instructions for uploading results file to TMP
* Fixed header type for 'creating the hosts file' section
* Removed unneccessary backticks
* Updated offline docs
* Added parent 'Run machine stats' header to MS4U sections in machine_stats and tidal_offline
Copy file name to clipboardExpand all lines: pages/tidal tools/machine_stats.md
+56-8Lines changed: 56 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ gather facts in a cross-platform way.
99
99
Prior to the steps on syncing your Unix/Linux machines, be sure to have the below
100
100
dependencies setup:
101
101
102
-
-To get started you will need to have Tidal Tools installed. You can check out
102
+
-If you want to upload the results of running Machine Stats to the Tidal Migrations Platform, you will need to be on a server which is connected to the internet and has Tidal Tools installed. You can check out
103
103
[Getting Started with Tidal Tools](tidal-tools.html) guide on how to install
104
104
it.
105
105
- You need to install **Python 3.6+** on your local workstation (control node)
4. Execute `machine-stats` and pipe its output to Tidal Tools:
127
+
### Execute Machine Stats Manually
128
+
129
+
Execute `machine-stats` in your current working directory, and save the result to a `json` file of your choice.
130
+
131
+
This is useful for performing a test run to ensure you have Machine Stats set up correctly, or for saving the results of a single invocation when running Machine Stats on an offline server.
132
+
133
+
$ machine-stats > <path-to-result-file>
134
+
135
+
On an online server with `tidal tools` installed, you can upload this result file to Tidal Migrations Platform with the following command.
136
+
137
+
$ tidal sync servers <path-to-result-file>
138
+
139
+
### Run Machine Stats
140
+
141
+
Now that you have created a hosts file, you have two options for how to run Machine Stats depending on your needs. For example, you could use Machine Stats to capture data points on your inventory and send its output to your Tidal workspace. Alternatively, You can use Machine Stats to capture statistics on a host for a period of time. The following 2 sections will guide you through both scenarios.
142
+
143
+
#### Pipe Machine Stats Output to Tidal Migrations Platform
144
+
145
+
Execute `machine-stats` and pipe its output to Tidal Tools:
128
146
129
-
```
130
147
$ machine-stats | tidal sync servers
131
-
```
148
+
149
+
This approach is useful when you want to take a snapshot of your infrastructure and upload it directly to the Tidal Migrations Platform in one command. Since we're uploading the result immediately, this approach will only work on a server which has `tidal tools` installed and which is connected to the internet.
150
+
151
+
#### Run Machine Stats on a Cron Job
152
+
153
+
By leveraging cron, you can run Machines Stats on a schedule to gather data over a period of time. This is useful if you want to gather utilization data, for example recording the CPU utilization of your machines over a set period.
154
+
155
+
Since we're not piping the result to Tidal Migrations Platform, and are instead saving the result files locally, this approach can be used on an offline server.
156
+
157
+
First, create a script for cron to execute, like the one below. Replace `<path-to-hosts-file>` and `<path-to-results-directory>` with the correct values. Ensure you use full paths, not relative paths. Save this script with a name like `run-machine-stats.sh`.
You can get the value for `<full-path>` by running `echo $PATH`.
174
+
175
+
The `*/5` means that cron will execute this script every 5 minutes. You can customize this to set the sampling interval of your choosing.
176
+
177
+
Your results should appear in the existing `<path-to-results-directory>` that you specified in the `run-machine-stats.sh` script. Each result filename will contain a timestamp of when the invocation occurred.
178
+
179
+
### Technical Documentation
132
180
133
181
For more details on configuration and usage, please check Machine Stats for
Now, transfer the result.json file to your server with internet access.
153
+
### Run Machine Stats
156
154
157
-
From here you can use
155
+
Now that you have created a hosts file, you have two options for how to run Machine Stats depending on your needs. For example, you could use Machine Stats to capture data points on your inventory, and then send the result from an online server to your Tidal workspace. Alternatively, You can use Machine Stats to capture statistics on a host for a period of time. The following 2 sections will guide you through both scenarios.
158
156
159
-
```
160
-
tidal sync servers result.json
161
-
```
157
+
#### Execute Machine Stats Manually
158
+
159
+
Execute `machine-stats` in your current working directory, and save the result to a `json` file of your choice.
160
+
161
+
This is useful for performing a test run to ensure you have Machine Stats set up correctly, or for taking a single snapshot of your machines to then upload from your online server to Tidal Migrations Platform.
162
+
163
+
$ machine-stats > <path-to-result-file>
164
+
165
+
On an online server with `tidal tools` installed, you can upload this result file to Tidal Migrations Platform with the following command.
166
+
167
+
$ tidal sync servers <path-to-result-file>
168
+
169
+
#### Run Machine Stats on a Cron Job
170
+
171
+
By leveraging cron, you can run Machines Stats on a schedule to gather data over a period of time. This is useful if you want to gather utilization data, for example recording the CPU utilization of your machines over a set period.
172
+
173
+
First, create a script for cron to execute, like the one below. Replace `<path-to-hosts-file>` and `<path-to-results-directory>` with the correct values. Ensure you use full paths, not relative paths. Save this script with a name like `run-machine-stats.sh`.
You can get the value for `<full-path>` by running `echo $PATH`.
190
+
191
+
The `*/5` means that cron will execute this script every 5 minutes. You can customize this to set the sampling interval of your choosing.
162
192
163
-
This sends the results to the Tidal Migrations API. Tidal Tools should confirm to you that the results were successfully uploaded. You should see the Job in the Discovery section, and your updated Server inventory in the Tidal Migrations Platform.
193
+
Your results should appear in the existing `<path-to-results-directory>` that you specified in the `run-machine-stats.sh` script. Each result filename will contain a timestamp of when the invocation occurred.
0 commit comments