#!/bin/bash

TZ='Europe/Berlin'; export TZ

DS1=`snmpget -O qv localhost COMMUNITY interfaces.ifTable.ifEntry.ifInOctets.2|sed 's/.*if[OI]u*t*n*Octets\.[0-9]\(.*\)/\1/'`
DS2=`snmpget -O qv localhost COMMUNITY interfaces.ifTable.ifEntry.ifOutOctets.2|sed 's/.*if[OI]u*t*n*Octets\.[0-9]\(.*\)/\1/'`
if [[ $DS1 == '' ]]  ; then DS1=U ; fi
if [[ $DS2 == '' ]]  ; then DS2=U ; fi

rrdtool update interfaces.rrd N:$DS1:$DS2
