1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 18:07:20 +00:00

Merge pull request #381 from dotdoom/master

Minor fixes in plugins
This commit is contained in:
Kenyon Ralph 2013-11-03 01:29:24 -07:00
commit d1a47b7d12
3 changed files with 30 additions and 30 deletions

View file

@ -48,7 +48,7 @@ if ARGV.first == 'reset'
end
new_data = ''
File.open(LOG_FILE, 'r') do |flog|
File.open(LOG_FILE, 'rb') do |flog|
flog.seek(log_info[:start])
new_data = flog.read
end

View file

@ -92,5 +92,5 @@ when nil # fetch
}.join $/
end
else
warn "unrecognized argument <#{ARGV.fist}>"
warn "unrecognized argument <#{ARGV.first}>"
end

View file

@ -1,14 +1,14 @@
#!/usr/bin/env ruby
# netstat_s revision 4 (Apr 2013)
# netstat_s revision 5 (Aug 2013)
#
# This plugin shows various statistics from 'netstat -s'
#
# Required privileges: none
#
# OS:
# Supposed: BSD, Linux
# Tested: FreeBSD: 8.2, 8.3
# Supposed: BSD, Linux (only a few items, see netstat_multi for more)
# Tested: FreeBSD: 8.2, 8.3, 9.1
# Linux : Debian 6 (kernel 2.6.32), Arch (kernel 3.8.3), CentOS 6
#
# Author: Artem Sheremet <dot.doom@gmail.com>
@ -290,46 +290,46 @@ def graphs_for(protocol)
[ /(\d+) with data length < header length$/, [ [ :packets, 'data length < header length' ] ] ],
[ /(\d+) with bad options$/, [ [ :packets, 'bad options' ] ] ],
[ /(\d+) with incorrect version number$/, [ [ :packets, 'incorrect version' ] ] ],
[ /(\d+) fragments received$/, [ [ :packets, 'fragments' ] ] ],
[ /(\d+) fragments dropped \(dup or out of space\)$/, [ [ :packets, 'frags dropped: dup/out of spc' ] ] ],
[ /(\d+) fragments dropped after timeout$/, [ [ :packets, 'frags dropped: timeout' ] ] ],
[ /(\d+) packets reassembled ok$/, [ [ :packets, 'reassembled ok' ] ] ],
[ /(\d+) packets for this host$/, [ [ :packets, 'for this host' ] ] ],
[ /(\d+) packets for unknown\/unsupported protocol$/, [ [ :packets, 'for unknown/unsup protocol' ] ] ],
[ /(\d+) packets forwarded \((\d+) packets fast forwarded\)$/, [ [ :packets, 'forwarded' ], [ :packets, 'fast forwarded' ] ] ],
[ /(\d+) packets not forwardable$/, [ [ :packets, 'not forwardable' ] ] ],
[ /(\d+) packets received for unknown multicast group$/, [ [ :packets, 'unknown multicast grp' ] ] ]
[ /(\d+) fragments? received$/, [ [ :packets, 'fragments' ] ] ],
[ /(\d+) fragments? dropped \(dup or out of space\)$/, [ [ :packets, 'frags dropped: dup/out of spc' ] ] ],
[ /(\d+) fragments? dropped after timeout$/, [ [ :packets, 'frags dropped: timeout' ] ] ],
[ /(\d+) packets? reassembled ok$/, [ [ :packets, 'reassembled ok' ] ] ],
[ /(\d+) packets? for this host$/, [ [ :packets, 'for this host' ] ] ],
[ /(\d+) packets? for unknown\/unsupported protocol$/, [ [ :packets, 'for unknown/unsup protocol' ] ] ],
[ /(\d+) packets? forwarded \((\d+) packets fast forwarded\)$/, [ [ :packets, 'forwarded' ], [ :packets, 'fast forwarded' ] ] ],
[ /(\d+) packets? not forwardable$/, [ [ :packets, 'not forwardable' ] ] ],
[ /(\d+) packets? received for unknown multicast group$/, [ [ :packets, 'unknown multicast grp' ] ] ]
]),
Graph.new('sent', protocol, [
[ /(\d+) packets sent from this host$/, [ [ :packets, 'total' ] ] ],
[ /(\d+) redirects sent$/, [ [ :packets, 'redirect' ] ] ],
[ /(\d+) packets sent with fabricated ip header$/, [ [ :packets, 'fabricated IP head' ] ] ],
[ /(\d+) output packets dropped due to no bufs, etc\.$/, [ [ :packets, 'dropped: no bufs, etc' ] ] ],
[ /(\d+) output packets discarded due to no route$/, [ [ :packets, 'discarded: no route' ] ] ],
[ /(\d+) output datagrams fragmented$/, [ [ :packets, 'fragmented' ] ] ],
[ /(\d+) fragments created$/, [ [ :packets, 'fragments created' ] ] ],
[ /(\d+) datagrams that can't be fragmented$/, [ [ :packets, "can't be fragmented" ] ] ],
[ /(\d+) tunneling packets that can't find gif$/, [ [ :packets, 'tunneling, gif not found' ] ] ],
[ /(\d+) datagrams with bad address in header$/, [ [ :packets, 'bad address in header' ] ] ]
[ /(\d+) packets? sent from this host$/, [ [ :packets, 'total' ] ] ],
[ /(\d+) redirects? sent$/, [ [ :packets, 'redirect' ] ] ],
[ /(\d+) packets? sent with fabricated ip header$/, [ [ :packets, 'fabricated IP head' ] ] ],
[ /(\d+) output packets? dropped due to no bufs, etc\.$/, [ [ :packets, 'dropped: no bufs, etc' ] ] ],
[ /(\d+) output packets? discarded due to no route$/, [ [ :packets, 'discarded: no route' ] ] ],
[ /(\d+) output datagrams? fragmented$/, [ [ :packets, 'fragmented' ] ] ],
[ /(\d+) fragments? created$/, [ [ :packets, 'fragments created' ] ] ],
[ /(\d+) datagrams? that can't be fragmented$/, [ [ :packets, "can't be fragmented" ] ] ],
[ /(\d+) tunneling packets? that can't find gif$/, [ [ :packets, 'tunneling, gif not found' ] ] ],
[ /(\d+) datagrams? with bad address in header$/, [ [ :packets, 'bad address in header' ] ] ]
])
]
when 'arp'
$os == :linux ? [] : [
Graph.new('sent', protocol, [
[ /(\d+) ARP requests sent$/, [ [ :packets, 'requests' ] ] ],
[ /(\d+) ARP replies sent$/, [ [ :packets, 'replies' ] ] ]
[ /(\d+) ARP requests? sent$/, [ [ :packets, 'requests' ] ] ],
[ /(\d+) ARP repl(?:y|ies) sent$/, [ [ :packets, 'replies' ] ] ]
]),
Graph.new('received', protocol, [
[ /(\d+) ARP packets received$/, [ [ :packets, 'total' ] ] ],
[ /(\d+) ARP requests received$/, [ [ :packets, 'requests' ] ] ],
[ /(\d+) ARP replies received$/, [ [ :packets, 'replies' ] ] ],
[ /(\d+) ARP packets? received$/, [ [ :packets, 'total' ] ] ],
[ /(\d+) ARP requests? received$/, [ [ :packets, 'requests' ] ] ],
[ /(\d+) ARP repl(?:y|ies) received$/, [ [ :packets, 'replies' ] ] ],
[ /(\d+) total packets dropped due to no ARP entry$/, [ [ :packets, 'dropped: no entry' ] ] ]
]),
Graph.new('entries', protocol, [
[ /(\d+) ARP entrys timed out$/, [ [ :entries, 'timed out' ] ] ],
[ /(\d+) ARP entrys? timed out$/, [ [ :entries, 'timed out' ] ] ],
[ /(\d+) Duplicate IPs seen$/, [ [ :entries, 'duplicate IPs seen' ] ] ]
])
]