Sign inSign up

cpginfo/collector

By cpginfo

Updated 9 months ago

Infos collector via snmp or custom scripts using crontab

Image
0

1.2K

cpginfo/collector repository overview

DockerFile

FROM telegraf:latest
MAINTAINER [email protected]
ENV DEBIAN_FRONTEND=noninteractive
COPY sources.list /etc/apt/
RUN   apt-get update && apt-get install -y --no-install-recommends mtr-tiny \
    snmp snmpd* snmp-mibs-downloader zip vim telnet mysql-client sshpass zsh \
    ipcalc tcpdump net-tools tzdata gawk curl wget cron git openssh-client openssh-server && \
    cp /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime && \
    echo "America/Sao_Paulo" > /etc/timezone && \
    rm -rf /var/lib/apt/lists/* && \
    cd ~/ && touch .vimrc && \
    sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

ADD zshrc /root/.zshrc
COPY entrypoint.sh /

Entrypoint

#!/bin/bash
set -e
service cron start
sleep 5
if [ "${1:0:1}" = '-' ]; then
set -- telegraf --config-directory /etc/telegraf/telegraf.d "$@"
fi
exec "$@"

ZSHRC

export ZSH="/root/.oh-my-zsh"
ZSH_THEME="gnzh"
alias log="tail -f /var/log/telegraf/telegraf.log"
alias testconfig="telegraf --test --config "
plugins=(git docker docker-compose)
source $ZSH/oh-my-zsh.sh

Volumes to fix Settings

- /etc/timezone:/etc/timezone:ro
- /var/run/docker.sock:/var/run/docker.sock
- /telegraf/etc/:/etc/telegraf
- /telegraf/cron/:/var/spool/cron
- /telegraf/snmp:/usr/share/snmp
- /telegraf/scripts:/scripts

Source List

deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free

deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security/ stretch/updates main contrib non-free

deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free

Tag summary

Content type

Image

Digest

sha256:506473f59

Size

247.2 MB

Last updated

9 months ago

docker pull cpginfo/collector:1.35.4