[rrd-users] Re: simple data collection script

Simon.Mullis at equinoxsolutions.com Simon.Mullis at equinoxsolutions.com
Thu Sep 4 15:36:49 MEST 2003


Ooops.

Try this

#!/bin/bash
ipaddr=$1
box=$2
community=$3

if1in=$(snmpget -c $community $ipaddr .1.3.6.1.2.1.2.2.1.10.2 | awk '{print
$3}')
if1out=$(snmpget -c $community $ipaddr .1.3.6.1.2.1.2.2.1.16.2 | awk '{print
$3}')
rrdtool update /usr/mrtg/"$box"_interface1.rrd N:${if1in}:${if1out}
# end of the script

-----Original Message-----
From: Simon.Mullis at equinoxsolutions.com
[mailto:Simon.Mullis at equinoxsolutions.com]
Sent: 04 September 2003 14:31
To: michael.meer at siemens.com; rrd-users at list.ee.ethz.ch
Subject: [rrd-users] Re: simple data collection script
Importance: Low


And the same script in bash:

#!/bin/bash
ipaddr=$1
box=$2
community=$3

if1in=$(snmpget -c $community $ipaddr .1.3.6.1.2.1.2.2.1.10.2)
if1out=$(snmpget -c $community $ipaddr .1.3.6.1.2.1.2.2.1.16.2)
rrdtool update /usr/mrtg/"$box"_interface1.rrd N:${if1in[3]}:${if1out[3]}
# end of the script





-----Original Message-----
From: Meer Michael [mailto:michael.meer at siemens.com]
Sent: 04 September 2003 08:00
To: rrd-users
Subject: [rrd-users] Re: simple data collection script 


> -----Original Message-----
> From: Dayo Adeyeye [mailto:dayo at ipnxnigeria.net]
> 
> Hello,
> Im setting up rrdtool to monitor some devices and im studying 
> the rrdtutorial by Alex. I need some help since i have very 
> little experience with scripting.........Alex gave the pseudo 
> code in his tutorial. Can someone please help me with a 
> simple perl scrip or shell script that can collect data for 
> me. That is, I'll just insert my snmpwalk commands and 
> execute the script so that it can collect data to fill a 
> database I have created on a Linux RedHat 8 box.
> 
> Dayo Adeyeye

just a small sample > fillrrd.sh :

#!/usr/bin/ksh
ipaddr=$1
box=$2
community=$3

set -A if1in `snmpget -c $community $ipaddr .1.3.6.1.2.1.2.2.1.10.2`
set -A if1out `snmpget -c $community $ipaddr .1.3.6.1.2.1.2.2.1.16.2`
rrdtool update /usr/mrtg/"$box"_interface1.rrd N:${if1in[3]}:${if1out[3]}
# end of the script

Usage of this small script:
./fillrrd.sh ipaddresse Nameofthebox community
Be sure that the rrd Database already exist when you use this script.

kind regards
Micha

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


----------------------------------------------------------------------------
--------------
Equinox Converged Solutions Limited.
Tel: +44 (0)1252 405 600
http://www.equinoxsolutions.com

IMPORTANT NOTICE:
This message is intended solely for the use of the Individual or
organisation to whom it is addressed. It may contain privileged or
confidential information.  If you have received this message in error,
please notify the originator immediately.
If you are not the intended recipient, you should not use, copy, alter, or
disclose the contents of this message.  All information or opinions
expressed in this message and/or any attachments are those of the author and
are not necessarily those of Equinox Converged Solutions Limited.
Equinox Converged Solutions Limited accepts no responsibility  for loss or
damage arising from its use, including damage from virus.
----------------------------------------------------------------------------
--------------

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list