Reimagining nmon Using InfluxDB
By Jason Myers / Oct 04, 2022 / Blog, InfluxDB
IBM engineer Nigel Griffiths built nmon in the 1990s to monitor operating system performance data for AIX. Since its original launch, Griffiths revisited and revamped nmon. For example, he built an open-source version for Linux. Despite drastic change in the very nature of computing and exponential growth in storage, memory, and compute power, it wasn’t until 2018 that Griffiths sought to completely re-write the tool and bring it into alignment with modern computer systems.
The old version of nmon displayed condensed data on screen or saved it to a CSV file that users could then use for graphing and analysis. But users also had to wait until the end of the hour, or the end of the day, for these files before they could graph them. So, it was nowhere near real time. Griffiths also created his own file format for the data, which he described as “quirky.” While the tool provided users with helpful information, it wasn’t always the easiest tool to use. Nevertheless, it proved to be a popular tool with well over 1 million downloads.
Starting in 2018, Griffiths re-built nmon from the ground up. He identified four aspects of the tool that required modernization: 1. The file format, 2. The set of metrics the tool collected, 3. data storage, and 4. data visualization.
The first two aspects were pretty straightforward. He replaced the tool’s unique file format to both standard JSON and InfluxDB line protocol. He expanded the number of metrics the tool collected from a limited set of system performance stats to virtually every possible stat available.
He asked around about database and graphing options for all the time series data the tool collected and quickly settled on InfluxDB and Grafana, respectively. There are actually two different versions of nmon, and each has a different architecture for sending data into InfluxDB.
One version, njmon, uses the JSON file format and utilizes a Python daemon and the InfluxDB Python client library to send data to InfluxDB. The other version, nimon, uses InfluxDB line protocol for its file format and Telegraf to collect and send that data to InfluxDB.
Once the data is in InfluxDB, users can use Grafana to graph this data in real-time. These updates make nmon much more powerful and useful in modern technology stacks.
To learn more about nmon and how it uses InfluxDB, check out the full case study.