Graphs from script in cacti 1.x

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Moderators, Developers

Post Reply
Author
Message
miccia94
Posts: 2
Joined: Thu May 30, 2019 9:53 am

Graphs from script in cacti 1.x

#1 Post by miccia94 » Thu May 30, 2019 10:01 am

Hello guys,

I'm using this shell script to graph traffic from a specific PPPoE session over a cisco router:

Code: Select all

#!/bin/sh
#
# Find a user's in/out traffic by username.
# Syntax:
# pppoetraffic.sh <router ip> <snmp community> <snmp version> <username>

ROUTER=$1
ROCOMMUNITY=$2
SNMPVERSION=$3c
USERNAME=$4

SNMPWALK="/usr/bin/snmpwalk"
SNMPGET="/usr/bin/snmpget"

USERID=`$SNMPWALK -On -v $SNMPVERSION -c $ROCOMMUNITY $ROUTER 1.3.6.1.4.1.9.9.150.1.1.3.1.2 | grep "\"$USERNAME\"" | cut -f1 -d'=' | sed 's/.1.3.6.1.4.1.9.9.150.1.1.3.1.2.//'`

if [ "$USERID" != "" ]
then
  IFNUM=`$SNMPGET -Oqv -v $SNMPVERSION -c $ROCOMMUNITY $ROUTER 1.3.6.1.4.1.9.9.150.1.1.3.1.8.$USERID`
else
  IFNUM=0
fi

if [ "$IFNUM" = "0" ]
then
  INOCTETS=0
  OUTOCTETS=0
else
  INOCTETS=`$SNMPGET -Oqv -v $SNMPVERSION -c $ROCOMMUNITY $ROUTER IF-MIB::ifInOctets.$IFNUM`
  OUTOCTETS=`$SNMPGET -Oqv -v $SNMPVERSION -c $ROCOMMUNITY $ROUTER IF-MIB::ifOutOctets.$IFNUM`
fi

echo "in_traffic:$INOCTETS out_traffic:$OUTOCTETS"
I have a Data Input Methods template which read values from script and then i have a data source template which use the data input method to store data in rrd, also i have a graph template to show graphs.

Il older version ( I was using 0.8.8h) i was able to create a new data source and and then create the graph from the graph management page and selecting the data source.
In the new version (Im on 1.2.3) i still can create the data source manually, but i cant create the graph cause i dont see my graph template.

How can i graph these data source now?

Thanks for the help

miccia94
Posts: 2
Joined: Thu May 30, 2019 9:53 am

Re: Graphs from script in cacti 1.x

#2 Post by miccia94 » Thu May 30, 2019 11:12 am

I got it working redoing all from scratch. Now it works, i can create the data source manually, then while creating the graph i just need to change the data source

Post Reply