Commit Graph

31 Commits

Author SHA1 Message Date
Kevin Carter 034228e754
Update monitorstack to use updated openstacksdk and es
This change updates the functions so that they work with the most up to date
OpenStack SDK, and adds an elasticsearch output format.

Tests have been udpated to pass newer versions of flake8 and py3

Zuul project config has been added

Change-Id: If46d3fb8e2b2e4aa5e21bf7da470945b05d216cf
Signed-off-by: cloudnull <kevin@cloudnull.com>
2019-02-17 09:27:36 -06:00
Michael Rice b676952bbe Adding vg_check from the maas plugins
This change adds the volume group check from the
maas plugins, and also adds a cli helper to run bash command.

Change-Id: I303a843b0abaea721758e182a9c8f3e2db33e85d
Signed-off-by: Michael Rice <michael.rice@rackspace.com>
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-04-17 21:05:22 -05:00
Matt Thompson d99b674500 Default insecure to false in sample config
In PR [1] the default for insecure was set to False.  This commit
updates the sample configuration file to match that default.

NOTE: We also mock out test_insecure as is done in test_secure so that
      the test doesn't actually rely on what is set in openstack.ini to
      pass.

[1] https://review.openstack.org/#/c/474366/

Change-Id: I5257be8cfb9483ac7dd02b893e4a22a2ee46bbf7
2017-06-23 12:24:11 -04:00
Jimmy McCrory dc4251a766 Verify https connections by default
The 'insecure' option was being read in as a string without being
converted to a boolean, preventing it from ever being able to be set to
False. The default value has also been changed to False, so that
verification of certificates must be explicitly disabled.

Change-Id: Ic68b870ea8d5e2e3451ea7915407fabb918efe72
2017-06-14 16:07:56 -07:00
Jenkins a052de34bb Merge "Replace assertTrue(isinstance()) with assertIsInstance()" 2017-06-12 13:32:00 +00:00
Van Hung Pham 6b20f17624 Replace assertTrue(isinstance()) with assertIsInstance()
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A,
B) provided by testtools.

Change-Id: Ieb99417a4522f803e15547a9c7f6d781b6142678
2017-06-08 02:10:06 +07:00
Van Hung Pham dbaee9daec Replace assertEquals with assertEqual
The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals
therefore we should use assertEqual instead.

Change-Id: Iff74a21c0f26704a079303ac8db141f34a6ef256
2017-06-02 17:35:28 +07:00
Michael Rice 6eae6ea8db refactor testing directory layout
This changes the layout of the tests. Before both unit
and functional tests were in the same place. That made
it so development really needed to happen on linux because
of tests like uptime needing /proc/uptime This change
puts those kind of tests into the int testing dir
and adds a unit and integration test arg to tox.

Change-Id: I922079e4a556a171aadd801a8cc932e1e08f9b5d
Signed-off-by: Michael Rice <michael.rice@rackspace.com>
2017-05-31 21:11:29 -05:00
Michael Rice 0268ce450c Removes tuple unpacking from memcache test
Per pep 3113 Python 3 does not support tuple parameter
unpacking. This change removes the tuple from the function
param in the memcache plugin test since nothing is done
with it anyway.

Change-Id: I08c84cab308bbb405e5864fb0417f00c5310e71a
Closes-Bug: 1689347
Signed-off-by: Michael Rice <michael@michaelrice.org>
2017-05-08 12:25:05 -05:00
Major Hayden a30fe1d79d
Add memcache plugin
This patch adds a memcache plugin along with tests and documentation.

Implements: blueprint monitorstack
Change-Id: Iefb0c0912078713c26387e02e135d70d7a96a7dc
2017-04-27 07:35:51 -05:00
Major Hayden 928b34243a
Fix variable return bugs in kvm plugin
This patch ensures that monitorstack connects to the system URI for
libvirt. Without this, a regular user may connect to libvirt without
full access to the existing virtual machines.

It also adds the gathered variables to the output dictionatry so they
are returned when the plugin runs.

Tests have been adjusted to match the new changes, including a new
constructor that takes the system connection URI into consideration.

Closes-Bug: 1684235
Change-Id: Ieacc69ee495268b3b20974eb2f01ff1d2c9195c1
2017-04-19 12:42:56 -05:00
Kevin Carter 70f44024f9 moved cache location to stadard user caching dir (#26)
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-19 20:24:45 -05:00
Kevin Carter e808ba1f7d Add Cinder block pool metrics (#25)
The PR adds the cinder block pool metrics so that we can now retrieve
insights into the environment on the capacity all active storage pools.
This PR also creates tests for the new plugins and reduces duplication
across plugins by centralizing the runner method into the init of the
tests module.

This should now bring total code coverage to 100%

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-19 15:31:46 -05:00
Kevin Carter a61786d4e1 added rackspace maas format (#28)
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-19 09:03:06 -05:00
Kevin Carter 775f034a78 More complete testing of the os plugins/utils (#24)
The change implements several fixes so that monitor stack can be run in
OpenStack environments supporting both V2 and V3 authentication.

All of the plugins now have a proper name lookup and will pull from a local
cache instead of hammering the API on every request.

The Local caching functionlaity used to be tied to the python shelve
module. Due to issues with Python 3.5 and shelves the library was
replaced with the diskcache lib which implements a caching interface
supporting both py2.7+.

Tests have been added in support of all additions.

Tests have been added for the os_utils module which should bring it
within ~98% of completeness.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-14 11:34:10 -05:00
Major Hayden 79d23cd713 Add process check (#23)
This patch adds a check for running processes along with tests.
2017-03-10 15:49:11 -06:00
Major Hayden 10e9634213 Tests for remaining OpenStack modules (#22) 2017-03-10 11:48:45 -06:00
Major Hayden dc0ceffec2 Add tests for os_vm_used_cores (#20) 2017-03-10 09:56:51 -06:00
Major Hayden 7ad0b46a34 Final testing for quota checks (#16) 2017-03-09 16:35:23 -06:00
Major Hayden c3a396daba Add PEP257 checks (#15)
Check for docstrings.
2017-03-09 15:48:18 -06:00
Major Hayden 3114e7a123 Complete test coverage for os_vm_quota_cores (#14) 2017-03-09 14:55:44 -06:00
Major Hayden 143b0b8d75 Add testing for os_vm_quota_cores (#13) 2017-03-09 14:16:54 -06:00
Major Hayden 5d1c2b1db7 Fix test class name (#12) 2017-03-09 13:04:59 -06:00
Major Hayden 8c430edca0 Improve tests for formatters (#8)
This should give us full test coverage for the formatter plugins.
2017-03-09 10:40:02 -06:00
Kevin Carter 37a9950ab2 Added VM instances used and quotas (#6)
The following plugins add a basic OpenStack API framework which is used
to pull metrics for nova vm quotas and usage for RAM, vCPUs, disk, and
instance count.

added codecov.yml

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-09 09:48:17 -06:00
Major Hayden f943e47f70 Improve test coverage (#4) 2017-03-07 16:34:14 -06:00
Major Hayden 38eb764c4c Remove sys from uptime test (#3) 2017-03-07 14:23:22 -06:00
Major Hayden 0b55880400 Increase test coverage for uptime 2017-03-07 14:03:26 -06:00
Kevin Carter 52e06b501b Added KVM Metric plugin (#2)
This plugin will pull metrics and meta-data from a KVM host.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-01 13:22:10 -06:00
Kevin Carter 5aca2d2940 Couple of updates: telegraf line protocol, dynamic imports, metadata (#1)
* Couple of updates: telegraf line protocol, dynamic imports, metadata

This change uses the pkgutil module to import the plugins and load the
selected module. This same method is also used to list all of the
available modules.

To test run without installing the app pah has been added to the module
main using the sys path as found at runtime.

The telegraf line protocol has been added to allow this project to be
run with an exec stanza within telegraf allowing it to store metrics in
InfluxDB.

Meta has been added to the example plugin allowing additional meta data
to be returned in the result. This provides the ability to add tags or
other metadata into a given monitoring system using a simple key=value
format.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>

* added fixes for pep8

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-01 09:30:43 -06:00
Major Hayden 5f9ddd6dba Proof of concept 2017-02-27 15:11:30 -06:00