Giter VIP home page Giter VIP logo

snmpd's Introduction

Adjusted SNMPD daemon for Docker use

This is a patched net-snmpd-5.7.3d daemon which can be used to enable SNMP monitoring on CoreOS. Within CoreOS it is not possible to execute a volume mount on /proc. In order to achieve this, the sourcode has been patched to use /host_proc. By executing a volume mount on /host_proc, SNMP is able to use the standard MIBS which collect metrics from the guest CoreOS system.

Applied patch

The applied patch is rather simple but effective. The code is executed through a shell script called "apply_patch.sh".

#!/bin/bash
grep -lR '"/proc' * | while read line
do
	sed -i 's@"/proc@"/host_proc@g' $line
done

Compile line

The compilation of net-snmp is as default as it can get. We disable IPv6 and SNMP V1 but other than that we dont any fancy options.

./configure --prefix=/usr/local --disable-ipv6 --disable-snmpv1 --with-defaults

Cleanup

In order to keep the image accepatable in terms of size we remove all installed packages except for perl-libs

rpm -e --nodeps $(grep Installed /var/log/yum.log | grep -v perl-libs | awk '{print $5}' | sed 's/^[0-9]://g')

snmpd.conf

We added an external snmpd.conf because the EXAMPLE.conf file is not good enough to use as the default configuration. We want SNMPD to listen on all ports rather than only localhost. Also we might want to introduce a level of authorization rather than using the 'public' community string for collecting all metrics available.

...
agentAddress udp:161
...
view   all	   included   .1
...
rocommunity secret  default    -V all

Run the image

=============== Last but not least we need to run the image ofcourse. Please note that we run the container in read-only mode.

#!/bin/bash

docker run -d --name snmpd --read-only=true \
	-v /proc:/host_proc \
	--privileged \
	--net=host \
	-p 161:161/udp \
	digiwhite/snmpd

Tracking

==========

  • 2015-09-24: Added automated build through github

snmpd's People

Contributors

digiwhite1980 avatar jjamor avatar kaladalm18 avatar

Forkers

bdb-studios

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.