IBM Support

nmon to JSON plus new direct JSON monitor

How To


Summary

Converting nmon CSV to JSON format for modern tools or move to njmon for much better JSON stats and tools to connect to InfuxDB & Grafana, Elastic ELK, or Splunk.

Objective

Nigels Banner

Steps

nmon2json

First, is a tool to take a nmon output file (which is a Comma Separated Value text file) and converts it into JSON format.  JSON is the preferred format for many "new age" Web 2.0 tools to ingest into a database and support dynamic graphing of the stats.  JSON is a simple format but there are options for grouping stats. 

I would like your comments on that and what is the best fit for you and your favourite tools. 

For example,

Simple all at one level:

{
    "cpu_usr": 50,
    "cpu_sys": 10,
    "cpu_wait": 5,
    "cpu_idle": 35,
    "mem_size": 32000,
    "mem_free": 320,
. . . 
}

 Or grouped

{
      "cpu": {
           "usr": 50,
           "sys": 10,
           "wait": 5,
           "idle": 35
       }
    "memory": {
           "size": 32000,
           "free": 320
      }
. . .
}

nmon2json: New Flash 14 Dec 2017

This was released today on the website.  You find there the nmon2json Ksh script and sample output files for both formats (single-level and multiple-level JSON) and from the output files originating from both AIX and Linux.

  • https://nmon.sourceforge.net/pmwiki.php?n=Site.Nmon2json
  • The single-level output option is now the default. I am told it is the way Splunk, ELK, and Logstash like the data.
  • Also, find the Python program as an example of how to read JSON data files and extract the stats from the nmon2json script.

Limitations in the first release:

  1. Totals for Network I/O (total KB/ per second and packets per seconds) but not individual network interfaces 
  2. Totals for Disk I/O (totals for read and write KB per second and xfers per second) but not individual disks
  3. Does not handle Top process stats, as it is complicated and processes are transitory, which makes parsing the JSON hard.
  4. Can only be used on finished nmon files as it takes multiple passes due to the config data in the "information" section.
    • As a result, you can't parse the live output from nmon (for example processing with a pipe or FIFO) for live stats collection. 
    • It turns out nmon for AIX can't be streamed to a pip or FIFO command - it reports the file exists already and stops.

njmon for Linux and njmon for AIX

Second, is a new tool that extracts the performance stats on AIX, VIOS, and Linux like nmon but then generates JSON data directly. 

Now released as open source.

You can find it here on sourceforge:  http://nmon.sourceforge.net/pmwiki.php?n=Site.Njmon

It includes near real-time injection in to Splunk, Elastic ELK, InfluxDB, or Grafana.

Note: Do not mix up nmon stats and njmon stats in the same InfluxDB database, which are now called "buckets" from InfluxDB version 2 onwards.

Additional Information

Other places to find content from Nigel Griffiths IBM (retired)

Document Location

Worldwide

[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions"},{"Line of Business":{"code":"","label":""},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"HW1W1","label":"Power -\u003EPowerLinux"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Versions"}]

Document Information

Modified date:
09 June 2023

UID

ibm11115667