Merge "Adding another set of hardware metrics"
This commit is contained in:
commit
c401f3496a
@ -66,6 +66,8 @@ class SNMPInspector(base.Inspector):
|
||||
# Memory OIDs
|
||||
_memory_total_oid = "1.3.6.1.4.1.2021.4.5.0"
|
||||
_memory_used_oid = "1.3.6.1.4.1.2021.4.6.0"
|
||||
_memory_total_swap_oid = "1.3.6.1.4.1.2021.4.3.0"
|
||||
_memory_avail_swap_oid = "1.3.6.1.4.1.2021.4.4.0"
|
||||
# Disk OIDs
|
||||
_disk_index_oid = "1.3.6.1.4.1.2021.9.1.1"
|
||||
_disk_path_oid = "1.3.6.1.4.1.2021.9.1.2"
|
||||
@ -81,6 +83,13 @@ class SNMPInspector(base.Inspector):
|
||||
_interface_received_oid = "1.3.6.1.2.1.2.2.1.10"
|
||||
_interface_transmitted_oid = "1.3.6.1.2.1.2.2.1.16"
|
||||
_interface_error_oid = "1.3.6.1.2.1.2.2.1.20"
|
||||
# System stats
|
||||
_system_stats_cpu_idle_oid = "1.3.6.1.4.1.2021.11.11.0"
|
||||
_system_stats_io_raw_sent_oid = "1.3.6.1.4.1.2021.11.57.0"
|
||||
_system_stats_io_raw_received_oid = "1.3.6.1.4.1.2021.11.58.0"
|
||||
# Network stats
|
||||
_network_ip_out_requests_oid = "1.3.6.1.2.1.4.10.0"
|
||||
_network_ip_in_receives_oid = "1.3.6.1.2.1.4.3.0"
|
||||
# Default port
|
||||
_port = 161
|
||||
|
||||
@ -186,6 +195,18 @@ class SNMPInspector(base.Inspector):
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
'memory.swap.total': {
|
||||
'matching_type': EXACT,
|
||||
'metric_oid': (_memory_total_swap_oid, int),
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
'memory.swap.avail': {
|
||||
'matching_type': EXACT,
|
||||
'metric_oid': (_memory_avail_swap_oid, int),
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
'disk.size.total': {
|
||||
'matching_type': PREFIX,
|
||||
'metric_oid': (_disk_size_oid, int),
|
||||
@ -216,6 +237,36 @@ class SNMPInspector(base.Inspector):
|
||||
'metadata': _net_metadata,
|
||||
'post_op': "_post_op_net",
|
||||
},
|
||||
'network.ip.outgoing.datagrams': {
|
||||
'matching_type': EXACT,
|
||||
'metric_oid': (_network_ip_out_requests_oid, int),
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
'network.ip.incoming.datagrams': {
|
||||
'matching_type': EXACT,
|
||||
'metric_oid': (_network_ip_in_receives_oid, int),
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
'system_stats.cpu.idle': {
|
||||
'matching_type': EXACT,
|
||||
'metric_oid': (_system_stats_cpu_idle_oid, int),
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
'system_stats.io.outgoing.blocks': {
|
||||
'matching_type': EXACT,
|
||||
'metric_oid': (_system_stats_io_raw_sent_oid, int),
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
'system_stats.io.incoming.blocks': {
|
||||
'matching_type': EXACT,
|
||||
'metric_oid': (_system_stats_io_raw_received_oid, int),
|
||||
'metadata': {},
|
||||
'post_op': None,
|
||||
},
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
|
@ -44,3 +44,11 @@ class MemoryTotalPollster(_Base):
|
||||
|
||||
class MemoryUsedPollster(_Base):
|
||||
IDENTIFIER = 'memory.used'
|
||||
|
||||
|
||||
class MemorySwapTotalPollster(_Base):
|
||||
IDENTIFIER = 'memory.swap.total'
|
||||
|
||||
|
||||
class MemorySwapAvailPollster(_Base):
|
||||
IDENTIFIER = 'memory.swap.avail'
|
||||
|
38
ceilometer/hardware/pollsters/network_aggregated.py
Normal file
38
ceilometer/hardware/pollsters/network_aggregated.py
Normal file
@ -0,0 +1,38 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ceilometer.hardware import plugin
|
||||
from ceilometer.hardware.pollsters import util
|
||||
from ceilometer import sample
|
||||
|
||||
|
||||
class _Base(plugin.HardwarePollster):
|
||||
|
||||
CACHE_KEY = 'network'
|
||||
|
||||
def generate_one_sample(self, host, c_data):
|
||||
value, metadata, extra = c_data
|
||||
return util.make_sample_from_host(host,
|
||||
name=self.IDENTIFIER,
|
||||
sample_type=sample.TYPE_CUMULATIVE,
|
||||
unit='datagrams',
|
||||
volume=value,
|
||||
res_metadata=metadata,
|
||||
extra=extra)
|
||||
|
||||
|
||||
class NetworkAggregatedIPOutRequests(_Base):
|
||||
IDENTIFIER = 'network.ip.outgoing.datagrams'
|
||||
|
||||
|
||||
class NetworkAggregatedIPInReceives(_Base):
|
||||
IDENTIFIER = 'network.ip.incoming.datagrams'
|
50
ceilometer/hardware/pollsters/system.py
Normal file
50
ceilometer/hardware/pollsters/system.py
Normal file
@ -0,0 +1,50 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ceilometer.hardware import plugin
|
||||
from ceilometer.hardware.pollsters import util
|
||||
from ceilometer import sample
|
||||
|
||||
|
||||
class _Base(plugin.HardwarePollster):
|
||||
|
||||
CACHE_KEY = 'system'
|
||||
|
||||
|
||||
class _SystemBase(_Base):
|
||||
def generate_one_sample(self, host, c_data):
|
||||
value, metadata, extra = c_data
|
||||
return util.make_sample_from_host(host,
|
||||
name=self.IDENTIFIER,
|
||||
sample_type=self.TYPE,
|
||||
unit=self.UNIT,
|
||||
volume=value,
|
||||
res_metadata=metadata,
|
||||
extra=extra)
|
||||
|
||||
|
||||
class SystemCpuIdlePollster(_SystemBase):
|
||||
IDENTIFIER = 'system_stats.cpu.idle'
|
||||
TYPE = sample.TYPE_GAUGE
|
||||
UNIT = '%'
|
||||
|
||||
|
||||
class SystemIORawSentPollster(_SystemBase):
|
||||
IDENTIFIER = 'system_stats.io.outgoing.blocks'
|
||||
TYPE = sample.TYPE_CUMULATIVE,
|
||||
UNIT = 'blocks'
|
||||
|
||||
|
||||
class SystemIORawReceivedPollster(_SystemBase):
|
||||
IDENTIFIER = 'system_stats.io.incoming.blocks'
|
||||
TYPE = sample.TYPE_CUMULATIVE,
|
||||
UNIT = 'blocks'
|
@ -164,6 +164,13 @@ ceilometer.poll.central =
|
||||
hardware.network.outgoing.errors = ceilometer.hardware.pollsters.net:OutgoingErrorsPollster
|
||||
hardware.memory.total = ceilometer.hardware.pollsters.memory:MemoryTotalPollster
|
||||
hardware.memory.used = ceilometer.hardware.pollsters.memory:MemoryUsedPollster
|
||||
hardware.memory.swap.total = ceilometer.hardware.pollsters.memory:MemorySwapTotalPollster
|
||||
hardware.memory.swap.avail = ceilometer.hardware.pollsters.memory:MemorySwapAvailPollster
|
||||
hardware.system_stats.cpu.idle = ceilometer.hardware.pollsters.system:SystemCpuIdlePollster
|
||||
hardware.system_stats.io.outgoing.blocks = ceilometer.hardware.pollsters.system:SystemIORawSentPollster
|
||||
hardware.system_stats.io.incoming.blocks = ceilometer.hardware.pollsters.system:SystemIORawReceivedPollster
|
||||
hardware.network.ip.outgoing.datagrams = ceilometer.hardware.pollsters.network_aggregated:NetworkAggregatedIPOutRequests
|
||||
hardware.network.ip.incoming.datagrams = ceilometer.hardware.pollsters.network_aggregated:NetworkAggregatedIPInReceives
|
||||
network.services.lb.pool = ceilometer.network.services.lbaas:LBPoolPollster
|
||||
network.services.lb.vip = ceilometer.network.services.lbaas:LBVipPollster
|
||||
network.services.lb.member = ceilometer.network.services.lbaas:LBMemberPollster
|
||||
|
Loading…
x
Reference in New Issue
Block a user