lib/arborist/snmp.rb
author Mahlon E. Smith <mahlon@martini.nu>
Sat, 01 Aug 2020 14:17:50 -0700
changeset 30 4fe00f5f71d9
parent 29 40bcd1565627
permissions -rw-r--r--
Added tag v0.7.0 for changeset 40bcd1565627
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     1
# -*- ruby -*-
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     2
#encoding: utf-8
29
40bcd1565627 Alterations for consistency, add documentation. Version bump.
Mahlon E. Smith <mahlon@martini.nu>
parents: 26
diff changeset
     3
# vim: set noet nosta sw=4 ts=4 :
8
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     4
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     5
require 'loggability'
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     6
require 'arborist'
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     7
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     8
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     9
# Various monitoring checks using SNMP, for the Arborist monitoring toolkit.
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    10
module Arborist::SNMP
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    11
	extend Loggability
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    12
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    13
	# Loggability API -- set up a log host for this library
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    14
	log_as :arborist_snmp
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    15
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    16
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    17
	# Package version
29
40bcd1565627 Alterations for consistency, add documentation. Version bump.
Mahlon E. Smith <mahlon@martini.nu>
parents: 26
diff changeset
    18
	VERSION = '0.7.0'
8
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    19
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    20
	# Version control revision
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    21
	REVISION = %q$Revision$
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    22
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    23
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    24
	### Return the name of the library with the version, and optionally the build ID if
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    25
	### +include_build+ is true.
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    26
	def self::version_string( include_build: false )
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    27
		str = "%p v%s" % [ self, VERSION ]
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    28
		str << ' (' << REVISION.strip << ')' if include_build
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    29
		return str
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    30
	end
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    31
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    32
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    33
	require 'arborist/monitor/snmp'
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    34
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    35
end # module Arborist::SNMP
e0b7c95a154f Refactor for real world usage and latest Arborist behaviors.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    36