class NewRelic::F5Plugin::ClientSsl

Constants

OID_LTM_CLIENT_SSL
OID_LTM_CLIENT_SSL_PROFILE_STAT
OID_LTM_CLIENT_SSL_STAT_CUR_CONNS
OID_LTM_CLIENT_SSL_STAT_CUR_NATIVE_CONNS
OID_LTM_CLIENT_SSL_STAT_ENTRY
OID_LTM_CLIENT_SSL_STAT_FULLY_HW_ACCELERATED_CONNS
OID_LTM_CLIENT_SSL_STAT_MAX_CONNS
OID_LTM_CLIENT_SSL_STAT_MAX_NATIVE_CONNS
OID_LTM_CLIENT_SSL_STAT_NAME
OID_LTM_CLIENT_SSL_STAT_NON_HW_ACCELERATED_CONNS
OID_LTM_CLIENT_SSL_STAT_PARTIALLY_HW_ACCELERATED_CONNS
OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_CUR_ENTRIES
OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_HITS
OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_INVALIDATIONS
OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_LOOKUPS
OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_OVERFLOWS

Attributes

names[RW]
snmp_manager[RW]

Public Class Methods

new(snmp = nil) click to toggle source

Init

# File lib/newrelic_f5_plugin/client_ssl.rb, line 97
def initialize(snmp = nil)
  @names = [ ]

  if snmp
    @snmp_manager = snmp
  else
    @snmp_manager = nil
  end
end

Public Instance Methods

get_conns_current(snmp = nil) click to toggle source

Gather current connection count

# File lib/newrelic_f5_plugin/client_ssl.rb, line 180
def get_conns_current(snmp = nil)
  snmp = snmp_manager unless snmp

  get_names(snmp) if @names.empty?
  res = gather_snmp_metrics_by_name("Client SSL Profiles/Current Connections", @names, OID_LTM_CLIENT_SSL_STAT_CUR_CONNS, snmp)
  NewRelic::PlatformLogger.debug("Client SSL Profiles: Got #{res.size}/#{@names.size} Current Connection metrics")
  return res
end
get_names(snmp = nil) click to toggle source

Get the list of iRule names

# File lib/newrelic_f5_plugin/client_ssl.rb, line 154
def get_names(snmp = nil)
  snmp = snmp_manager unless snmp

  if snmp
    @names.clear

    begin
      snmp.walk([OID_LTM_CLIENT_SSL_STAT_NAME]) do |row|
        row.each do |vb|
          @names.push(vb.value)
        end
      end
    rescue Exception => e
      NewRelic::PlatformLogger.error("Unable to gather Client SSL Profile names with error: #{e}")
    end

    NewRelic::PlatformLogger.debug("Client SSL Profiles: Found #{@names.size}")
    return @names
  end
end
get_session_cache_current(snmp = nil) click to toggle source

Gather current cache entries

# File lib/newrelic_f5_plugin/client_ssl.rb, line 194
def get_session_cache_current(snmp = nil)
  snmp = snmp_manager unless snmp

  get_names(snmp) if @names.empty?
  res = gather_snmp_metrics_by_name("Client SSL Profiles/Current Cache Entries", @names, OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_CUR_ENTRIES, snmp)
  NewRelic::PlatformLogger.debug("Client SSL Profiles: Got #{res.size}/#{@names.size} Current Session Cache metrics")
  return res
end
get_session_cache_hits(snmp = nil) click to toggle source

Gather session cache hits

# File lib/newrelic_f5_plugin/client_ssl.rb, line 208
def get_session_cache_hits(snmp = nil)
  snmp = snmp_manager unless snmp

  get_names(snmp) if @names.empty?
  res = gather_snmp_metrics_by_name("Client SSL Profiles/Session Cache Hits", @names, OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_HITS, snmp)
  NewRelic::PlatformLogger.debug("Client SSL Profiles: Got #{res.size}/#{@names.size} Session Cache Hit metrics")
  return res
end
get_session_cache_invalidations(snmp = nil) click to toggle source

Gather session cache invalidations

# File lib/newrelic_f5_plugin/client_ssl.rb, line 250
def get_session_cache_invalidations(snmp = nil)
  snmp = snmp_manager unless snmp

  get_names(snmp) if @names.empty?
  res = gather_snmp_metrics_by_name("Client SSL Profiles/Session Cache Invalidations", @names, OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_INVALIDATIONS, snmp)
  NewRelic::PlatformLogger.debug("Client SSL Profiles: Got #{res.size}/#{@names.size} Session Cache Invalidation metrics")
  return res
end
get_session_cache_lookups(snmp = nil) click to toggle source

Gather session cache lookups

# File lib/newrelic_f5_plugin/client_ssl.rb, line 222
def get_session_cache_lookups(snmp = nil)
  snmp = snmp_manager unless snmp

  get_names(snmp) if @names.empty?
  res = gather_snmp_metrics_by_name("Client SSL Profiles/Session Cache Lookups", @names, OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_LOOKUPS, snmp)
  NewRelic::PlatformLogger.debug("Client SSL Profiles: Got #{res.size}/#{@names.size} Session Cache Lookup metrics")
  return res
end
get_session_cache_overflows(snmp = nil) click to toggle source

Gather session cache overflows

# File lib/newrelic_f5_plugin/client_ssl.rb, line 236
def get_session_cache_overflows(snmp = nil)
  snmp = snmp_manager unless snmp

  get_names(snmp) if @names.empty?
  res = gather_snmp_metrics_by_name("Client SSL Profiles/Session Cache Overflows", @names, OID_LTM_CLIENT_SSL_STAT_SESS_CACHE_OVERFLOWS, snmp)
  NewRelic::PlatformLogger.debug("Client SSL Profiles: Got #{res.size}/#{@names.size} Session Cache Overflow metrics")
  return res
end
poll(agent, snmp) click to toggle source

Perform polling and reportings of metrics

# File lib/newrelic_f5_plugin/client_ssl.rb, line 111
def poll(agent, snmp)
  @snmp_manager = snmp

  unless get_names.empty?
    clientssl_conns_current = get_conns_current
    clientssl_conns_current.each_key { |m| agent.report_metric m, "conns", clientssl_conns_current[m] } unless clientssl_conns_current.nil?

    clientssl_session_cache_current = get_session_cache_current
    clientssl_session_cache_current.each_key { |m| agent.report_metric m, "entries", clientssl_session_cache_current[m] } unless clientssl_session_cache_current.nil?

    clientssl_session_cache_hits = get_session_cache_hits
    clientssl_session_cache_hits.each_key { |m| agent.report_counter_metric m, "hits/sec", clientssl_session_cache_hits[m] } unless clientssl_session_cache_hits.nil?

    clientssl_session_cache_lookups = get_session_cache_lookups
    clientssl_session_cache_lookups.each_key { |m| agent.report_counter_metric m, "lookups/sec", clientssl_session_cache_lookups[m] } unless clientssl_session_cache_lookups.nil?

    NewRelic::PlatformLogger.debug("Calculating Client SSL Profile hit ratios")
    clientssl_hit_ratio = { }
    clientssl_session_cache_hits.each_key do |h|
      key = h.gsub(/^Client SSL Profiles\/Session Cache Hits\//, '')
      l = "Client SSL Profiles/Session Cache Lookups/#{key}"
      p = "Client SSL Profiles/Session Cache Hit Ratio/#{key}"
      unless clientssl_session_cache_lookups[l].nil?
        if clientssl_session_cache_lookups[l].to_f > 0
          clientssl_hit_ratio[p] = (clientssl_session_cache_hits[h].to_f / clientssl_session_cache_lookups[l].to_f) * 100
        else
          clientssl_hit_ratio[p] = 0.0
        end
      end
    end
    clientssl_hit_ratio.each_key { |m| agent.report_metric m, "%", clientssl_hit_ratio[m] } unless clientssl_hit_ratio.empty?

    clientssl_session_cache_overflows = get_session_cache_overflows
    clientssl_session_cache_overflows.each_key { |m| agent.report_counter_metric m, "overflows/sec", clientssl_session_cache_overflows[m] } unless clientssl_session_cache_overflows.nil?

    clientssl_session_cache_invalidations = get_session_cache_invalidations
    clientssl_session_cache_invalidations.each_key { |m| agent.report_counter_metric m, "invld/sec", clientssl_session_cache_invalidations[m] } unless clientssl_session_cache_invalidations.nil?
  end
end