Révision bd45f70d
use DERIVE instead of COUNTERS in order to avoid spikes when router reboots or stats are reset; added uptime chart; moved clients into system category
| plugins/other/d-link-dir-655-router-statistics-plugin | ||
|---|---|---|
| 93 | 93 |
end |
| 94 | 94 |
puts "dhcp_clients.value " + j.to_s |
| 95 | 95 |
|
| 96 |
puts "multigraph uptime" |
|
| 97 |
# get uptime of connection |
|
| 98 |
clients_xml = agent.get("#{router_path}/wan_connection_status.xml").body
|
|
| 99 |
doc = Nokogiri::XML(clients_xml.to_s) |
|
| 100 |
uptime = doc.children.search('wan_interface_up_time_0')[0].text
|
|
| 101 |
puts "uptime.value " + sprintf( "%.2f", (Float(uptime)/86400) ) |
|
| 102 |
|
|
| 96 | 103 |
# graph overall interface packets transferred per interval |
| 97 | 104 |
puts "multigraph if_packets" |
| 98 | 105 |
for i in [ "LAN", "WAN", "WLAN" ] do |
| ... | ... | |
| 137 | 144 |
puts 'graph_order LAN_recv LAN_send WAN_recv WAN_send WLAN_recv WLAN_send' |
| 138 | 145 |
puts 'graph_vlabel packets in (-) / out (+) per ${graph_period}'
|
| 139 | 146 |
for i in [ "LAN", "WAN", "WLAN" ] do |
| 140 |
puts "#{i}_recv.type COUNTER"
|
|
| 147 |
puts "#{i}_recv.type DERIVE"
|
|
| 141 | 148 |
puts "#{i}_recv.graph no"
|
| 142 | 149 |
puts "#{i}_recv.min 0"
|
| 143 | 150 |
puts "#{i}_send.label #{i}"
|
| 144 |
puts "#{i}_send.type COUNTER"
|
|
| 151 |
puts "#{i}_send.type DERIVE"
|
|
| 145 | 152 |
puts "#{i}_send.negative #{i}_recv"
|
| 146 | 153 |
puts "#{i}_send.min 0"
|
| 147 | 154 |
end |
| ... | ... | |
| 152 | 159 |
puts 'graph_order LAN_recv LAN_send WAN_recv WAN_send WLAN_recv WLAN_send' |
| 153 | 160 |
puts 'graph_vlabel packets / ${graph_period}'
|
| 154 | 161 |
for i in [ "LAN", "WAN", "WLAN" ] do |
| 155 |
puts "#{i}_recv.type COUNTER"
|
|
| 162 |
puts "#{i}_recv.type DERIVE"
|
|
| 156 | 163 |
puts "#{i}_recv.graph no"
|
| 157 | 164 |
puts "#{i}_recv.min 0"
|
| 158 | 165 |
puts "#{i}_send.label #{i}"
|
| 159 |
puts "#{i}_send.type COUNTER"
|
|
| 166 |
puts "#{i}_send.type DERIVE"
|
|
| 160 | 167 |
puts "#{i}_send.negative #{i}_recv"
|
| 161 | 168 |
puts "#{i}_send.min 0"
|
| 162 | 169 |
end |
| ... | ... | |
| 168 | 175 |
puts 'graph_vlabel packets / ${graph_period}'
|
| 169 | 176 |
for i in [ "LAN", "WAN", "WLAN" ] do |
| 170 | 177 |
puts "#{i}_coll.label #{i} collisions"
|
| 171 |
puts "#{i}_coll.type COUNTER"
|
|
| 178 |
puts "#{i}_coll.type DERIVE"
|
|
| 172 | 179 |
puts "#{i}_coll.min 0"
|
| 173 | 180 |
puts "#{i}_err.label #{i} errors"
|
| 174 |
puts "#{i}_err.type COUNTER"
|
|
| 181 |
puts "#{i}_err.type DERIVE"
|
|
| 175 | 182 |
puts "#{i}_err.min 0"
|
| 176 | 183 |
end |
| 177 | 184 |
|
| 178 | 185 |
puts "multigraph clients" |
| 179 | 186 |
puts "graph_title D-Link DIR-655 client information" |
| 180 |
puts "graph_category network"
|
|
| 187 |
puts "graph_category system"
|
|
| 181 | 188 |
puts "graph_order dhcp_clients wifi_assoc" |
| 182 | 189 |
puts "graph_vlabel number of clients" |
| 183 | 190 |
puts "dhcp_clients.label DHCP clients" |
| ... | ... | |
| 187 | 194 |
puts "wifi_assoc.type GAUGE" |
| 188 | 195 |
puts "wifi_assoc.min 0" |
| 189 | 196 |
|
| 197 |
puts "multigraph uptime" |
|
| 198 |
puts "graph_title Uptime" |
|
| 199 |
puts 'graph_vlabel uptime in days' |
|
| 200 |
puts 'graph_category system' |
|
| 201 |
puts 'uptime.label uptime' |
|
| 202 |
puts 'uptime.draw AREA' |
|
| 203 |
|
|
| 190 | 204 |
for i in [ "LAN", "WAN", "WLAN" ] do |
| 191 | 205 |
puts "multigraph if_packets.#{i}"
|
| 192 | 206 |
puts "graph_title D-Link DIR-655 #{i} traffic"
|
| ... | ... | |
| 194 | 208 |
puts 'graph_order recv send' |
| 195 | 209 |
puts 'graph_vlabel packets in (-) / out (+) per ${graph_period}'
|
| 196 | 210 |
puts 'recv.label received' |
| 197 |
puts 'recv.type COUNTER'
|
|
| 211 |
puts 'recv.type DERIVE'
|
|
| 198 | 212 |
puts 'recv.graph no' |
| 199 | 213 |
puts 'recv.min 0' |
| 200 | 214 |
puts 'send.label packets/sec' |
| 201 |
puts 'send.type COUNTER'
|
|
| 215 |
puts 'send.type DERIVE'
|
|
| 202 | 216 |
puts 'send.negative recv' |
| 203 | 217 |
puts 'send.min 0' |
| 204 | 218 |
|
| ... | ... | |
| 208 | 222 |
puts 'graph_order recv send' |
| 209 | 223 |
puts 'graph_vlabel packets / ${graph_period}'
|
| 210 | 224 |
puts 'recv.label RX packets dropped' |
| 211 |
puts 'recv.type COUNTER'
|
|
| 225 |
puts 'recv.type DERIVE'
|
|
| 212 | 226 |
puts 'recv.graph no' |
| 213 | 227 |
puts 'recv.min 0' |
| 214 | 228 |
puts 'send.label TX packets dropped' |
| 215 |
puts 'send.type COUNTER'
|
|
| 229 |
puts 'send.type DERIVE'
|
|
| 216 | 230 |
puts 'send.negative recv' |
| 217 | 231 |
puts 'send.min 0' |
| 218 | 232 |
|
| ... | ... | |
| 222 | 236 |
puts 'graph_order coll err' |
| 223 | 237 |
puts 'graph_vlabel packets / ${graph_period}'
|
| 224 | 238 |
puts 'coll.label collisions' |
| 225 |
puts 'coll.type COUNTER'
|
|
| 239 |
puts 'coll.type DERIVE'
|
|
| 226 | 240 |
puts 'coll.min 0' |
| 227 | 241 |
puts 'err.label errors' |
| 228 |
puts 'err.type COUNTER'
|
|
| 242 |
puts 'err.type DERIVE'
|
|
| 229 | 243 |
puts 'err.min 0' |
| 230 | 244 |
end |
| 231 | 245 |
end |
Formats disponibles : Unified diff