## ## Settings for fetch_stat.pl ## Is re-read when changed ## ## + - * / can be used in variables with numeric values ## # Module in lib/ that corresponds to your switch MODULE = #MODULE = dell_27xx.pm #MODULE = dell_2748.pm #MODULE = linksys_slm200x.pm ## IP of switch, and username/password SWITCH = 192.168.0.10 USERNAME = admin PASSWORD = admin ## Summarize these ports, and show these names PORT 1 = First port #PORT 2 = #PORT 3 = #PORT 4 = #PORT 5 = #PORT 6 = #PORT T1 = LAG 1 # If set to 1 the program not should run in a never ending loop # Allows the script to run via cron # Required RETENTION_FILE to be set SINGLE_LOOP = 0 ## Poll ports this often, in seconds ## Notice, at 1Gbit/s the 32-bit Byte-counter wraps after ~32 secs REFRESH_RATE = 30 #REFRESH_RATE = 30 ## Long term variables is preserved during restarts to this file ## and how often the information will be written ## ## This replaces COOKIE_FILE and WRAPS_FILE ## If the retention file doesn't exist COOKIE_FILE and WRAPS_FILE will be read ## to ease migration to v2. ## While COOKIE_FILE or WRAPS_FILE is set they will be written, ## so downgrade to v1 should be possible. RETENTION_FILE = switch.retention RETENTION_EVERY_NTH_LOOP = 2 ## Logout after each loop ## Needed for the Linksys SLM2008, since it only accepts sessions ## from one ip at a time this script will lock up the admin page otherwise ## Notice, not all modules implements/needs this ALWAYS_LOGOUT = 0 ## Shall active but undefined ports (above) be auto-added to the list? ## Notice, when the settings are reread due to change they will temporary drop ## off the HTML-page and won't be logged/graphed. Sorry about that ## 0 = no, 1 = yes AUTOADD_ACTIVE_PORTS = 1 ## Exclude ports in HTML with no link AND no traffic flowing ## Will still be polled, logged and graphed though, so it's only skipped in the HTML ## Allows you to define every port you use, but they're not shown until used ## 0 = no, 1 = yes HIDE_INACTIVE_PORTS = 0 ## If hiding inactive ports in HTML (above), always show these ports anyway ## Comma-seperated list, trunks are named like T1, chains like C1 (C) and ## local interfaces like eth1 #ALWAYS_SHOW_THESE_PORTS = 2,4,8 ## Do simple polling of these local interfaces (linux-specific) ## Only out:rate/drops/collisions and in:rate/FCS will be summarized ## Might only work in recent kernels, since we don't do any fancy parsing of /proc/net/dev ## This allows me to keep track of my Internet connection #INTERFACE eth0 = Gandalf LAN #INTERFACE eth1 = Gandalf LaNet #INTERFACE eth3 = Gandalf ADSL ## If local interfaces shall be polled using ethtool then enable this setting. ## If ethtool isn't in path, include the full path ## Ethtool will give more info about errors than /proc/net/dev will BUT ## require driver-support, and might give incorrect values (dunno why) #USE_ETHTOOL = ethtool #USE_ETHTOOL = /sbin/ethtool ## Poll accounting from these chains, using the output from iptables -vxn -L ## We expect the first column to be packets and the second bytes ## Textrow is what row to parse. 1 = first row, -1 = last row, -2 = second last etc ## Syntax to poll a single chain as OUT: ## CHAIN chain, = name ## Syntax to poll two chains as both OUT and IN: ## CHAIN chain1,, chain2, = name ## The number is used to give it a ID, C, like C1,C2 etc #CHAIN 1 www_out,-1,www_in,-1 = Web-traffic #CHAIN 1 joxx_mc,-1 = Multicast ## LEGACY ## File to store cookie, prevents starting a new session when script is restarted ## Too many sessions might hang the switch web interface quickly otherwise ## Leave empty to disable caching (not recommended) ## If retention is enabled the cookie is saved there #COOKIE_FILE = switch.cookie ## File to write HTML-page to ## Leave empty to disable generation HTML_FILE = html/index.html ## File to write unusal things to. ## Leave empty to disable logging LOG_FILE = switch.log ## LEGACY ## File to remember wrapped counters in ## Can be cleared on startup with argument clear_wraps ## Leave empty to disable caching ## If retention is enabled wraps will be saved there #WRAPS_FILE = switch.wraps ## How much info to output to the shell ## 0 = no unneccessary shell output, 1 = some output, 2 = more output, 3 = full output VERBOSE = 3 ## How often we should poll link- and systeminfo (takes a little while to do) POLL_LINKINFO_EVERY_NTH_LOOP = 4 ## How often we should poll the mac-address-table (if supported by switch) ## Set to 0 or comment out to disable #POLL_MACS_EVERY_NTH_LOOP = 4 ## Set description for a mac #MAC 00:11:22:33:44:55 = Printer ## Or place your MAC-definitions in a seperate settings-file, same syntax as here #INCLUDE macs.txt ## Make bps-values grey when below this threshold, and bold when above GREY_BELOW_BPS = 2*1024 BOLD_ABOVE_BPS = 1024*1024 ## Make pps-values grey when below this threshold, and bold when above GREY_BELOW_PPS = 5 BOLD_ABOVE_PPS = 512 ## In the packetsize-table, grey percent of total packets if below this threshold GREY_BELOW_PROC = 10 ## Prefix for RRD-files to log statistics to ## One file per polled port will be created with _.rrd added ## Requires RRDs.pm to be installed and in path (part of rrdtool-perl) ## Leave empty to disable RRD_FILE_PREFIX = rrd/switch ## Don't save RRD-data or graph existing data for these ports ## Comma-seperated list, trunks are named like T1, chains like C1 (C) and ## local interfaces like eth1 #RRD_SKIP_THESE_PORTS = 13 ## How often the bps- and pps-graphs should be created ## Filenames will be based on HTML_FILE, so HTML_FILE must be set ## Set to 0 or comment out to disable graphing GRAPH_BPS_EVERY_NTH_LOOP = 4 GRAPH_PPS_EVERY_NTH_LOOP = 8 ## Create graphs with this width ## Syntax: GRAPH "name of graph" = seconds width ## No '=' in the name please ## The defaults are optimized for a graph-width of 390 pixels ## to give one PDP per pixel (if I have done the math right :-) GRAPH 1 "Past 3 hours" = 11700 GRAPH 2 "Past day" = 117000 GRAPH 3 "Past week" = 702000 GRAPH 4 "Past month" = 2808000 GRAPH 5 "Past year" = 33696000 ## Which of the defined GRAPHs above that should be used on the overview-page(s) GRAPH_OVERVIEW = 2 ## When placing the graphs in a html-file, should we insert a
## to force the graphs to this many columns? ## If set to zero, no breaks will be inserted and the browser will break when needed GRAPHS_PER_ROW = 0 ## Defines the width and height of the graph-part in generated images ## If less than 390 wide the text below the graph may not fit ## With 390 pixels two graphs per row fits when using a 1024*768 resolution ## Notice, since rrdtool is run with argument '--lazy' changes here and in the GRAPHs ## above may not take effect directly. In that case, delete the .png-files GRAPH_WIDTH = 390 GRAPH_HEIGHT = 120 ## Plot a smooth graph instead of the exact values GRAPH_SLOPE_MODE = 1 ## RRD-specific info used _ONLY_ when creating RRD-files ## Change only if you know what you're doing :-) ## If you don't want that 3 hour GRAPH you can comment out RRD_RRA 1 below ## and save yourself a 20kB or so per port. I've used 400 entries ## below even if only 390 of them is used in the above graphs. ## ## Step in seconds, defines the PDP RRD_STEP = 30 ## Log 400 entries; average of 1 PDPs; covers 3 hours RRD_RRA 1 = RRA:AVERAGE:0.5:1:400 ## Log 400 entries; average of 10 PDPs; covers 33 hours RRD_RRA 2 = RRA:AVERAGE:0.5:10:400 ## Log 400 entries; average of 60 PDPs; covers 8 days RRD_RRA 3 = RRA:AVERAGE:0.5:60:400 ## Log 400 entries; average of 240 PDPs; covers 33 days RRD_RRA 4 = RRA:AVERAGE:0.5:240:400 ## Log 400 entries; average of 2880 PDPs; covers 400 days RRD_RRA 5 = RRA:AVERAGE:0.5:2880:400 ## When the program starts it tries to keep a quite exact loop-interval ## However, RRD-graphs looks the best when polled at exact times ## If using RRD_STEP = 30, this means every whole and half minute ## This will adjust sleeps to maintain sync SYNC_SLEEP_TO_RRD = 0