Linux usage history of CPU Memory and Disk usage using nmon

nmon_cliHow to monitor your Linux servers with nmon

The advantage of the nmon tool over top is it will, using a simple ncurses interface, display the usage for CPU, memory, network, disks, file system, NFS, top processes, resources, and power micro-partition. What's best is that you get to choose what nmon displays. And since it's text-based, you can secure shell into your servers and get a quick glimpse.

How to create Linux usage history file

  1. Install nmon
    • $ sudo apt-get install nmon
  2. create a directory nmon 
    • $ mkdir ~/nmon
    • $ cd ~/nmon
  3. create an executable file named monitor.sh with contents, collect every 30 seconds for 1440 times (12 hours)
    • #! /bin/sh
      ​nmon -f -s 30 -c 1440  
  4. From the nmon directory run the command
    • $ ./monitor.sh
  5. Install Korn shell, if not installed
  6. Install nmonChart
  7. Convert your.nmon file to an html page like this.

If your .nmon is called hostname_date_time.nmon and the website pages are at /webpages/docs then use it like this:

./nmonchart hostname_date_time.nmon /webpages/docs/hostname_date_time.html

nmonChart