Sign inSign up

axibase/nmon

By axibase

Updated over 8 years ago

ubuntu14.04 with installed nmon binary

Image
0

1.8K

axibase/nmon repository overview

NMON Docker Image

Overview

This Docker image can be used to collect snapshot statistics and system command output from at the host level in NMON format. It escapes container namespace and device isolation with --priviliged --net=host, optional --pid=host.

root fs is exposed and re-mounted inside the container to provide the same system command output as on the host.

The image provides three alternatives for storing data produced by the nmon daemon:

  • Container file and stdout, accessible also with docker logs command
  • Host file
  • Axibase Time Series Database (ATSD)

The advantage of collecting host-level statistics with a container as opposed to running nmon directly on the host is that this mode standartizes deployment (everything is running in containers, from images).

Container Launch Options

NameDescription
-v /:/rootfs:roExpose host's root file system / to the container on mount point /rootfs in read-only mode.
--pid=hostMake host's processes visible to the container, required for top process statistics collection with T.
--net=hostMake host's network visible to the container.
--privilegedAllow access to host's devices.
--restart=alwaysAutomatically restart the container on docker/machine restart.

Configuration Parameters

NameTypeDescription
cintegerNumber of snapshots to take between restarts. Default: 1440 (1 day @ 60 second).
Each restart triggers execution of system commands to collect up-to-date configuration.
sintegerSnapshot interval, in seconds. Controls how frequently statistics are collected. Default: 60
TbooleanCollection top process usage statistics. Default: false.
If enabled, --pid=host must be set as well as so that container has access to the list of processes on the host, instead of on the container.

The parameters are passed to the container with environmental variables -e, for example:

docker run \
    ...
    -e s=60 \
    -e c=1440 \
    -e T=true \
    axibase/nmon

Launch Examples

Store data on a file in container
docker run \
    -d \
    -v /:/rootfs:ro \
    --pid=host \
    -e T=true \
    --privileged \
    --net=host \
    axibase/nmon

nmon output will be stored to a daily file as well as to standard out, so you can read it as usual:

docker logs -f nmon-cnt-collector
Store data on a file in Host

Mount any directory from Docker host as nmon output folder in container:

docker run \
    -d \
    -v /:/rootfs:ro \
    -v /tmp/nmon_output:/opt/nmon/output \
    --name="nmon-host-collector" \
    --pid=host \
    -e T=true \
    --privileged \
    --net=host \
    axibase/nmon

All nmon output files will be stored in /tmp/nmon_output directory on Docker host.

Store data in ATSD
docker run \
    -d \
    -v /:/rootfs:ro \
    --name="nmon-atsd-collector" \
    --pid=host \
    -e T=true \
    --privileged \
    --net=host
    axibase/nmon tcp://atsd_hostname:8081

Tag summary

Content type

Image

Digest

Size

95 MB

Last updated

over 8 years ago

docker pull axibase/nmon