Skip to content

Commit

Permalink
Content changes to tidal.cloud (#261)
Browse files Browse the repository at this point in the history
* Content changes

* Apply review suggestion changes
  • Loading branch information
pranavmalaviya authored May 11, 2023
1 parent 6efabbd commit 41eea09
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 91 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Tidal Migrations
Copyright (c) 2023 Tidal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Machine Stats

A simple and effective way to gather machine statistics (RAM, Storage, CPU)
from a server environment as a first layer of a [Tidal Migrations discovery
process](https://guides.tidalmg.com).
from a server environment as a first layer of a [Tidal discovery process](https://guides.tidal.cloud/).

Supports Windows and Unix-like platforms.

> _NB: For other platforms or custom integrations, see [the guides
> here](https://guides.tidalmg.com/sync-servers.html)._
> here](https://guides.tidal.cloud/sync-servers.html)._
## Overview

Expand All @@ -24,20 +23,21 @@ trickery of thin-provisioning from SAN tools. This allows you to confidently
plan data replication time, or other migration metrics on an app-by-app basis.

```
┌ Machine Stats ─────────────┐ ╔═ T I D A L M I G R A T I O N S ════╗
│ │ ║
│ CPU, RAM, Storage etc. │ ║ - Single Source of Truth
│ │ `tidal sync servers` ║ - Server, Database, and
│ │──────────────────────────>║ Application Inventory
│ │ ║
│ │ ║
└────────────────────────────┘ ╚═══════════════════════════════════════
┌ Machine Stats ─────────────┐ ╔═════════ TIDAL CLOUD ═════════╗
│ │ ║ ║
│ CPU, RAM, Storage etc. │ ║ - Single Source of Truth ║
│ │ `tidal sync servers` ║ - Server, Database, and ║
│ │──────────────────────────>║ Application Inventory ║
│ │ ║ ║
│ │ ║ ║
└────────────────────────────┘ ╚═══════════════════════════════╝
```

As your cloud migration will likely take place over many months or years, it's
important to have current resource requirements throughout your journey. To
accomplish this, setup `machine_stats` in a cron job or Scheduled Task and
synchronize your data on a _daily_ basis to Tidal Migrations.
synchronize your data on a _daily_ basis to Tidal. You can find more information
about it [here](https://guides.tidal.cloud/machine_stats.html#run-machine-stats-on-a-cron-job).

## Table of Contents

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reporting vulnerabilities

If you think you've identified a security related issue, please email us at security@tidalmigrations.com. This is delivered directly to our engineering and security team. Your email will be acknowledged within one business day, and you'll receive a more detailed response to your email within 7 days indicating the next steps in handling your report.
If you think you've identified a security related issue, please email us at <security@tidalcloud.com>. This is delivered directly to our engineering and security team. Your email will be acknowledged within one business day, and you'll receive a more detailed response to your email within 7 days indicating the next steps in handling your report.

In addition, please include the following information along with your report:

Expand Down
2 changes: 1 addition & 1 deletion libvirt/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Machine Stats for Hypervisors (Virt-Stats)

A simple and effective way to gather guest VM statistics (hostname, IP addresses) from a [libvirt](https://libvirt.org/)-based environment as a first layer of a [Tidal Migrations discovery process](https://guides.tidalmg.com/). A common use case is to use this to integrate your KVM-based virtual machine inventory into the Tidal Migrations Platform.
A simple and effective way to gather guest VM statistics (hostname, IP addresses) from a [libvirt](https://libvirt.org/)-based environment as a first layer of a [Tidal's discovery process](https://guides.tidal.cloud/). A common use case is to use this to integrate your KVM-based virtual machine inventory into the [Tidal Accelerator](https://www.tidalcloud.com/accelerator/) Platform.

## Prerequisutes

Expand Down
4 changes: 2 additions & 2 deletions libvirt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
setup(
name="virt_stats",
version="develop",
author="Tidal Migrations",
author_email="support@tidalmigrations.com",
author="Tidal",
author_email="support@tidalcloud.com",
description="A simple and effective way to gather machine statistics (RAM, Storage, CPU, etc.) from virtual environment",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
101 changes: 50 additions & 51 deletions unix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
[![PyPI](https://img.shields.io/pypi/v/machine-stats)](https://pypi.org/project/machine-stats/)

A simple and effective way to gather machine statistics (RAM, Storage, CPU)
from a server environment as a first layer of a [Tidal Migrations discovery
process](https://guides.tidalmg.com).
from a server environment as a first layer of a [Tidal discovery process](https://guides.tidal.cloud/).

Machine Stats for Linux/Unix leverages [Ansible](https://www.ansible.com/) to
gather facts in a cross-platform way.

## Interactive tutorial

Get familiar with Machine Stats, Tidal Tools and Tidal Migrations Platform!
Get familiar with Machine Stats, Tidal Tools and Tidal Accelerator!

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Ftidalmigrations%2Fmachine-stats-workshop&cloudshell_image=gcr.io%2Ftidal-1529434400027%2Fmachine-stats-workshop&cloudshell_tutorial=machine-stats.md&shellonly=true)

## Installation

Install locally in a Python 3 environment:

```
```sh
python3 -m pip install machine-stats
```

Expand All @@ -31,85 +30,85 @@ _Need to install in an environment without internet access?_ [Checkout how to do
### Ubuntu 16.04

1. Make sure `pip` is installed and is one of the latest version available:
```
```sh
sudo apt update && \
sudo apt install -y python3-pip && \
python3 -m pip install --user pip==18.1 && \
python3 -m pip install --upgrade --user pip
```
**Note:** Direct upgrade to the latest available `pip` version results with an unusable `pip` installation. That's why we perform the upgrade through the intermediate version (`18.1`).
2. Install `machine-stats`:
```
```sh
python3 -m pip install machine-stats
```
### Debian 9/Ubuntu 18.04
1. Make sure `pip` is installed and is one of the latest version:
```
```sh
sudo apt update && \
sudo apt install -y python3-pip && \
python3 -m pip install --upgrade pip
```
2. Install `machine-stats`:
```
```sh
python3 -m pip install machine-stats
```
### Debian 10/Debian 11/Ubuntu 20.04/Ubuntu 21.04
1. Make sure `pip` is installed:
```
```sh
sudo apt update && \
sudo apt install -y python3-pip
```
2. Install `machine-stats`:
```
```sh
python3 -m pip install machine-stats
```
### CentOS 7/CentOS 8/CentOS Stream/Red Hat Enterprise Linux 7/Red Hat Enterprise Linux 8/Rocky Linux 8
1. Install Python 3:
```
```sh
sudo yum install -y python3
```
2. Upgrade `pip` to the latest available version:
```
```sh
python3 -m pip install --upgrade --user pip
```
3. Install `machine-stats`:
```
```sh
python3 -m pip install machine-stats
```
### SUSE Linux Enterprise Server 12
1. Install Python 3.6:
```
```sh
sudo zypper install -y python36-base
```
2. Install `machine-stats`:
```
```sh
pip install machine-stats
```
### SUSE Linux Enterprise Server 15
1. Install `pip`:
```
```sh
sudo zypper install -y python3-pip
```
2. Install `machine-stats`:
```
```sh
pip install machine-stats
```
</details>
## Data captured
For Linux/Unix based systems, by default, the following metrics are captured
from the resources and sent and stored in Tidal Migrations:
from the resources and sent and stored in Tidal Accelerator:
- Host Name
- FQDN
Expand All @@ -133,7 +132,7 @@ You also can optionally capture metrics about processes running on the server:
- Total Alive Time
To enable capturing process metrics add the command-line flag `--process-stats`:
```
```sh
machine-stats --process-stats
```
Expand All @@ -148,7 +147,7 @@ machine-stats --process-stats
3. If you need to use a custom SSH identity file for some particular host,
provide it as the following:
```
```sh
[email protected] ansible_ssh_private_key_file=path/to/key-file.pem
```
Expand All @@ -157,14 +156,14 @@ machine-stats --process-stats
`/usr/bin/python`), add the `ansible_python_interpreter` parameter to the
`hosts` file after the host IP/domain, for example:
```
```text
freebsd.example.com ansible_python_interpreter=/usr/local/bin/python
```
6. Execute `machine-stats` and pipe its output to Tidal Tools:
```
$ machine-stats | tidal sync servers
```sh
machine-stats | tidal sync servers
```
### Additional notes
Expand All @@ -173,14 +172,14 @@ By default Machine Stats looks for the `hosts` file in current working
directory. If your inventory file has another name or is located on another
path, then you should specify it explicitly:
```
$ machine-stats /path/to/myhosts | tidal sync servers
```sh
machine-stats /path/to/myhosts | tidal sync servers
```
You can specify multiple inventory files as the following:
```
$ machine-stats hosts myhosts /path/to/myhosts
```sh
machine-stats hosts myhosts /path/to/myhosts
```
### Configuration
Expand All @@ -203,8 +202,8 @@ configuration files in the following locations:
Also, it is possible to specify the custom configuration file location by
setting the `ANSIBLE_CONFIG` environment variable, for example:
```
$ ANSIBLE_CONFIG=/path/to/my/machine_stats.cfg machine_stats /path/to/my/hosts
```sh
ANSIBLE_CONFIG=/path/to/my/machine_stats.cfg machine_stats /path/to/my/hosts
```
**Note:** if `ANSIBLE_CONFIG` value points to a directory, then Machine Stats
Expand All @@ -220,19 +219,19 @@ but installs Python 2.6 alongside with system Python packages.
1. Download Python 2.6 package and its dependencies from EPEL repository:

```console
$ sudo curl -L -OOO -k \
sudo curl -L -OOO -k \
http://download.fedoraproject.org/pub/archive/epel/5/x86_64/{python26-libs-2.6.8-2.el5.x86_64.rpm,libffi-3.0.5-1.el5.x86_64.rpm,python26-2.6.8-2.el5.x86_64.rpm}
```

2. Install the packages:

```console
$ sudo rpm -ivh python26*.rpm libffi*.rpm
sudo rpm -ivh python26*.rpm libffi*.rpm
```

3. Use non-standard Python location in your `hosts` file:

```
```text
[email protected] ansible_python_interpreter=/usr/bin/python2.6
```

Expand All @@ -245,45 +244,45 @@ Python versions.
1. On the machine with internet connection create the packages archive using
the following commands:

```console
$ python3 -m pip download -d machine-stats-offline machine-stats
$ tar czf machine-stats-offline.tar.gz machine-stats-offline
```sh
python3 -m pip download -d machine-stats-offline machine-stats
tar czf machine-stats-offline.tar.gz machine-stats-offline
```

2. Transfer the archive to the machine where you need to perform the offline
installation (replace `<remote-host>` and `<remote-dir>` with the
appropriate values):

```console
$ scp machine-stats-offline.tar.gz <remote-host>:/<remote-dir>/
```sh
scp machine-stats-offline.tar.gz <remote-host>:/<remote-dir>/
```

3. On the remote host, extract the archive and switch to extracted directory:

```
$ tar xf machine-stats-offline.tar.gz
$ cd machine-stats-offline
```sh
tar xf machine-stats-offline.tar.gz
cd machine-stats-offline
```

4. Install Machine Stats and its dependencies:

```
$ python3 -m pip install --no-index --find-links . machine_stats-*.whl
```sh
python3 -m pip install --no-index --find-links . machine_stats-*.whl
```

## Generating a `hosts` file from Tidal Migrations
## Generating a `hosts` file from Tidal Accelerator

You can easily generate a hosts file directly from your server inventory in
Tidal Migrations. For example you can use this command:
Tidal Accelerator. For example you can use this command:

```
```sh
tidal export servers | jq '.[].host_name' > hosts
```

This will create a file (`hosts`), in your current directory, that you can
use above in Step 1.

Alternatively, if you use Tidal Migrations [Ansible Tower integration
Alternatively, if you use Tidal Accelerator [Ansible Tower integration
script](https://github.com/tidalmigrations/ansible-tower-integration) you can
use its output to generate the `hosts` file for `machine_stats`.

Expand All @@ -293,7 +292,7 @@ use its output to generate the `hosts` file for `machine_stats`.

### Usage

```
```sh
cd ansible-tower-integration
./tidal_inventory.py | jq -r '.servers.hosts[]' > path/to/hosts
```
Expand All @@ -304,16 +303,16 @@ cd ansible-tower-integration

If running Machine Stats as a CLI failed, try running it as the following:

```console
$ python3 -m machine_stats
```sh
python3 -m machine_stats
```

### How to permanently enable the Python 3.8 software collection on RHEL 7

You should always enable the Python software collection before using `pipenv`
with the following command:

```
```sh
scl enable rh-python38 bash
```

Expand All @@ -323,7 +322,7 @@ is that the collection is already enabled at every login.

Using your preferred text editor, add the following line to your `~/.bashrc`:

```
```sh
# Add RHSCL Python 3 to my login environment
source scl_source enable rh-python38
```
Loading

0 comments on commit 41eea09

Please sign in to comment.