diff --git a/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog b/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog index bd05c470..d196188e 100755 --- a/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog +++ b/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog @@ -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 diff --git a/plugins/network/netstat_bsd_m_/netstat_bsd_m_ b/plugins/network/netstat_bsd_m_/netstat_bsd_m_ index 3658a389..b7fffa04 100755 --- a/plugins/network/netstat_bsd_m_/netstat_bsd_m_ +++ b/plugins/network/netstat_bsd_m_/netstat_bsd_m_ @@ -92,5 +92,5 @@ when nil # fetch }.join $/ end else - warn "unrecognized argument <#{ARGV.fist}>" + warn "unrecognized argument <#{ARGV.first}>" end diff --git a/plugins/network/netstat_s_/netstat_s_ b/plugins/network/netstat_s_/netstat_s_ index 53c9fb12..e3af9689 100755 --- a/plugins/network/netstat_s_/netstat_s_ +++ b/plugins/network/netstat_s_/netstat_s_ @@ -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 @@ -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' ] ] ] ]) ]