sensu-plugins-memcached 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +12 -0
- data/LICENSE +22 -0
- data/README.md +24 -0
- data/bin/check-memcached-stats.rb +63 -0
- data/bin/metrics-memcached-graphite.rb +65 -0
- data/bin/metrics-memcached-key-stats-graphite.rb +85 -0
- data/bin/metrics-memcached-socket-graphite.rb +125 -0
- data/lib/sensu-plugins-memcached.rb +1 -0
- data/lib/sensu-plugins-memcached/version.rb +9 -0
- metadata +238 -0
- metadata.gz.sig +0 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 8fdf1a4bb221ec6c893b6622031724f4f1ac74fc
         | 
| 4 | 
            +
              data.tar.gz: 4c2ebe92fd88ad2e97f418f3db8022e08d83c426
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 5a464c63e0588c0f27ae33f328809211f54d600b19ef624f18c73ce859d3008ceea48950b6e106d192f9af0faf871cb19a7078881275ff6c05cfea47c0339968
         | 
| 7 | 
            +
              data.tar.gz: 443e22cf5bc861c88d9cbff84b8d73c5fb2abd24a1276c870f6a38b815007cf4143a13fe187809ef1fb4ec80c6827053c68d249d7f2e093beb809702ad54b114
         | 
    
        checksums.yaml.gz.sig
    ADDED
    
    | Binary file | 
    
        data.tar.gz.sig
    ADDED
    
    | Binary file | 
    
        data/CHANGELOG.md
    ADDED
    
    | @@ -0,0 +1,12 @@ | |
| 1 | 
            +
            #Change Log
         | 
| 2 | 
            +
            This project adheres to [Semantic Versioning](http://semver.org/).
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            ## Unreleased][unreleased]
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            ## 0.0.1 - 2015-05-21
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            ### Added
         | 
| 11 | 
            +
            - initial release
         | 
| 12 | 
            +
             | 
    
        data/LICENSE
    ADDED
    
    | @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            Copyright (c) 2015 Sensu-Plugins
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            MIT License
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Permission is hereby granted, free of charge, to any person obtaining
         | 
| 6 | 
            +
            a copy of this software and associated documentation files (the
         | 
| 7 | 
            +
            "Software"), to deal in the Software without restriction, including
         | 
| 8 | 
            +
            without limitation the rights to use, copy, modify, merge, publish,
         | 
| 9 | 
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         | 
| 10 | 
            +
            permit persons to whom the Software is furnished to do so, subject to
         | 
| 11 | 
            +
            the following conditions:
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            The above copyright notice and this permission notice shall be
         | 
| 14 | 
            +
            included in all copies or substantial portions of the Software.
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         | 
| 17 | 
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         | 
| 18 | 
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         | 
| 19 | 
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         | 
| 20 | 
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         | 
| 21 | 
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         | 
| 22 | 
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         | 
    
        data/README.md
    ADDED
    
    | @@ -0,0 +1,24 @@ | |
| 1 | 
            +
            ## Sensu-Plugins-memcached
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            [](https://travis-ci.org/sensu-plugins/sensu-plugins-memcached)
         | 
| 4 | 
            +
            [](http://badge.fury.io/rb/sensu-plugins-memcached)
         | 
| 5 | 
            +
            [](https://codeclimate.com/github/sensu-plugins/sensu-plugins-memcached)
         | 
| 6 | 
            +
            [](https://codeclimate.com/github/sensu-plugins/sensu-plugins-memcached)
         | 
| 7 | 
            +
            [](https://gemnasium.com/sensu-plugins/sensu-plugins-memcached)
         | 
| 8 | 
            +
            [ ](https://codeship.com/projects/79841)
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            ## Functionality
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            ## Files
         | 
| 13 | 
            +
             * bin/check-memcached-stats.rb
         | 
| 14 | 
            +
             * bin/metrics-memcached-graphite.rb
         | 
| 15 | 
            +
             * bin/metrics-memcached-key-stats-graphite.rb
         | 
| 16 | 
            +
             * bin/metrics-memcached-socket-graphite.rbw
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            ## Usage
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            ## Installation
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            ## Notes
         | 
| @@ -0,0 +1,63 @@ | |
| 1 | 
            +
            #! /usr/bin/env ruby
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            #   check-memcached-stats
         | 
| 4 | 
            +
            #
         | 
| 5 | 
            +
            # DESCRIPTION:
         | 
| 6 | 
            +
            #   Check Memcached stats
         | 
| 7 | 
            +
            #
         | 
| 8 | 
            +
            # OUTPUT:
         | 
| 9 | 
            +
            #   metric data
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # PLATFORMS:
         | 
| 12 | 
            +
            #   Linux
         | 
| 13 | 
            +
            #
         | 
| 14 | 
            +
            # DEPENDENCIES:
         | 
| 15 | 
            +
            #   gem: sensu-plugin
         | 
| 16 | 
            +
            #   gem: socket
         | 
| 17 | 
            +
            #
         | 
| 18 | 
            +
            # USAGE:
         | 
| 19 | 
            +
            #   #YELLOW
         | 
| 20 | 
            +
            #
         | 
| 21 | 
            +
            # NOTES:
         | 
| 22 | 
            +
            #
         | 
| 23 | 
            +
            # LICENSE:
         | 
| 24 | 
            +
            #   Copyright 2012 AJ Christensen <aj@junglist.gen.nz>
         | 
| 25 | 
            +
            #   Released under the same terms as Sensu (the MIT license); see LICENSE
         | 
| 26 | 
            +
            #   for details.
         | 
| 27 | 
            +
            #
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            require 'sensu-plugin/check/cli'
         | 
| 30 | 
            +
            require 'socket'
         | 
| 31 | 
            +
            require 'timeout'
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            class MemcachedStats < Sensu::Plugin::Check::CLI
         | 
| 34 | 
            +
              option :host,
         | 
| 35 | 
            +
                     short: '-h HOST',
         | 
| 36 | 
            +
                     long: '--host HOST',
         | 
| 37 | 
            +
                     description: 'Memcached Host to connect to',
         | 
| 38 | 
            +
                     required: false,
         | 
| 39 | 
            +
                     default: '127.0.0.1'
         | 
| 40 | 
            +
             | 
| 41 | 
            +
              option :port,
         | 
| 42 | 
            +
                     short: '-p PORT',
         | 
| 43 | 
            +
                     long: '--port PORT',
         | 
| 44 | 
            +
                     description: 'Memcached Port to connect to',
         | 
| 45 | 
            +
                     proc: proc(&:to_i),
         | 
| 46 | 
            +
                     default: 11_211
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              def run
         | 
| 49 | 
            +
                Timeout.timeout(30) do
         | 
| 50 | 
            +
                  TCPSocket.open(config[:host], config[:port]) do |socket|
         | 
| 51 | 
            +
                    socket.print "stats\r\n"
         | 
| 52 | 
            +
                    socket.close_write
         | 
| 53 | 
            +
                    socket.read
         | 
| 54 | 
            +
                  end
         | 
| 55 | 
            +
                end
         | 
| 56 | 
            +
              rescue Timeout::Error
         | 
| 57 | 
            +
                warning "timed out connecting to memcached on port #{config[:port]}"
         | 
| 58 | 
            +
              rescue
         | 
| 59 | 
            +
                critical "Can't connect to port #{config[:port]}"
         | 
| 60 | 
            +
              else
         | 
| 61 | 
            +
                ok 'memcached stats protocol responded in a timely fashion'
         | 
| 62 | 
            +
              end
         | 
| 63 | 
            +
            end
         | 
| @@ -0,0 +1,65 @@ | |
| 1 | 
            +
            #! /usr/bin/env ruby
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            #   memcached-graphite
         | 
| 4 | 
            +
            #
         | 
| 5 | 
            +
            # DESCRIPTION:
         | 
| 6 | 
            +
            #   Push Memcached stats into graphite
         | 
| 7 | 
            +
            #
         | 
| 8 | 
            +
            # OUTPUT:
         | 
| 9 | 
            +
            #   metric data
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # PLATFORMS:
         | 
| 12 | 
            +
            #   Linux
         | 
| 13 | 
            +
            #
         | 
| 14 | 
            +
            # DEPENDENCIES:
         | 
| 15 | 
            +
            #   gem: sensu-plugin
         | 
| 16 | 
            +
            #   gem: memcached
         | 
| 17 | 
            +
            #   gem: socket
         | 
| 18 | 
            +
            #
         | 
| 19 | 
            +
            # USAGE:
         | 
| 20 | 
            +
            #   #YELLOW
         | 
| 21 | 
            +
            #
         | 
| 22 | 
            +
            # NOTES:
         | 
| 23 | 
            +
            #   #YELLOW
         | 
| 24 | 
            +
            #   HitRatio percent and per second calculations
         | 
| 25 | 
            +
            #
         | 
| 26 | 
            +
            # LICENSE:
         | 
| 27 | 
            +
            #   Copyright 2012 Pete Shima <me@peteshima.com>
         | 
| 28 | 
            +
            #   Released under the same terms as Sensu (the MIT license); see LICENSE
         | 
| 29 | 
            +
            #   for details.
         | 
| 30 | 
            +
            #
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            require 'sensu-plugin/metric/cli'
         | 
| 33 | 
            +
            require 'memcached'
         | 
| 34 | 
            +
            require 'socket'
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            class MemcachedGraphite < Sensu::Plugin::Metric::CLI::Graphite
         | 
| 37 | 
            +
              option :host,
         | 
| 38 | 
            +
                     short: '-h HOST',
         | 
| 39 | 
            +
                     long: '--host HOST',
         | 
| 40 | 
            +
                     description: 'Memcached Host to connect to',
         | 
| 41 | 
            +
                     default: 'localhost'
         | 
| 42 | 
            +
             | 
| 43 | 
            +
              option :port,
         | 
| 44 | 
            +
                     short: '-p PORT',
         | 
| 45 | 
            +
                     long: '--port PORT',
         | 
| 46 | 
            +
                     description: 'Memcached Port to connect to',
         | 
| 47 | 
            +
                     proc: proc(&:to_i),
         | 
| 48 | 
            +
                     default: 11_211
         | 
| 49 | 
            +
             | 
| 50 | 
            +
              option :scheme,
         | 
| 51 | 
            +
                     description: 'Metric naming scheme, text to prepend to metric',
         | 
| 52 | 
            +
                     short: '-s SCHEME',
         | 
| 53 | 
            +
                     long: '--scheme SCHEME',
         | 
| 54 | 
            +
                     default: "#{::Socket.gethostname}.memcached"
         | 
| 55 | 
            +
             | 
| 56 | 
            +
              def run
         | 
| 57 | 
            +
                cache = Memcached.new("#{config[:host]}:#{config[:port]}")
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                cache.stats.each do |k, v|
         | 
| 60 | 
            +
                  output "#{config[:scheme]}.#{k}", v
         | 
| 61 | 
            +
                end
         | 
| 62 | 
            +
             | 
| 63 | 
            +
                ok
         | 
| 64 | 
            +
              end
         | 
| 65 | 
            +
            end
         | 
| @@ -0,0 +1,85 @@ | |
| 1 | 
            +
            #! /usr/bin/env ruby
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            #   memcached-key-stats-graphite
         | 
| 4 | 
            +
            #
         | 
| 5 | 
            +
            # DESCRIPTION:
         | 
| 6 | 
            +
            #   Get memcached per key detailed get, set, and del operation metrics
         | 
| 7 | 
            +
            #
         | 
| 8 | 
            +
            # OUTPUT:
         | 
| 9 | 
            +
            #   metric data
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # PLATFORMS:
         | 
| 12 | 
            +
            #   Linux, Windows, BSD, Solaris, etc
         | 
| 13 | 
            +
            #
         | 
| 14 | 
            +
            # DEPENDENCIES:
         | 
| 15 | 
            +
            #   gem: sensu-plugin
         | 
| 16 | 
            +
            #   gem: <?>
         | 
| 17 | 
            +
            #
         | 
| 18 | 
            +
            # USAGE:
         | 
| 19 | 
            +
            #   #YELLOW
         | 
| 20 | 
            +
            #
         | 
| 21 | 
            +
            # NOTES:
         | 
| 22 | 
            +
            #
         | 
| 23 | 
            +
            # LICENSE:
         | 
| 24 | 
            +
            #   Copyright 2013 Piavlo <lolitushka@gmail.com>
         | 
| 25 | 
            +
            #   Released under the same terms as Sensu (the MIT license); see LICENSE
         | 
| 26 | 
            +
            #   for details.
         | 
| 27 | 
            +
            #
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            require 'sensu-plugin/metric/cli'
         | 
| 30 | 
            +
            require 'socket'
         | 
| 31 | 
            +
            require 'timeout'
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            class MemcachedKeyStatsGraphite < Sensu::Plugin::Metric::CLI::Graphite
         | 
| 34 | 
            +
              option :host,
         | 
| 35 | 
            +
                     short: '-h HOST',
         | 
| 36 | 
            +
                     long: '--host HOST',
         | 
| 37 | 
            +
                     description: 'Memcached Host to connect to',
         | 
| 38 | 
            +
                     default: 'localhost'
         | 
| 39 | 
            +
             | 
| 40 | 
            +
              option :port,
         | 
| 41 | 
            +
                     short: '-p PORT',
         | 
| 42 | 
            +
                     long: '--port PORT',
         | 
| 43 | 
            +
                     description: 'Memcached Port to connect to',
         | 
| 44 | 
            +
                     proc: proc(&:to_i),
         | 
| 45 | 
            +
                     default: 11_211
         | 
| 46 | 
            +
             | 
| 47 | 
            +
              option :scheme,
         | 
| 48 | 
            +
                     description: 'Metric naming scheme, text to prepend to metric',
         | 
| 49 | 
            +
                     short: '-s SCHEME',
         | 
| 50 | 
            +
                     long: '--scheme SCHEME',
         | 
| 51 | 
            +
                     default: "#{::Socket.gethostname}.memcached"
         | 
| 52 | 
            +
             | 
| 53 | 
            +
              option :timeout,
         | 
| 54 | 
            +
                     description: 'Timeout in seconds to complete the operation',
         | 
| 55 | 
            +
                     short: '-t SECONDS',
         | 
| 56 | 
            +
                     long: '--timeout SECONDS',
         | 
| 57 | 
            +
                     proc: proc(&:to_i),
         | 
| 58 | 
            +
                     default: 5
         | 
| 59 | 
            +
             | 
| 60 | 
            +
              def run
         | 
| 61 | 
            +
                Timeout.timeout(config[:timeout]) do
         | 
| 62 | 
            +
                  TCPSocket.open("#{config[:host]}", "#{config[:port]}") do |socket|
         | 
| 63 | 
            +
                    socket.print "stats detail dump\r\n"
         | 
| 64 | 
            +
                    socket.close_write
         | 
| 65 | 
            +
                    recv = socket.read
         | 
| 66 | 
            +
                    # #YELLOW
         | 
| 67 | 
            +
                    recv.each_line do |line| # rubocop:disable Style/Next
         | 
| 68 | 
            +
                      if line.match('PREFIX')
         | 
| 69 | 
            +
                        _, key, _, get, _, hit, _, set, _, del = line.split(' ', -1)
         | 
| 70 | 
            +
                        output "#{config[:scheme]}.#{key}.get", get.to_i
         | 
| 71 | 
            +
                        output "#{config[:scheme]}.#{key}.hit", hit.to_i
         | 
| 72 | 
            +
                        output "#{config[:scheme]}.#{key}.set", set.to_i
         | 
| 73 | 
            +
                        output "#{config[:scheme]}.#{key}.del", del.to_i
         | 
| 74 | 
            +
                      end
         | 
| 75 | 
            +
                    end
         | 
| 76 | 
            +
                  end
         | 
| 77 | 
            +
                end
         | 
| 78 | 
            +
                ok
         | 
| 79 | 
            +
              rescue Timeout::Error
         | 
| 80 | 
            +
                puts "timed out gettings stats from memcached on port #{config[:port]}"
         | 
| 81 | 
            +
              rescue
         | 
| 82 | 
            +
                puts "Can't connect to port #{config[:port]}"
         | 
| 83 | 
            +
                exit(1)
         | 
| 84 | 
            +
              end
         | 
| 85 | 
            +
            end
         | 
| @@ -0,0 +1,125 @@ | |
| 1 | 
            +
            #! /usr/bin/env ruby
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            #   memcached-socket-graphite
         | 
| 4 | 
            +
            #
         | 
| 5 | 
            +
            # DESCRIPTION:
         | 
| 6 | 
            +
            #   This plugin uses socket rather than memcached gem or ruby package.
         | 
| 7 | 
            +
            #
         | 
| 8 | 
            +
            # OUTPUT:
         | 
| 9 | 
            +
            #   metric data
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # PLATFORMS:
         | 
| 12 | 
            +
            #   Linux
         | 
| 13 | 
            +
            #
         | 
| 14 | 
            +
            # DEPENDENCIES:
         | 
| 15 | 
            +
            #   gem: sensu-plugin
         | 
| 16 | 
            +
            #   gem: socket
         | 
| 17 | 
            +
            #
         | 
| 18 | 
            +
            # USAGE:
         | 
| 19 | 
            +
            #  #YELLOW
         | 
| 20 | 
            +
            #
         | 
| 21 | 
            +
            # NOTES:
         | 
| 22 | 
            +
            #
         | 
| 23 | 
            +
            # LICENSE:
         | 
| 24 | 
            +
            #   Copyright 2013 github.com/foomatty
         | 
| 25 | 
            +
            #   Released under the same terms as Sensu (the MIT license); see LICENSE
         | 
| 26 | 
            +
            #   for details.
         | 
| 27 | 
            +
            #
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            require 'sensu-plugin/metric/cli'
         | 
| 30 | 
            +
            require 'socket'
         | 
| 31 | 
            +
            require 'timeout'
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            class MemcachedGraphite < Sensu::Plugin::Metric::CLI::Graphite
         | 
| 34 | 
            +
              option :host,
         | 
| 35 | 
            +
                     short: '-h HOST',
         | 
| 36 | 
            +
                     long: '--host HOST',
         | 
| 37 | 
            +
                     description: 'Memcached Host to connect to',
         | 
| 38 | 
            +
                     default: 'localhost'
         | 
| 39 | 
            +
             | 
| 40 | 
            +
              option :port,
         | 
| 41 | 
            +
                     short: '-p PORT',
         | 
| 42 | 
            +
                     long: '--port PORT',
         | 
| 43 | 
            +
                     description: 'Memcached Port to connect to',
         | 
| 44 | 
            +
                     proc: proc(&:to_i),
         | 
| 45 | 
            +
                     default: 11_211
         | 
| 46 | 
            +
             | 
| 47 | 
            +
              option :scheme,
         | 
| 48 | 
            +
                     description: 'Metric naming scheme, text to prepend to metric',
         | 
| 49 | 
            +
                     short: '-s SCHEME',
         | 
| 50 | 
            +
                     long: '--scheme SCHEME',
         | 
| 51 | 
            +
                     default: "#{::Socket.gethostname}.memcached"
         | 
| 52 | 
            +
              def run
         | 
| 53 | 
            +
                stats = {}
         | 
| 54 | 
            +
                metrics = {}
         | 
| 55 | 
            +
                Timeout.timeout(30) do
         | 
| 56 | 
            +
                  TCPSocket.open("#{config[:host]}", "#{config[:port]}") do |socket|
         | 
| 57 | 
            +
                    socket.print "stats\r\n"
         | 
| 58 | 
            +
                    socket.close_write
         | 
| 59 | 
            +
                    recv = socket.read
         | 
| 60 | 
            +
                    recv.each_line do |line|
         | 
| 61 | 
            +
                      stats[line.split(' ')[1]] = line.split(' ')[2] if line.match('STAT')
         | 
| 62 | 
            +
                    end
         | 
| 63 | 
            +
                    metrics.update(sort_metrics(stats))
         | 
| 64 | 
            +
                    metrics.each do |k, v|
         | 
| 65 | 
            +
                      output "#{config[:scheme]}.#{k}", v
         | 
| 66 | 
            +
                    end
         | 
| 67 | 
            +
                  end
         | 
| 68 | 
            +
                end
         | 
| 69 | 
            +
                ok
         | 
| 70 | 
            +
              rescue Timeout::Error
         | 
| 71 | 
            +
                puts "timed out connecting to memcached on port #{config[:port]}"
         | 
| 72 | 
            +
              rescue
         | 
| 73 | 
            +
                puts "Can't connect to port #{config[:port]}"
         | 
| 74 | 
            +
                exit(1)
         | 
| 75 | 
            +
              end
         | 
| 76 | 
            +
             | 
| 77 | 
            +
              def sort_metrics(stats) # rubocop:disable all
         | 
| 78 | 
            +
                memcached_metrics = {}
         | 
| 79 | 
            +
                memcached_metrics['uptime'] = stats['uptime'].to_i
         | 
| 80 | 
            +
                memcached_metrics['pointer_size'] = stats['pointer_size'].to_i
         | 
| 81 | 
            +
                memcached_metrics['rusage_user'] = stats['rusage_user'].to_i
         | 
| 82 | 
            +
                memcached_metrics['rusage_system'] = stats['rusage_system'].to_i
         | 
| 83 | 
            +
                memcached_metrics['curr_connections'] = stats['curr_connections'].to_i
         | 
| 84 | 
            +
                memcached_metrics['total_connections'] = stats['total_connections'].to_i
         | 
| 85 | 
            +
                memcached_metrics['connection_structures'] = stats['connection_structures'].to_i
         | 
| 86 | 
            +
                memcached_metrics['reserved_fds'] = stats['reserved_fds'].to_i
         | 
| 87 | 
            +
                memcached_metrics['cmd_get'] = stats['cmd_get'].to_i
         | 
| 88 | 
            +
                memcached_metrics['cmd_set'] = stats['cmd_set'].to_i
         | 
| 89 | 
            +
                memcached_metrics['cmd_flush'] = stats['cmd_flush'].to_i
         | 
| 90 | 
            +
                memcached_metrics['cmd_touch'] = stats['cmd_touch'].to_i
         | 
| 91 | 
            +
                memcached_metrics['get_hits'] = stats['get_hits'].to_i
         | 
| 92 | 
            +
                memcached_metrics['get_misses'] = stats['get_misses'].to_i
         | 
| 93 | 
            +
                memcached_metrics['delete_misses'] = stats['delete_misses'].to_i
         | 
| 94 | 
            +
                memcached_metrics['delete_hits'] = stats['delete_hits'].to_i
         | 
| 95 | 
            +
                memcached_metrics['incr_misses'] = stats['incr_misses'].to_i
         | 
| 96 | 
            +
                memcached_metrics['incr_hits'] = stats['incr_hits'].to_i
         | 
| 97 | 
            +
                memcached_metrics['decr_misses'] = stats['decr_misses'].to_i
         | 
| 98 | 
            +
                memcached_metrics['decr_hits'] = stats['decr_hits'].to_i
         | 
| 99 | 
            +
                memcached_metrics['cas_misses'] = stats['cas_misses'].to_i
         | 
| 100 | 
            +
                memcached_metrics['cas_hits'] = stats['cas_hits'].to_i
         | 
| 101 | 
            +
                memcached_metrics['cas_badval'] = stats['cas_badval'].to_i
         | 
| 102 | 
            +
                memcached_metrics['touch_hits'] = stats['touch_hits'].to_i
         | 
| 103 | 
            +
                memcached_metrics['touch_misses'] = stats['touch_misses'].to_i
         | 
| 104 | 
            +
                memcached_metrics['auth_cmds'] = stats['auth_cmds'].to_i
         | 
| 105 | 
            +
                memcached_metrics['auth_errors'] = stats['auth_errors'].to_i
         | 
| 106 | 
            +
                memcached_metrics['bytes_read'] = stats['bytes_read'].to_i
         | 
| 107 | 
            +
                memcached_metrics['bytes_written'] = stats['bytes_written'].to_i
         | 
| 108 | 
            +
                memcached_metrics['limit_maxbytes'] = stats['limit_maxbytes'].to_i
         | 
| 109 | 
            +
                memcached_metrics['accepting_conns'] = stats['accepting_conns'].to_i
         | 
| 110 | 
            +
                memcached_metrics['listen_disabled_num'] = stats['listen_disabled_num'].to_i
         | 
| 111 | 
            +
                memcached_metrics['threads'] = stats['threads'].to_i
         | 
| 112 | 
            +
                memcached_metrics['conn_yields'] = stats['conn_yields'].to_i
         | 
| 113 | 
            +
                memcached_metrics['hash_power_level'] = stats['hash_power_level'].to_i
         | 
| 114 | 
            +
                memcached_metrics['hash_bytes'] = stats['hash_bytes'].to_i
         | 
| 115 | 
            +
                memcached_metrics['hash_is_expanding'] = stats['hash_is_expanding'].to_i
         | 
| 116 | 
            +
                memcached_metrics['expired_unfetched'] = stats['expired_unfetched'].to_i
         | 
| 117 | 
            +
                memcached_metrics['evicted_unfetched'] = stats['evicted_unfetched'].to_i
         | 
| 118 | 
            +
                memcached_metrics['bytes'] = stats['bytes'].to_i
         | 
| 119 | 
            +
                memcached_metrics['curr_items'] = stats['curr_items'].to_i
         | 
| 120 | 
            +
                memcached_metrics['total_items'] = stats['total_items'].to_i
         | 
| 121 | 
            +
                memcached_metrics['evictions'] = stats['evictions'].to_i
         | 
| 122 | 
            +
                memcached_metrics['reclaimed'] = stats['reclaimed'].to_i
         | 
| 123 | 
            +
                memcached_metrics
         | 
| 124 | 
            +
              end
         | 
| 125 | 
            +
            end
         | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            require 'sensu-plugins-memcached/version'
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,238 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: sensu-plugins-memcached
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Sensu Plugins and contributors
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain:
         | 
| 11 | 
            +
            - |
         | 
| 12 | 
            +
              -----BEGIN CERTIFICATE-----
         | 
| 13 | 
            +
              MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRIwEAYDVQQDDAltYXR0
         | 
| 14 | 
            +
              am9uZXMxGDAWBgoJkiaJk/IsZAEZFgh5aWVsZGJvdDETMBEGCgmSJomT8ixkARkW
         | 
| 15 | 
            +
              A2NvbTAeFw0xNTAxMjgyMTAyNTFaFw0xNjAxMjgyMTAyNTFaMEMxEjAQBgNVBAMM
         | 
| 16 | 
            +
              CW1hdHRqb25lczEYMBYGCgmSJomT8ixkARkWCHlpZWxkYm90MRMwEQYKCZImiZPy
         | 
| 17 | 
            +
              LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyTSzVYnO
         | 
| 18 | 
            +
              CLgyrIyT1mBQakArQyW8xhi6MlDqyzXHJGeERT790U6EgoBVeS4XoK0ptFZNR8Tf
         | 
| 19 | 
            +
              zko0w+Nv47TarSCgkPOaxY+mxWnAVR10dOmfeLr7huiMyps+YD56/EF2FqQ3jf/+
         | 
| 20 | 
            +
              qohENfKD91qy1ieEy+Fn7Pf74ltbNKUdkb9a9eFXQ0DQ4ip5vik7DzjQkUTj4lca
         | 
| 21 | 
            +
              k6ArwnmHX4YDhZoYtrQJ8jVktN0/+NtA40M5qkCYHNe5tUW25b/tKVYuioxG6b2Z
         | 
| 22 | 
            +
              oIzaZxRLxf6HVAWpCVRT/F5+/yjigkX4u++eYacfLGleXQzoK7BL65vHGMJygWEE
         | 
| 23 | 
            +
              0TKGqFOrl/L0AQIDAQABo38wfTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
         | 
| 24 | 
            +
              HQ4EFgQUEf6a8Td7MrSZc8ImbLFZAENPbz0wIQYDVR0RBBowGIEWbWF0dGpvbmVz
         | 
| 25 | 
            +
              QHlpZWxkYm90LmNvbTAhBgNVHRIEGjAYgRZtYXR0am9uZXNAeWllbGRib3QuY29t
         | 
| 26 | 
            +
              MA0GCSqGSIb3DQEBBQUAA4IBAQBbzXAYA3BVGw8DZ0YYoY1VHPNEcH5qPIApmHO8
         | 
| 27 | 
            +
              rvSmuUT0yMEi7u00H/5uHRFf4LleGT/+sTdyXKsNPGT9kdRuQEgwi+vf7Zfvd8aX
         | 
| 28 | 
            +
              UF/+4VkEYf/8rV8Ere6u2QaWPgApdMV6JjKr1fAwCTd8AuGXNaWItiPPMseSQzLJ
         | 
| 29 | 
            +
              JKP4hVvbc1d+oS925B1lcBiqn2aYvElbyNAVmQPywNNqkWmvtlqj9ZVJfV5HQLdu
         | 
| 30 | 
            +
              8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
         | 
| 31 | 
            +
              HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
         | 
| 32 | 
            +
              -----END CERTIFICATE-----
         | 
| 33 | 
            +
            date: 2015-06-03 00:00:00.000000000 Z
         | 
| 34 | 
            +
            dependencies:
         | 
| 35 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 36 | 
            +
              name: sensu-plugin
         | 
| 37 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 38 | 
            +
                requirements:
         | 
| 39 | 
            +
                - - '='
         | 
| 40 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 41 | 
            +
                    version: 1.1.0
         | 
| 42 | 
            +
              type: :runtime
         | 
| 43 | 
            +
              prerelease: false
         | 
| 44 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 45 | 
            +
                requirements:
         | 
| 46 | 
            +
                - - '='
         | 
| 47 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 48 | 
            +
                    version: 1.1.0
         | 
| 49 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 50 | 
            +
              name: memcached
         | 
| 51 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 52 | 
            +
                requirements:
         | 
| 53 | 
            +
                - - '='
         | 
| 54 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 55 | 
            +
                    version: 1.8.0
         | 
| 56 | 
            +
              type: :runtime
         | 
| 57 | 
            +
              prerelease: false
         | 
| 58 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 59 | 
            +
                requirements:
         | 
| 60 | 
            +
                - - '='
         | 
| 61 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 62 | 
            +
                    version: 1.8.0
         | 
| 63 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 64 | 
            +
              name: codeclimate-test-reporter
         | 
| 65 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 66 | 
            +
                requirements:
         | 
| 67 | 
            +
                - - "~>"
         | 
| 68 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 69 | 
            +
                    version: '0.4'
         | 
| 70 | 
            +
              type: :development
         | 
| 71 | 
            +
              prerelease: false
         | 
| 72 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 73 | 
            +
                requirements:
         | 
| 74 | 
            +
                - - "~>"
         | 
| 75 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 76 | 
            +
                    version: '0.4'
         | 
| 77 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 78 | 
            +
              name: rubocop
         | 
| 79 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 80 | 
            +
                requirements:
         | 
| 81 | 
            +
                - - "~>"
         | 
| 82 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 83 | 
            +
                    version: '0.30'
         | 
| 84 | 
            +
              type: :development
         | 
| 85 | 
            +
              prerelease: false
         | 
| 86 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 87 | 
            +
                requirements:
         | 
| 88 | 
            +
                - - "~>"
         | 
| 89 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 90 | 
            +
                    version: '0.30'
         | 
| 91 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 92 | 
            +
              name: rspec
         | 
| 93 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 94 | 
            +
                requirements:
         | 
| 95 | 
            +
                - - "~>"
         | 
| 96 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 97 | 
            +
                    version: '3.1'
         | 
| 98 | 
            +
              type: :development
         | 
| 99 | 
            +
              prerelease: false
         | 
| 100 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 101 | 
            +
                requirements:
         | 
| 102 | 
            +
                - - "~>"
         | 
| 103 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 104 | 
            +
                    version: '3.1'
         | 
| 105 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 106 | 
            +
              name: bundler
         | 
| 107 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 108 | 
            +
                requirements:
         | 
| 109 | 
            +
                - - "~>"
         | 
| 110 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 111 | 
            +
                    version: '1.7'
         | 
| 112 | 
            +
              type: :development
         | 
| 113 | 
            +
              prerelease: false
         | 
| 114 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 115 | 
            +
                requirements:
         | 
| 116 | 
            +
                - - "~>"
         | 
| 117 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 118 | 
            +
                    version: '1.7'
         | 
| 119 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 120 | 
            +
              name: rake
         | 
| 121 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 122 | 
            +
                requirements:
         | 
| 123 | 
            +
                - - "~>"
         | 
| 124 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 125 | 
            +
                    version: '10.0'
         | 
| 126 | 
            +
              type: :development
         | 
| 127 | 
            +
              prerelease: false
         | 
| 128 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 129 | 
            +
                requirements:
         | 
| 130 | 
            +
                - - "~>"
         | 
| 131 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 132 | 
            +
                    version: '10.0'
         | 
| 133 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 134 | 
            +
              name: github-markup
         | 
| 135 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 136 | 
            +
                requirements:
         | 
| 137 | 
            +
                - - "~>"
         | 
| 138 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 139 | 
            +
                    version: '1.3'
         | 
| 140 | 
            +
              type: :development
         | 
| 141 | 
            +
              prerelease: false
         | 
| 142 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 143 | 
            +
                requirements:
         | 
| 144 | 
            +
                - - "~>"
         | 
| 145 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 146 | 
            +
                    version: '1.3'
         | 
| 147 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 148 | 
            +
              name: redcarpet
         | 
| 149 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 150 | 
            +
                requirements:
         | 
| 151 | 
            +
                - - "~>"
         | 
| 152 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 153 | 
            +
                    version: '3.2'
         | 
| 154 | 
            +
              type: :development
         | 
| 155 | 
            +
              prerelease: false
         | 
| 156 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 157 | 
            +
                requirements:
         | 
| 158 | 
            +
                - - "~>"
         | 
| 159 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 160 | 
            +
                    version: '3.2'
         | 
| 161 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 162 | 
            +
              name: yard
         | 
| 163 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 164 | 
            +
                requirements:
         | 
| 165 | 
            +
                - - "~>"
         | 
| 166 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 167 | 
            +
                    version: '0.8'
         | 
| 168 | 
            +
              type: :development
         | 
| 169 | 
            +
              prerelease: false
         | 
| 170 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 171 | 
            +
                requirements:
         | 
| 172 | 
            +
                - - "~>"
         | 
| 173 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 174 | 
            +
                    version: '0.8'
         | 
| 175 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 176 | 
            +
              name: pry
         | 
| 177 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 178 | 
            +
                requirements:
         | 
| 179 | 
            +
                - - "~>"
         | 
| 180 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 181 | 
            +
                    version: '0.10'
         | 
| 182 | 
            +
              type: :development
         | 
| 183 | 
            +
              prerelease: false
         | 
| 184 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 185 | 
            +
                requirements:
         | 
| 186 | 
            +
                - - "~>"
         | 
| 187 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 188 | 
            +
                    version: '0.10'
         | 
| 189 | 
            +
            description: Sensu plugins for memcached
         | 
| 190 | 
            +
            email: "<sensu-users@googlegroups.com>"
         | 
| 191 | 
            +
            executables:
         | 
| 192 | 
            +
            - metrics-memcached-socket-graphite.rb
         | 
| 193 | 
            +
            - metrics-memcached-key-stats-graphite.rb
         | 
| 194 | 
            +
            - metrics-memcached-graphite.rb
         | 
| 195 | 
            +
            - check-memcached-stats.rb
         | 
| 196 | 
            +
            extensions: []
         | 
| 197 | 
            +
            extra_rdoc_files: []
         | 
| 198 | 
            +
            files:
         | 
| 199 | 
            +
            - CHANGELOG.md
         | 
| 200 | 
            +
            - LICENSE
         | 
| 201 | 
            +
            - README.md
         | 
| 202 | 
            +
            - bin/check-memcached-stats.rb
         | 
| 203 | 
            +
            - bin/metrics-memcached-graphite.rb
         | 
| 204 | 
            +
            - bin/metrics-memcached-key-stats-graphite.rb
         | 
| 205 | 
            +
            - bin/metrics-memcached-socket-graphite.rb
         | 
| 206 | 
            +
            - lib/sensu-plugins-memcached.rb
         | 
| 207 | 
            +
            - lib/sensu-plugins-memcached/version.rb
         | 
| 208 | 
            +
            homepage: https://github.com/sensu-plugins/sensu-plugins-memcached
         | 
| 209 | 
            +
            licenses:
         | 
| 210 | 
            +
            - MIT
         | 
| 211 | 
            +
            metadata:
         | 
| 212 | 
            +
              maintainer: sensu-plugin
         | 
| 213 | 
            +
              development_status: active
         | 
| 214 | 
            +
              production_status: unstable - testing recommended
         | 
| 215 | 
            +
              release_draft: 'false'
         | 
| 216 | 
            +
              release_prerelease: 'false'
         | 
| 217 | 
            +
            post_install_message: You can use the embedded Ruby by setting EMBEDDED_RUBY=true
         | 
| 218 | 
            +
              in /etc/default/sensu
         | 
| 219 | 
            +
            rdoc_options: []
         | 
| 220 | 
            +
            require_paths:
         | 
| 221 | 
            +
            - lib
         | 
| 222 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 223 | 
            +
              requirements:
         | 
| 224 | 
            +
              - - ">="
         | 
| 225 | 
            +
                - !ruby/object:Gem::Version
         | 
| 226 | 
            +
                  version: 1.9.3
         | 
| 227 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 228 | 
            +
              requirements:
         | 
| 229 | 
            +
              - - ">="
         | 
| 230 | 
            +
                - !ruby/object:Gem::Version
         | 
| 231 | 
            +
                  version: '0'
         | 
| 232 | 
            +
            requirements: []
         | 
| 233 | 
            +
            rubyforge_project: 
         | 
| 234 | 
            +
            rubygems_version: 2.4.6
         | 
| 235 | 
            +
            signing_key: 
         | 
| 236 | 
            +
            specification_version: 4
         | 
| 237 | 
            +
            summary: Sensu plugins for memcached
         | 
| 238 | 
            +
            test_files: []
         | 
    
        metadata.gz.sig
    ADDED
    
    | Binary file |