> For the complete documentation index, see [llms.txt](https://docs.swttoken.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swttoken.com/getting-started/network-node/step-10-running-the-monitoring-tools.md).

# STEP 10:RUNNING THE MONITORING TOOLS

Under Linux, you have a countless list of more powerful monitoring tools than any other. You are of course free to choose to use all those who will suit you. In this tutorial, we will introduce four tools:

* **htop:** overview and manage running process on the VPS
* **nmon:** indicate the processor load
* **nload:** check the bandwidth used
* **df command:** indicate the free space on your disk

### HTOP

Move to an unused panel and type:

```bash
htop
```

<figure><img src="https://2850242227-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rw5HYm666EVdweAAPXD%2Fuploads%2FR5OYiK3bgmrBl7LvZJjn%2Fimage.png?alt=media&amp;token=f057b590-7fae-4473-b6b4-386503e66ccb" alt=""><figcaption></figcaption></figure>

You will be able to sort all process by pressing a function key. For example, if you press **F6** function key, a panel will appear on the left side of the htop panel, and it will allow you to sort the process by memory consumption.

<figure><img src="https://2850242227-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rw5HYm666EVdweAAPXD%2Fuploads%2FJQ2GQm7qCxIShlsXBHKd%2Fimage.png?alt=media&amp;token=b900133c-33de-4a1c-87aa-717fafbfd636" alt=""><figcaption></figcaption></figure>

You can also directly see the uptime, cpu load, free memory. **But one of the most useful function with htop is to be able to stop/kill a process if needed.** You just have to highlight in blue a process and then press the **F9** function key. A menu will also appear on the left side and just move to option **‘9 SIGKILL’** and press **Enter** to kill the selected process.

<figure><img src="https://2850242227-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rw5HYm666EVdweAAPXD%2Fuploads%2FveqqIkeCPtGiSZhiKq0l%2Fimage.png?alt=media&amp;token=312e5703-da1a-4b8f-b675-df6644b2a520" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2850242227-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rw5HYm666EVdweAAPXD%2Fuploads%2FvPz9j23bOFRR8EgqB1oZ%2Fimage.png?alt=media&amp;token=1ca57477-eddc-4106-964b-b7ad8f13d93e" alt=""><figcaption></figcaption></figure>

### NMON (CPU LOAD)

Move to an unused panel and type:

```bash
nmon
```

Then type “**C**” key, and you will be able to see your VPS CPU load.

<figure><img src="https://2850242227-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rw5HYm666EVdweAAPXD%2Fuploads%2FD4QIwqzqTrNSEAXqMHxQ%2Fimage.png?alt=media&amp;token=a5e53da4-43bf-4f18-b878-1c691a81cf90" alt=""><figcaption></figcaption></figure>

### NLOAD (NETWORK TRAFFIC)

Move to another unused panel and type:

```bash
nload
```

You will then see the network traffic of your VPS:

<figure><img src="https://2850242227-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rw5HYm666EVdweAAPXD%2Fuploads%2FDZgKW3IjybNdsjdYAZdU%2Fimage.png?alt=media&amp;token=82f50ae9-e9ee-4deb-bd0c-46df41200084" alt=""><figcaption></figcaption></figure>

### DF COMMAND (DISK SPACE)

You can also use the “**df**” command to visualize the disk space used by the **SWT** database, which will grow with time.

```
df -h
```

<figure><img src="https://2850242227-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rw5HYm666EVdweAAPXD%2Fuploads%2FKoBDywugBmrIAPemxkfF%2Fimage.png?alt=media&amp;token=dea86ddb-f1e1-4d95-94e3-dd64ea59d6f7" alt=""><figcaption></figcaption></figure>

### USEFUL TMUX COMMANDS

#### **1. If you want to list your current sessions:**

```bash
tmux ls
```

#### **2. If you want to access to the right session (replace “myname” by your session name):**

```
tmux a -t myname
```

#### **3. If you want to visit your different sessions:**

```bash
tmux w
```

#### **4. If you want to restart programs from the beginning:**

```bash
sudo reboot
```

#### **5. If you want to kill a specific session (replace “myname” by your session name):**

```bash
tmux kill-session -t myname
```

#### **6. Then, the following line will be enough to access to your current session:**

```bash
tmux a
```

#### **7. If you want to open another Tmux window**

```
CTRL-B + C
```

#### **8. If you want to close a Tmux window**

```
CTRL-B + &
```

### USEFUL APPLICATION

#### **Creating an apport application to get the core dumped file**

The apport application automatically reports only managed packaged applications. When application crash, the core dump files are put in **/var/crash.**

The SWT client app is not a packaged application, so let's configure apport to get the core dump file. It helps SWT team to identify issues when you get some troubles with your node.

#### **1. Create and edit an apport settings file in .config**

```bash
sudo mkdir ~/.config/apport/
sudo nano ~/config/apport/settings
```

#### **2. Put this in the settings file**

```bash
[main]
unpackaged=true
```

Save changes by **CTRL +X**, type **Y** and then press **ENTER**.

#### **3. Restart apport**

```bash
sudo service apport restart
```

#### **4. After a crash, unpack the crash file generated by apport:**

```bash
cd /var/crash
mkdir /tmp/report
apport unpack _home_swt_swtnode_client.1000.crash /tmp/report
```

{% hint style="info" %}
The previous line has to be written in a single line, beginning with “apport-unpack”, then SPACE, then “\_home\_swt\_swtnode\_client.1000.crash /tmp/report”
{% endhint %}

#### **5. Then, type this last line:**

```bash
ls -l /tmp/report
```

Then you will have your core dumped file (it can take a while to unpack: \~1 or 2 min).

**NB: The pattern of the core dumped file is here. You can modify it if you want, but it's not recommended:**

```bash
cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport %p %s %c %d %P
```
