Perfstat in a Docker Container

Author: NetApp, Inc.
Source: Planet OpenStack

Inspired by my friend, co-worker, and Tech ONTAP Podcast guest, neto from Brazil, I created a Dockerfile for the perfstat8 tool based on the most recently released version, 8.3.01. This version has boost statically compiled into the binary, so it does away with much of the complexity that existed previously.

Perfstat is a diagnostic tool, frequently used by Support and Professional Services when troubleshooting, to collect performance and configuration information about a system. It has matured over the years from a collection of RSH commands executed from a Linux host, to a modern executable available on Windows or Linux. However, like any application, it still has dependencies which not every administrator has pre-installed, or wants to install. By placing Perfstat into a container we create a redistributable, easy to execute, mechanism for using the tool without having to worry about dependencies.

Before creating the container image, you will need to download perfstat8 tar.gz from here.

#
# NetApp utility Perfstat in a container
# Copyright 2016 NetApp, Inc.
#
# To create this container you'll need the perfstat8 zip file from http://nt-ap.com/1mdPGUA
# Download the file, put it in the same directory as the Dockerfile, then do a standard
# build: docker build -t your_registry:5000/perfstat8 .
# 
FROM debian:wheezy

MAINTAINER Andrew Sullivan asulliva@netapp.com

ADD Perfstat_8.3.01_Linux.tar.gz /perfstat

RUN cd /perfstat/Perfstat_8.3.01_Linux/64-bit/libs && 
    ln -s libssl.so.1.0.0 libssl.so.10 && 
    ln -s libcrypto.so.1.0.0 libcrypto.so.10

ENV LD_LIBRARY_PATH /perfstat/Perfstat_8.3.01_Linux/64-bit/libs

ENTRYPOINT ["/perfstat/Perfstat_8.3.01_Linux/64-bit/perfstat8"]
CMD ["/perfstat/Perfstat_8.3.01_Linux/64-bit/perfstat8"]

After creating the Dockerfile and downloading the perfstat8 binary (make sure you get version 8.3.01 for Linux), build the image in the standard way:

docker build -t your_registry:5000/perfstat8 .

After the image is built, you can use it like a standard command line instance.

docker run --rm -it 
  -v /tmp:/data your_registry:5000/perfstat8 
  --verbose <cluster ip="ip"> 
  --mode="cluster" 
  -o /data/output

This will result in a file at /tmp/output.tar.gz which you can send to NetApp support (or wherever you need it). Changing the data location on the host is as easy as changing the value on the left side of the -v option for the docker run command. An example of the output from the above command:

Sample output from containerized perfstat8

If you have any questions or suggestions, please don’t hesitate to reach out to me using the comments below, the NetApp Communities (my username is asulliva), or using email (my communities username at netapp.com).

Powered by WPeMatico