bin/metrics-snmp-if.rb in sensu-plugins-snmp-2.1.0 vs bin/metrics-snmp-if.rb in sensu-plugins-snmp-3.0.0
- old
+ new
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
+
# SNMP Interface Metrics
# ===
#
# Collect device network interface metrics using the IF-MIB (RFC 2863) interface.
#
@@ -34,11 +36,11 @@
# Copyright (c) 2013 Joe Miller
#
# Released under the same terms as Sensu (the MIT license); see LICENSE
# for details.
-# rubocop:disable VariableName
+# rubocop:disable Naming/VariableName
require 'sensu-plugin/metric/cli'
require 'snmp'
def graphite_safe_name(name)
name.gsub(/\W/, '_')
@@ -128,26 +130,26 @@
long: '--timeout TIMEOUT',
default: 5,
description: 'Request timeout'
def run # rubocop:disable Metrics/AbcSize
- if_table_HC_columns = %w(
+ if_table_HC_columns = %w[
ifHCInOctets ifHCOutOctets
ifHCInUcastPkts ifHCOutUcastPkts
ifHCInMulticastPkts ifHCOutMulticastPkts
ifHCInBroadcastPkts ifHCOutBroadcastPkts
- )
- if_table_LC_columns = %w(
+ ]
+ if_table_LC_columns = %w[
ifInOctets ifOutOctets
ifInUcastPkts ifOutUcastPkts
ifInMulticastPkts ifOutMulticastPkts
ifInBroadcastPkts ifOutBroadcastPkts
- )
- if_table_common_columns = %w(
+ ]
+ if_table_common_columns = %w[
ifIndex ifOperStatus ifName ifDescr
ifInErrors ifOutErrors ifInDiscards ifOutDiscards ifSpeed
- )
+ ]
if_table_columns = if_table_common_columns +
(config[:low_capacity] ? if_table_LC_columns : if_table_HC_columns)
SNMP::Manager.open(
host: config[:host].to_s,
@@ -195,5 +197,6 @@
end
end
ok
end
end
+# rubocop:enable Naming/VariableName