All Projects → f18m → CPU-MEM-monitor

f18m / CPU-MEM-monitor

Licence: other
A simple script to log Linux CPU and memory usage (using top or pidstat command) over time and output an Excel- or OpenOfficeCalc-friendly report

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to CPU-MEM-monitor

Ios Monitor Platform
📚 iOS 性能监控 SDK —— Wedjat(华狄特)开发过程的调研和整理
Stars: ✭ 2,316 (+5548.78%)
Mutual labels:  cpu, memory
nodejs
Node.js in-process collectors for Instana
Stars: ✭ 66 (+60.98%)
Mutual labels:  cpu, memory
Pubg mobile memory hacking examples
Pubg Mobile Emulator Gameloop Memory Hacking C++ code examples. Ex: Name, Coord, Bones, Weapons, Items, Box, Drop etc.
Stars: ✭ 224 (+446.34%)
Mutual labels:  cpu, memory
Touch Bar Istats
Show CPU/GPU/MEM temperature on Touch Bar with BetterTouchTool!
Stars: ✭ 141 (+243.9%)
Mutual labels:  cpu, memory
cpu-memory-monitor
CPU & Memory Monitor, auto dump.
Stars: ✭ 26 (-36.59%)
Mutual labels:  cpu, memory
Sysstat
Performance monitoring tools for Linux
Stars: ✭ 2,055 (+4912.2%)
Mutual labels:  cpu, memory
hardware
Get CPU, Memory and Network informations of the running OS and its processes
Stars: ✭ 70 (+70.73%)
Mutual labels:  cpu, memory
Xfce4 Genmon Scripts
🐭 XFCE panel generic monitor scripts
Stars: ✭ 69 (+68.29%)
Mutual labels:  cpu, memory
kotary
Managing Kubernetes Quota with confidence
Stars: ✭ 85 (+107.32%)
Mutual labels:  cpu, memory
cpu monitor
ROS node that publishes all nodes' CPU and memory usage
Stars: ✭ 52 (+26.83%)
Mutual labels:  cpu, memory
Easydeviceinfo
📱 [Android Library] Get device information in a super easy way.
Stars: ✭ 1,698 (+4041.46%)
Mutual labels:  cpu, memory
audria
audria - A Utility for Detailed Ressource Inspection of Applications
Stars: ✭ 35 (-14.63%)
Mutual labels:  cpu, memory
Server Stats
Statsy is a easy to use open source PHP tool for developers, that allows you to return various types of information about your server.
Stars: ✭ 101 (+146.34%)
Mutual labels:  cpu, memory
Wgcloud
linux运维监控工具,支持系统信息,内存,cpu,温度,磁盘空间及IO,硬盘smart,系统负载,网络流量等监控,API接口,大屏展示,拓扑图,进程监控,端口监控,docker监控,文件防篡改,日志监控,数据可视化,web ssh,堡垒机,指令下发批量执行,linux面板,探针,故障告警
Stars: ✭ 2,669 (+6409.76%)
Mutual labels:  cpu, memory
Iglance
Free system monitor for OSX and macOS. See all system information at a glance in the menu bar.
Stars: ✭ 1,358 (+3212.2%)
Mutual labels:  cpu, memory
Pm2 Server Monit
Monitor server CPU / Memory / Process / Zombie Process / Disk size / Security Packages / Network Input / Network Output
Stars: ✭ 247 (+502.44%)
Mutual labels:  cpu, memory
Walle
iOS Application performance monitoring
Stars: ✭ 19 (-53.66%)
Mutual labels:  cpu, memory
Rainbarf
it's like Rainmeter, but for CLI!
Stars: ✭ 1,087 (+2551.22%)
Mutual labels:  cpu, memory
doc
Get usage and health data about your Node.js process.
Stars: ✭ 17 (-58.54%)
Mutual labels:  cpu, memory
stress
Single-purpose tools to stress resources
Stars: ✭ 24 (-41.46%)
Mutual labels:  cpu, memory

CPU-MEM-monitor

CPU-MEM-monitor is a simple script to monitor Linux CPU and memory usage over time and output a CSV report that can be easily analysed and plotted with e.g., Excel or OpenOffice Calc.

More in details, this script allows to monitor per-thread CPU usage and memory usage by parsing in an automated way the output of TOP or PIDSTAT utilities.

The script is focused on monitoring the CPU (by thread) and memory usage (by process) of one or more Linux processes over time. This is very useful to optimize programs that need to be running for long amounts of time (e.g., servers) or to ensure that no memory leaks are present in your software. The use of regular expressions make it easy to capture CPU/memory usage of strongly-multithreaded applications. The output is written in an Excel-friendly (or OpenOffice-friendly!) .CSV file whose contents can be easily plotted with few clicks.

The script is all contained in a single file so that it is very easy to copy and move around Linux machines. It only requires BASH, TOP (or PIDSTAT) and other common utility programs (like GREP and AWK) installed.

The script is also useful to analyze a (multithreaded) process during a long amount of time (e.g., several days / months). For such usage scenario it is convenient to use the screen utility.

Deprecation Warning

Note that this project is not actively developed anymore. If you are looking for a CPU/memory monitor I suggest you to checkout my recent project:

https://github.com/f18m/cmonitor

It is a fork of Nigel's performance Monitor for Linux, adding cgroup-awareness, which makes it easy to monitor your baremetal or LXC/Docker container performances with a nice JSON-to-HTML converter utility. It provides all features of CPU-MEM-monitor in a more modern solution (HTML output or InfluxDB integration).

Command Line Interface

The script accepts the following command-line options:

    Usage: ./CPU_MEM_monitor_v11.sh [-h] [-v] [--use-pidstat] [-t THREADNAME_REGEX] [-p AUX_PROCESS1] [-p AUX_PROCESS2] ...
    Version 1.1, by Francesco Montorsi
    Automates TOP/PIDSTAT monitoring and resource usage statistics logging to a .CSV file
      -h              this help
      -v              be verbose
      --use-pidstat   pidstat rather than top will be used
      -t <tregex>     monitor threads whose name match the regex <tregex>; e.g. 'mythread\|myotherthread'
      -p <auxproc>    monitor CPU and memory usage of the auxiliary process <auxproc>
    Default option values:
      VERBOSE: false
      USEPIDSTAT: false
      THREADNAME_REGEX: myparworker\|threadtype2
      AUX_PROCESS #0: multithread
      Output .csv file name will be automatically generated based on current date and hostname.
      Associated to the .csv also a .log file containing info messages will be generated.

    DIFFERENCES BETWEEN AUXILIARY PROCESS MONITORING AND THREAD MONITORING:
      Auxiliary process monitoring collects per-process CPU% and MEMORY values.
      Thread monitoring collects per-thread CPU% and MEMORY values.

      If a monitored aux process dies, the script will attempt to restart logging process completely.
      If a monitored thread ends, the script will do nothing and continue logging.

Example Run

As an example, assume you want to monitor a process called "multithread" that generates several threads named "myparworker/0", "myparworker/1", etc or "threadtype2/0", "threadtype2/1", etc (such example program is available as an example in the "docs" folder); in this case you can launch the CPU_MEM_monitor script as:

$ ./CPU_MEM_monitor.sh -t "myparworker\|operation2thread" -p multithread

which will produce:

The .csv file produced by above example can be downloaded clicking here.

The .csv file can be easily plotted to get an idea of the thread CPU usage and the per-process memory used:

How To Install

    $ wget --no-check-certificate http://raw.githubusercontent.com/f18m/CPU-MEM-monitor/master/CPU_MEM_monitor.sh
    $ chmod a+x CPU_MEM_monitor.sh                      # ensure execute permissions
    $ sudo mv CPU_MEM_monitor.sh  /usr/local/bin        # make it available system-wide

How To Use

    $ screen              # in case you want to leave logging after closing terminal screen
    $ CPU_MEM_monitor.sh -t yourThreadName -p yourProcessName
    [CTRL+A, D]         # to detach from the screen session and leave the script running

After the session of performance logging is completed, just double-click the .csv file created in the directory where the script has been launched and analyse the logged CPU/memory values.

Other Utilities

The "decimate_compress_csv.sh" script available from:

    $ wget --no-check-certificate http://raw.githubusercontent.com/f18m/CPU-MEM-monitor/master/decimate_compress_csv.sh
    $ chmod a+x decimate_compress_csv.sh        # ensure execute permissions
    $ sudo mv decimate_compress_csv.sh  /usr/local/bin

can be used to decimate very large .csv files (e.g., generated after several days of logging), to ease manipulation by e.g. Excel.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].