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:
docker logs commandThe 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).
| Name | Description |
|---|---|
-v /:/rootfs:ro | Expose host's root file system / to the container on mount point /rootfs in read-only mode. |
--pid=host | Make host's processes visible to the container, required for top process statistics collection with T. |
--net=host | Make host's network visible to the container. |
--privileged | Allow access to host's devices. |
--restart=always | Automatically restart the container on docker/machine restart. |
| Name | Type | Description |
|---|---|---|
| c | integer | Number 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. |
| s | integer | Snapshot interval, in seconds. Controls how frequently statistics are collected. Default: 60 |
| T | boolean | Collection 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
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
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.
docker run \
-d \
-v /:/rootfs:ro \
--name="nmon-atsd-collector" \
--pid=host \
-e T=true \
--privileged \
--net=host
axibase/nmon tcp://atsd_hostname:8081
Content type
Image
Digest
Size
95 MB
Last updated
over 8 years ago
docker pull axibase/nmon