Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Fixed formatting issues and phrasing in readme and comments. Also op… #14

Merged
merged 1 commit into from
Jun 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 35 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,45 @@ MAINTAINER SignalFx Support <support+collectd@signalfx.com>

# Install common softwares
ENV DEBIAN_FRONTEND noninteractive

# Install all apt-get utils and required repos
RUN apt-get install -y apt-transport-https software-properties-common curl vim
RUN add-apt-repository ppa:signalfx/collectd-release && add-apt-repository ppa:signalfx/collectd-plugin-release
ENV EXPECTED_PLUGIN_VERSION 0.0.21
ENV EXPECTED_COLLECTD_VERSION 5.5.1.sfx0
RUN apt-get update && apt-get -y upgrade

# Install SignalFx Plugin and collectd
RUN apt-get install -y signalfx-collectd-plugin collectd jq
RUN grep "VERSION = \"$EXPECTED_PLUGIN_VERSION\"" /opt/signalfx-collectd-plugin/signalfx_metadata.py
RUN collectd -h | grep $EXPECTED_COLLECTD_VERSION

# clean up existing configs
RUN rm -rf /etc/collectd

# Setup our collectd
ADD configs /etc/

#Install unzip and pip
RUN apt-get install -qy unzip python-pip

#Download the SignalFx docker-collectd-plugin
RUN curl -L "https://github.com/signalfx/docker-collectd-plugin/archive/master.zip" --output /tmp/master.zip

#Extract the docker plugin
RUN unzip /tmp/master.zip -d /tmp

#Move the docker plugin into place
RUN mv /tmp/docker-collectd-plugin-master/ /usr/share/collectd/docker-collectd-plugin

#Install pip requirements
RUN pip install -r /usr/share/collectd/docker-collectd-plugin/requirements.txt

#Move the managed config into place
RUN cp /usr/share/collectd/docker-collectd-plugin/dockerplugin.conf /etc/collectd/managed_config/

#Clean up the zip files
RUN rm /tmp/master.zip

# Setup startup
# Add in startup script
ADD run.sh /.docker/
# Setup our collectd
ADD configs /tmp/

# Set correct permissions
RUN chmod +x /.docker/run.sh

# Install all apt-get utils and required repos
RUN apt-get install -y apt-transport-https software-properties-common curl vim && \
add-apt-repository ppa:signalfx/collectd-release && \
add-apt-repository ppa:signalfx/collectd-plugin-release && \
apt-get update && \
apt-get -y upgrade && \
# Install SignalFx Plugin and collectd
apt-get install -y signalfx-collectd-plugin collectd jq && \
grep "VERSION = \"$EXPECTED_PLUGIN_VERSION\"" /opt/signalfx-collectd-plugin/signalfx_metadata.py && \
collectd -h | grep $EXPECTED_COLLECTD_VERSION && \
# Clean up existing configs
rm -rf /etc/collectd && \
# Install default configs
mv /tmp/collectd /etc/ && \
# Install unzip and pip
apt-get install -qy unzip python-pip && \
# Download the SignalFx docker-collectd-plugin
curl -L "https://github.com/signalfx/docker-collectd-plugin/archive/master.zip" --output /tmp/master.zip && \
# Extract the SignalFx docker-collectd-plugin
unzip /tmp/master.zip -d /tmp && \
# Move the SignalFx docker-collectd-plugin into place
mv /tmp/docker-collectd-plugin-master/ /usr/share/collectd/docker-collectd-plugin && \
# Install pip requirements for the docker-collectd-plugin
pip install -r /usr/share/collectd/docker-collectd-plugin/requirements.txt && \
# Move the managed config into place
cp /usr/share/collectd/docker-collectd-plugin/dockerplugin.conf /etc/collectd/managed_config/ && \
# Clean up the docker-collectd-plugin zip file
rm /tmp/master.zip && \
# Set correct permissions on startup script
chmod +x /.docker/run.sh

# Change directory and declare startup command
WORKDIR /.docker/
CMD /.docker/run.sh
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This image allows you to run collectd in a completelly containerized
environment, but while retaining the ability to report statistics about the
_host_ the collectd container is running on.

The Signal Fx collectd Docker plugin is also included, and will report metrics
about your other containers.
The SignalFx collectd Docker plugin is also included, and will report metrics
about your containers.

## How to use this image

Expand All @@ -24,9 +24,9 @@ docker run --privileged -e "SF_API_TOKEN=XXXXXXXXXXXXXXXXXXXXXX" \
/etc:/mnt/etc:ro quay.io/signalfuse/collectd
```

If you don't want to report docker metrics from the collectd docker plugin, you
can leave out the argument that mounts
the docker socket `-v /var/run/docker.sock:/var/run/docker.sock`.
If you don't want to report Docker metrics from the SignalFx Docker collectd
plugin, then you can leave out the argument that mounts
the Docker socket `-v /var/run/docker.sock:/var/run/docker.sock`.

```
docker run --privileged -e "SF_API_TOKEN=XXXXXXXXXXXXXXXXXXXXXX" \
Expand Down
4 changes: 2 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ elif [ -e /mnt/hostname ]; then
#The user did not specify and the host's hostname is unavailable
#Exit with error code 1
else
echo 1>&2 "ERROR: Unable to find the hostname for the docker host. Please \
echo 1>&2 "ERROR: Unable to find the hostname for the Docker host. Please \
specify a hostname with the option -e \"HOSTNAME=<hostname>\" or by \
mounting the Docker host's hostname \
-v <path to host's hostname file>:/mnt/hostname:ro"
Expand All @@ -46,7 +46,7 @@ if [ -z "$COLLECTD_FLUSHINTERVAL" ]; then
COLLECTD_FLUSHINTERVAL=$COLLECTD_INTERVAL
fi
if [ ! -S /var/run/docker.sock ]; then
echo "The docker socket was not mounted to the container, the collectd docker plugin will be disabled"
echo "The Docker socket was not mounted into this container, the SignalFx Docker collectd plugin will be disabled"
rm /etc/collectd/managed_config/dockerplugin.conf
fi
AWS_UNIQUE_ID=$(curl -s --connect-timeout 1 http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.instanceId + "_" + .accountId + "_" + .region')
Expand Down