Class: ForemanGraphite::Client
- Inherits:
-
Object
- Object
- ForemanGraphite::Client
- Defined in:
- lib/foreman_graphite/client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #fqdn ⇒ Object
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 9 10 11 |
# File 'lib/foreman_graphite/client.rb', line 4 def initialize(opts = {}) GraphiteAPI::Logger.logger = opts[:logger] if opts[:logger] @client = GraphiteAPI.new( :graphite => (opts[:server] || "0.0.0.0:2003"), # required argument :prefix => ['theforeman', fqdn] ) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
2 3 4 |
# File 'lib/foreman_graphite/client.rb', line 2 def client @client end |
Instance Method Details
#fqdn ⇒ Object
13 14 15 |
# File 'lib/foreman_graphite/client.rb', line 13 def fqdn @fqdn ||= (Facter.value(:fqdn) || SETTINGS[:fqdn]).tr(".", "-") end |