AI coding assistant on your command line


License
Apache-2.0
Install
pip install mentat==1.0.17

Documentation

Mentat Resource Monitor

Mentat is a resource monitoring utility that was designed for monitoring the status of production systems or profiling resource usage over time, and can be installed with the command:

pip install mentat

Mentat is tested against Windows, Linux, and Mac OS X with Python 2.6 through Python 3.5.

System Usage

Mentat allows monitoring of system CPU usage, virtual memory usage, swap memory usage, and disk space usage:

mentat --address "127.0.0.1" --sender "john@doe.com" --recipient "jane@doe.com" --threshold 90.0 100.0 100.0 100.0 --interval 300.0

When CPU usage averages above 90% for 5 minutes, an e-mail alert with the following format is generated:

From: john@doe.com
To: jane@doe.com
Subject: [ALERT] System Usage

CPU Usage: 95.25%
Memory Usage: 15.50%
Swap Usage: 0.00%
Disk Usage: 20.50%

Mentat can also be used to report system resource usage over a period of time:

mentat --address "127.0.0.1" --sender "john@doe.com" --recipient "jane@doe.com" --interval 60.0 --duration 3600.0

After an hour, an e-mail report with the following format is generated:

From: john@doe.com
To: jane@doe.com
Subject: [REPORT] System Usage

    TIME      CPU      MEM     SWAP     DISK
12:01:00    95.20    15.25     0.00    20.25
12:02:00    95.20    15.25     0.00    20.25
12:03:00    95.40    15.75     0.00    20.25
     ...      ...      ...      ...      ...
     ...      ...      ...      ...      ...
     ...      ...      ...      ...      ...
12:58:00    95.60    15.25     0.00    20.75
12:59:00    95.60    15.75     0.00    20.75
13:00:00    95.20    15.25     0.00    20.75

Process Usage

Mentat also allows monitoring of process CPU usage, virtual memory usage, file descriptors, and network connections:

mentat --process 3189 --address "127.0.0.1" --sender "john@doe.com" --recipient "jane@doe.com" --threshold 90.0 100.0 1024.0 1024.0 --interval 300.0

When CPU usage averages above 90% for 5 minutes, an e-mail alert with the following format is generated:

From: john@doe.com
To: jane@doe.com
Subject: [ALERT] Process Usage (3189)

CPU Usage: 92.75%
Memory Usage: 25.25%
File Descriptors: 100
Network Connections: 10

Mentat can also be used to report process resource usage over a period of time:

mentat --process 3189 --address "127.0.0.1" --sender "john@doe.com" --recipient "jane@doe.com" --interval 60.0 --duration 3600.0

After an hour, an e-mail report with the following format is generated:

From: john@doe.com
To: jane@doe.com
Subject: [REPORT] Process Usage (3189)

    TIME      CPU      MEM      FIO      NIO
12:01:00    92.70    25.00      100       10
12:02:00    93.70    25.50      101       10
12:03:00    93.80    25.50      100       10
     ...      ...      ...      ...      ...
     ...      ...      ...      ...      ...
     ...      ...      ...      ...      ...
12:58:00    92.80    25.00      100        9
12:59:00    92.40    25.50      100       10
13:00:00    92.70    25.00      100       10