Just to dive a little deeper, this is the rrd-related parts of my perl polling code for ePMP SMs (obviously lots of code NOT shown pulls data from SMs into the variables referenced, and smid is determined when it updates the mysql just before this code snippet):
use RRDs;
unless (-e "/usr/local/canmon/rrd/sm/sm-$smid.rrd")
{
push_result("RRD for smid $smid doesn't exist, creating.\n") if ($debug>0);
RRDs::create ("/usr/local/canmon/rrd/sm/sm-$smid.rrd", "--step=600",
"DS:BytesIn:COUNTER:2400:0:U",
"DS:BytesOut:COUNTER:2400:0:U",
"DS:PktsIn:COUNTER:2400:0:U",
"DS:PktsOut:COUNTER:2400:0:U",
"DS:BcastPktsIn:COUNTER:2400:0:U",
"DS:BcastPktsOut:COUNTER:2400:0:U",
"DS:McastPktsIn:COUNTER:2400:0:U",
"DS:McastPktsOut:COUNTER:2400:0:U",
"DS:dlMCS:GAUGE:2400:0:31",
"DS:ulMCS:GAUGE:2400:0:31",
"DS:cinr:GAUGE:2400:U:U",
"DS:xmitpower:GAUGE:2400:U:U",
"DS:DBM:GAUGE:2400:U:U",
"DS:rfindiscards:COUNTER:2400:0:U",
"DS:rfoutdiscards:COUNTER:2400:0:U",
"DS:rfinerrors:COUNTER:2400:0:U",
"DS:rfouterrors:COUNTER:2400:0:U",
"DS:etherindiscards:COUNTER:2400:0:U",
"DS:etheroutdiscards:COUNTER:2400:0:U",
"DS:etherinerrors:COUNTER:2400:0:U",
"DS:etherouterrors:COUNTER:2400:0:U",
"RRA:AVERAGE:0.5:1:2016",
"RRA:AVERAGE:0.5:6:8760",
"RRA:MIN:0.5:6:8760",
"RRA:MAX:0.5:6:8760");
}
RRDs::update ("/usr/local/canmon/rrd/sm/sm-$smid.rrd","N:$bytesin:$bytesout:$pktsin:$pktsout:$bcastin:$bcastout:$mcastin:$mcastout:$dlmcs:$ulmcs:$cinr:$xmitpower:$radiodbm:$rfindiscards:$rfoutdiscards:$rf
inerrors:$rfouterrors:$etherindiscards:$etheroutdiscards:$etherinerrors:$etherouterrors");
And this is the rrdcgi code I pull in to display radio signal stats for ePMP SMs:
#!/usr/bin/rrdcgi
<RRD::GOODFOR 300>
<script type='text/javascript'>
function upsmrrdradio()
{
var days=$('#upsmrrdradio').val();
url="smepmprrdradio.cgi?smid=<RRD::CV::PATH smid>&days="+days+"&name=<RRD::CV::PATH name>"
$('#smdetailtabs').tabs('url',2,url);
$('#smdetailtabs').tabs('load',2);
}
</script>
<RRD::GRAPH rrd/<RRD::CV::PATH smid>d<RRD::CV::PATH days>.png
--title <RRD::CV::PATH days>" day dBm Stats for "<RRD::CV::PATH name>
--width 800 --height 140 --upper-limit -50 --lower-limit -105 --rigid
--end now --start end-<RRD::CV::PATH days>d
--color BACK#d0e0f0d0 --color CANVAS#ffffff --color GRID#707070 --color MGRID#500000
--imginfo '<IMG src="rrd/%s">'
--slope-mode
DEF:DA=/usr/local/canmon/rrd/sm/sm-<RRD::CV::PATH smid>.rrd:DBM:AVERAGE
DEF:DM=/usr/local/canmon/rrd/sm/sm-<RRD::CV::PATH smid>.rrd:DBM:MAX
DEF:CA=/usr/local/canmon/rrd/sm/sm-<RRD::CV::PATH smid>.rrd:cinr:AVERAGE
CDEF:NF=CA,-1,*
LINE3:DA#0000FF
AREA:NF#0000FF::STACK>
<RRD::GRAPH rrd/<RRD::CV::PATH smid>c<RRD::CV::PATH days>.png
--title <RRD::CV::PATH days>" day CINR Stats for "<RRD::CV::PATH name>
--width 800 --height 80 --upper-limit 50 --lower-limit 0 --rigid
--end now --start end-<RRD::CV::PATH days>d
--color BACK#d0e0f0d0 --color CANVAS#ffffff --color GRID#707070 --color MGRID#500000
--imginfo '<IMG src="rrd/%s">'
--slope-mode
DEF:CA=/usr/local/canmon/rrd/sm/sm-<RRD::CV::PATH smid>.rrd:cinr:AVERAGE
DEF:CM=/usr/local/canmon/rrd/sm/sm-<RRD::CV::PATH smid>.rrd:cinr:MAX
LINE3:CA#0000FF>
<RRD::GRAPH rrd/<RRD::CV::PATH smid>x<RRD::CV::PATH days>.png
--title <RRD::CV::PATH days>" day XmitPower Stats for "<RRD::CV::PATH name>
--width 800 --height 80 --upper-limit 30 --lower-limit 0 --rigid
--end now --start end-<RRD::CV::PATH days>d
--color BACK#d0e0f0d0 --color CANVAS#ffffff --color GRID#707070 --color MGRID#500000
--imginfo '<IMG src="rrd/%s">'
--slope-mode
DEF:JA=/usr/local/canmon/rrd/sm/sm-<RRD::CV::PATH smid>.rrd:xmitpower:AVERAGE
DEF:JM=/usr/local/canmon/rrd/sm/sm-<RRD::CV::PATH smid>.rrd:xmitpower:MAX
LINE3:JA#B05000>
<select id='upsmrrdradio' name='days' onchange='upsmrrdradio();'>
<option name='duration' value='1'>Duration...</option>
<option name='1 day' value='1'>1 Day</option>
<option name='7 days' value='7'>1 Week</option>
<option name='30 days' value='30'>1 Month</option>
<option name='90 days' value='90'>3 month</option>
<option name='365 days' value='365'>1 year</option>
</select>
Passed two parameters from the HTML/Javascript that embeds it - smid and days. (smid is unique per the mysql db for each radio - web view shows stats from the mysql db then throughput and radio are separate tabs, loaded via AJAX from the script above and others like it for throughput and other radio techs)
j