1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
|
<HTML
><HEAD
><TITLE
>flow-rpt2rrd</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.73
"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><H1
><A
NAME="AEN1"
><SPAN
CLASS="APPLICATION"
>flow-rpt2rrd</SPAN
></A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6"
></A
><H2
>Name</H2
><SPAN
CLASS="APPLICATION"
>flow-rpt2rrd</SPAN
> -- Convert flow-report CSV output to RRDtool format.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN10"
></A
><H2
>Synopsis</H2
><P
><B
CLASS="COMMAND"
>flow-rpt2rrd</B
> [-nv] [-d<TT
CLASS="REPLACEABLE"
><I
> debug_level</I
></TT
>] [-k<TT
CLASS="REPLACEABLE"
><I
> keys</I
></TT
>] [-K<TT
CLASS="REPLACEABLE"
><I
> keys_file</I
></TT
>] [-f<TT
CLASS="REPLACEABLE"
><I
> fields</I
></TT
>] [-p<TT
CLASS="REPLACEABLE"
><I
> rrd_path</I
></TT
>] [-P<TT
CLASS="REPLACEABLE"
><I
> rrd_postfix</I
></TT
>] [-r<TT
CLASS="REPLACEABLE"
><I
> rrd_storage</I
></TT
>]</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN28"
></A
><H2
>DESCRIPTION</H2
><P
>The <B
CLASS="COMMAND"
>flow-rpt2rrd</B
> utility processes the CSV output of
flow-report into RRDtool format. The aggregates for a key are each
stored as a DS in RRD filename {rrd_path,"/",key,rrd_postfix,".rrd"}.
By default a DS is created for flows, octets, and packets. The key
must be specified, for example an ip-port report could use smtp,nntp,ssh,telnet
as the keys which would create a separate RRD for each key.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN32"
></A
><H2
>OPTIONS</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>-d<TT
CLASS="REPLACEABLE"
><I
> debug_level</I
></TT
></DT
><DD
><P
>Set debug level to debug_level (debugging code)</P
></DD
><DT
>-h</DT
><DD
><P
>Help.</P
></DD
><DT
>-k<TT
CLASS="REPLACEABLE"
><I
> keys</I
></TT
>|<TT
CLASS="REPLACEABLE"
><I
>html</I
></TT
></DT
><DD
><P
>Comma separated list of key values. If the report has symbols
then the key must be the symbol, ie smtp not 25. The totals_* lines
may be used if they are enabled in the report. There is no default,
keys must be specified with -k or -K.</P
></DD
><DT
>-K<TT
CLASS="REPLACEABLE"
><I
> keys_file</I
></TT
></DT
><DD
><P
>Load keys from <TT
CLASS="REPLACEABLE"
><I
>keys_file</I
></TT
>. See -k.</P
></DD
><DT
>-f</DT
><DD
><P
>Comma separated list of columns to store. Each column maps to a DS in the
RRD. Defaults to flows,octets,packets</P
></DD
><DT
>-n</DT
><DD
><P
>Enable symbol table lookups. For example TCP port 25 = smtp. This will
result in RRD file names with the symbolic names if symbol lookups were
not enabled in the report.</P
></DD
><DT
>-p<TT
CLASS="REPLACEABLE"
><I
> rrd_path</I
></TT
></DT
><DD
><P
>Set path to RRD files. Defaults to ".".</P
></DD
><DT
>-P<TT
CLASS="REPLACEABLE"
><I
> rrd_postfix</I
></TT
></DT
><DD
><P
>Set RRD file name postfix. Defaults to "".</P
></DD
><DT
>-r<TT
CLASS="REPLACEABLE"
><I
> rrd_storage</I
></TT
></DT
><DD
><P
>Set RRD storage for 5 minute, 30 minute, 2 hour, and 1 day databases. List
items are : seperated. Defaults to 600:600:600:732.</P
></DD
><DT
>-v</DT
><DD
><P
>Enable verbose output.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN83"
></A
><H2
>EXAMPLES</H2
><DIV
CLASS="INFORMALEXAMPLE"
><A
NAME="AEN85"
></A
><P
></P
><PRE
CLASS="SCREEN"
>The following example shows the combined use of flow-nfilter (inline),
flow-report, and flow-rpt2rrd to create an RRD depicting traffic
from clmbo-r4 to AS 10796 and 6478 for 2004-11-08. rrdtool graph is
then used to create a .png.
#!/bin/sh
cat << EOF>report.cfg
include-filter nfilter.cfg
stat-report CLMBO-R4-TO-INTERNET-BY-DESTINATION-AS
type destination-as
filter CLMBO-R4-INTERNET-OUT
scale 100
output
options +header,+xheader
fields -duration
stat-definition 5min-summaries
report CLMBO-R4-TO-INTERNET-BY-DESTINATION-AS
EOF
cat << EOF>nfilter.cfg
# ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.46 = so-0/0/0.0
filter-primitive CLMBO-R4-INTERNET
type ifindex
permit 46
# Match on traffic to the Internet
filter-definition CLMBO-R4-INTERNET-OUT
match output-interface CLMBO-R4-INTERNET
EOF
mkdir rrds
# 5 minute flow files from flow-capture are here
FLOW_DATA=/flows/clmbo-r4/2004-11-08/
# for each 5 minute flow,aggregate with flow-report then store to RRD
for name in $FLOW_DATA/*; do
echo working...$name
flow-report -s report.cfg -S5min-summaries < $name | flow-rpt2rrd -k10796,6478 -p rrds
done
# first flow - 0:1:23 11/8/2004
START=1099890083
# last flow - 0:1:25 11/9/2004
END=1099976485
rrdtool graph CLMBO-R4-TO-INTERNET.png --start $START --end $END \
--vertical-label "Bits/Second" --title="CLMBO-R4 TO INTERNET BY AS" \
DEF:AS10796in=rrds/10796.rrd:octets:AVERAGE \
DEF:AS6478in=rrds/6478.rrd:octets:AVERAGE \
CDEF:b_AS10796in=AS10796in,8,* \
CDEF:b_AS6478in=AS6478in,8,* \
LINE1:b_AS10796in#FF0000:AS10796-in \
LINE1:b_AS6478in#555555:AS6478-in \ </PRE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN87"
></A
><H2
>BUGS</H2
><P
>Hard coded to expect 5 minute flow file intervals. Does not properly parse
flow-report time-series output.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN90"
></A
><H2
>AUTHOR</H2
><P
>Mark Fullmer
<TT
CLASS="EMAIL"
><<A
HREF="mailto:maf@splintered.net"
>maf@splintered.net</A
>></TT
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN97"
></A
><H2
>SEE ALSO</H2
><P
><SPAN
CLASS="APPLICATION"
>flow-tools</SPAN
>(1)</P
></DIV
></BODY
></HTML
>
|