#!/bin/bash

cd /var/www/htdocs/domains/rc6.org/subdomains/intranet.rc6.org/rrd/traffic

TZ='Europe/Oslo'; export TZ

DS1=`snmpget -O qv 192.168.1.1 public interfaces.ifTable.ifEntry.ifInOctets.2|sed 's/.*if[OI]u*t*n*Octets\.[0-9]\(.*\)/\1/'`
DS2=`snmpget -O qv 192.168.1.1 public 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
