net-snmp 5.6.1 with lm_sensors

by Herb on 30 May 2011

The default net-snmp binary builds don’t come with lm_sensors MIBs configured. If you want to add sensor graphs (voltage, fans, temperatures) to your cacti graph trees, you’ll have to build net-snmp from source and enable the lm_sensors MIBs when configuring.

First, install lm_sensors and configure using sensors-detect. Once you are able to see sensor data by running sensors move on with installing net-snmp.

PKGBUILD (Arch Linux)

# Maintainer: Eric Belanger <eric <at> archlinux.org>
# Contributor: Herbert Molenda <me <at> herbertm.ca>

pkgname=net-snmp
pkgver=5.6.1
pkgrel=2
pkgdesc="net-snmp with lm_sensors MIB"
arch=('i686' 'x86_64')
url="http://www.net-snmp.org/"
license=('custom')
depends=('openssl' 'tcp_wrappers' 'libnl' 'lm_sensors')
makedepends=('setuptools')
optdepends=('perl-term-readkey: for snmpcheck application' 
            'perl-tk: for snmpcheck and tkmib applications'
            'python2: for the python modules')
provides=('ucd-snmp')
options=('!libtool' '!makeflags' '!emptydirs')
source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        'snmpd.rc')
md5sums=('b4e30ead5783b0bb1d280172c6095ea4'
         '9f0d13676ba1fae1eb7eb178edd85b43')
sha1sums=('45bbf1295253d5379a5d1efd918593160387fd00' '2c679b564a2c319d9ce2714a9776aa0e6d89c60a')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  sed -i -e "s:\(install --basedir=\$\$dir\):\1 --root='${pkgdir}':" Makefile.in
  ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
    --enable-ucd-snmp-compatibility --enable-ipv6 --with-libwrap --with-python-modules \
    --with-default-snmp-version="3" --with-sys-contact="root@localhost" \
    --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" \
    --with-mib-modules="host misc/ipfwacc ucd-snmp/diskio tunnel ucd-snmp/dlmod ucd-snmp/lmsensorsMib" \
    --with-persistent-directory="/var/net-snmp" \
    PYTHONPROG=/usr/bin/python2
  make NETSNMP_DONT_CHECK_VERSION=1 LDFLAGS+="-Wl,-lsensors"
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" INSTALL_PREFIX="${pkgdir}" INSTALLDIRS=vendor install
  install -D -m755 "${srcdir}/snmpd.rc" "${pkgdir}/etc/rc.d/snmpd"
  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
</me></eric>

{ 0 comments }

Mercurial Central Repository with fastcgi and nginx

4 March 2010

Documentation in this arena being slim, I felt it would be helpful to write a short article on my configuration. FastCGI examples are generally documented in about two or three blog posts on the subject, all of which have become dated. For the basic ground work take a look at streamhacker. Firstly, the fastcgi process [...]

Read the full article →

mercurial clone from ssh with spaces

23 February 2010

hg clone ssh://user@host/path/to/repo Is simple enough… But what about when you have a repo called “big repo”. Took me a while to figure out (with ssh verbosity) that a combination of the regular special character ‘\’ and quotes is required for hg to call the right ssh command. hg clone "ssh://user@host/path/to/big\ repo"

Read the full article →