Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Solved: Extract Traffic Acc Data out of RRD´s via PHP Script

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
xtc



Joined: 12 Oct 2007
Posts: 1
Location: Frankfurt, Germany

PostPosted: Fri Oct 12, 2007 3:00 am    Post subject: Solved: Extract Traffic Acc Data out of RRD´s via PHP Script Reply with quote

Hi @all,

here´s a very simple php script.
you pass the month, the year and the path to a xy.rrd and the script grabs the rrd, make use of rrdtool export, extract the traffic accounting relevant data and put out a simple plain table with the data if you additionally pass the parameter "plain=1" to the script.

if not, it generates a .csv file for further use in excel or any other spreadsheet.

it doesn´t make any graphics and stuff. it just spit out relevant data for billing interface or ip-traffic out of interface traffic rrd´s.

i use it for "normal" traffic rrd´s as well as for ip-traffic rrd´s generatet with pmacct/pmacct-snmp to pass the gathered informations to any billing software.

feel free to use it, enhace it, tune it



exp_traffic.example.txt
 Description:
example output

Download
 Filename:  exp_traffic.example.txt
 Filesize:  1.69 KB
 Downloaded:  77 Time(s)


exp_traffic.php.txt
 Description:

Download
 Filename:  exp_traffic.php.txt
 Filesize:  3.03 KB
 Downloaded:  67 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group