* Update monasca-agent from branch 'master'
to 9ac8a8e930de389f3be54fc82b44df96c0c06fd0
- Merge "Use TOX_CONSTRAINTS_FILE"
- Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.
Change-Id: Ic64ec2e5b6562de7ea901d62aab446c661d675e8
* Update monasca-agent from branch 'master'
to f26337fc04a4e12f265b29be80ac619c251d2851
- Add Python3 zed unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for zed.
See also the PTI in governance [1].
[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html
Change-Id: Idbde83566af37d8c35d71e280a385a16bc9f8843
* Update monasca-agent from branch 'master'
to dbb766218e3d1e99a965d26e03ba3872ea6aa339
- Remove JMSAppender.class to avoid CVE-2021-4104,
CVE-2022-23302, CVE-2022-23305, and CVE-2022-23307.
Though it does not contain a vulnerable configuration of log4j, to avoid
needing to prove that and false positives of security scanners, this
commit is the result of running the following commands:
zip -q -d monasca_agent/collector/checks/libs/jmxfetch-0.3.0-jar-with-dependencies.jar org/apache/logging/log4j/core/lookup/JndiLookup.class org/apache/log4j/net/JMSAppender.class org/apache/log4j/jdbc/JDBCAppender.class org/apache/log4j/net/JMSSink.class org/apache/log4j/chainsaw"*"
unzip monasca_agent/collector/checks/libs/jmxterm-1.0-DATADOG-uber.jar WORLDS-INF/lib/log4j.jar
zip -q -d WORLDS-INF/lib/log4j.jar org/apache/logging/log4j/core/lookup/JndiLookup.class org/apache/log4j/net/JMSAppender.class org/apache/log4j/jdbc/JDBCAppender.class org/apache/log4j/net/JMSSink.class org/apache/log4j/chainsaw"*"
zip monasca_agent/collector/checks/libs/jmxterm-1.0-DATADOG-uber.jar WORLDS-INF/lib/log4j.jar
Change-Id: Id47ba9397e7fef1ac8622abb2a1691a260f4bc9c
* Update monasca-agent from branch 'master'
to 052ab23048e4eee4901f7e1b18633f69d5c7f89e
- Remove py2-psutil from apk
The lib psutil in monasca-agent collector image is installed by
pip. An extra installation by apk isn't needed.
Change-Id: I580bdb01479522e7243bf3d2ace757edb2eff6db
* Update monasca-agent from branch 'master'
to 8c8a85a1d89dc430f831d31a36d2e282d1c2a387
- Clean up extra spaces
Although these errors are not important, they affect the code specification.
Change-Id: I906cf1ad1530de750c71cd622317d849347786ca
* Update monasca-agent from branch 'master'
to a8be13bdeb84bd11019f8e0010985181115cc73a
- Add a condition for systemd service detection in monasca_setup
Skip agent service detection if only installing plugins.
This will make it possible to use monasca-setup on the environments
where monasca-agent is not running as systemd service.
Typical usecase is running agent on kubernetes.
Change-Id: I232506e19f593b43cc011c6499242847c9bbc108
* Update monasca-agent from branch 'master'
to d30e12fde8a6d0923b44a015fd83a5c8060404e8
- Add Python3 yoga unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for yoga.
See also the PTI in governance [1].
[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html
Change-Id: I2931acfa82af41b63d2e9a0e7a257a983cbeb707
* Update monasca-agent from branch 'master'
to 170afab95203989e3e3247275d71e56be7966800
- Merge "Revert "Replace fnmatch with oslo.utils.fnmatch""
- Revert "Replace fnmatch with oslo.utils.fnmatch"
This reverts commit 9ff337881be12463b15ab56dfa7d76c36142970f.
Reason for revert:
The oslo_utils.fnmatch module was added to solve an issue in py2.7 but
it is no longer required because py2.7 is no longer supported.
The module was deprecated since oslo.utils 4.9.1[1] and the stdlib's
fnmatch module should be used instead.
[1] 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b
Change-Id: I84c0d2b2705e34b9853d42d03a398ecbe4f95330
* Update monasca-agent from branch 'master'
to f6d1170b9b9f70b3139e20e59ef09faa8525bb84
- vmware: Use oslo.vmware's get_moref_value()
With switching the SOAP library backing oslo.vmware [1], the internal
representation of ManagedObjectReference's attributes changes. To be able
to make the switch without interruption, we introduced helper functions
in oslo.vmware. This commit uses one of those - get_moref_value()
- to make the access to the "value" attribute compatible with both
backing libraries.
[1] https://specs.openstack.org/openstack/oslo-specs/specs/victoria/oslo-vmware-soap-library-switch.html
Change-Id: I50f0aa5d8865323515d15d1c1c5f10683bbac090
* Update monasca-agent from branch 'master'
to ead3e8d90ba8121b03c6ef26364d97aad8ceb56b
- Fix Monasca-Setup Keystone detection
- In RHOSP16.1 (TripleO based) the Keystone process name is
`keystone`. In previous RHOSP10 the process name was
`keystone-admin` and `keystone-main`.
Change-Id: I58882af66979f324cb372696febda65a33eb81b6
* Update monasca-agent from branch 'master'
to 679f09a3a8f6c89b3b729b60d2174cb4ae3d891c
- Fix PY3 issue
- In PY3 the output of subprocess.Popen is a type bytes, but
strip() method requires a type str.
Story: 2008017
Task: 40669
Change-Id: I297c30044df9a94baa645a1a27de10bb49038440
* Update monasca-agent from branch 'master'
to 7d21e505e8a8f750e88978c80f7ac47d73d7f2db
- Fix Docker builds
The default nodeset was just changed to focal [1], which in the absence
of the python-is-python3 package doesn't provide a python binary.
[1] https://review.opendev.org/c/opendev/base-jobs/+/789098
Change-Id: I70984db7af7ce5f7028077db4debcd2cd9bd7c45
* Update monasca-agent from branch 'master'
to cefab7f3e837188ac905a618295e3b56326e61f8
- Add Python3 xena unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for xena.
See also the PTI in governance [1].
[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html
Change-Id: I18b3489f9b40eeda11dc57381d2ab1d84912b2fd
* Update monasca-agent from branch 'master'
to bc03bc9875905f814ddcf4cbc5d204ccacf1ffe6
- Merge "Remove incorrect plugins configuration for docker image."
- Remove incorrect plugins configuration for docker image.
These plugins are not working with docker image because of docker architecture,
this kind of metrics are collected by cadvisor plugin.
Change-Id: I67c47ddfc26a30f6e48bcf4102c750812970be97
* Update monasca-agent from branch 'master'
to 404731027708c82943d8809a7825687141d4c536
- Fix small issue in dokcer plugin.
Change-Id: I7dda293fde999407a1bca7684b2ee777bfc7eddf
* Update monasca-agent from branch 'master'
to abc8f5982ed3fc863d53b4dcb16c6855ab9e3464
- Merge "Use importlib to take place of imp module"
- Use importlib to take place of imp module
The imp module is deprecated[1] since version 3.4, use importlib to
instead
[1]: https://docs.python.org/3/library/imp.html
Change-Id: I10f2c8c165aebddc8fd39601a0a23231ff89cdf7
* Update monasca-agent from branch 'master'
to 132cd5b126c43719f3a5744a6f447e4b00a811f9
- Merge "Replace assertItemsEqual with assertCountEqual"
- Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Change-Id: I7ea008e1d1b83b9ad264b6846de8ab16780c9528
* Update monasca-agent from branch 'master'
- Set 'libvirt_type' and 'libvirt_uri' options in the 'libvirt' plugin to be defined in conf.d/libvirt.yaml
The 'libvirt_type' and 'libvirt_uri' options are currently set by oslo configuration library.
However, in 'monasca_agent/collector/virt/libvirt/inspector.py' file these options cannot be
provided by a configuration file. Changing this to retrieve both options from
'conf.d/libvirt.yaml' file.
Change-Id: I1918fda471e951f42db0d302e371108b664e936c
* Update monasca-agent from branch 'master'
- Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Change-Id: I1b269b5c06a99e8f62f7c5a33b2314de06389041
* Update monasca-agent from branch 'master'
- Merge "bump py37 to py38 in tox.ini"
- bump py37 to py38 in tox.ini
in 'victoria' cycle, we should test py38 by default.
Trivial change
Change-Id: I224a54caa9c73634dd94f05d4a4969f52a9725cb
* Update monasca-agent from branch 'master'
- Merge "bump py37 to py38 in tox.ini"
- bump py37 to py38 in tox.ini
in 'victoria' cycle, we should test py38 by default.
[1] https://governance.openstack.org/tc/reference/runtimes/victoria.html
Change-Id: Iec7a658061c30f9e445ba27bfab584c93d0355bd
* Update monasca-agent from branch 'master'
- Merge "Add Python3 wallaby unit tests"
- Add Python3 wallaby unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for wallaby.
See also the PTI in governance [1].
[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html
Change-Id: I4138e42d6d76a8fc22513ff797ba6cd22ee4556a
* Update monasca-agent from branch 'master'
- Adding python3-libvirt for Ubuntu-focal
Fix No package matching 'python-libvirt' is available in Ubuntu-focal
Change-Id: Iedeec778348f566a8b6bddbaaaa6d57133ebb059
* Update monasca-agent from branch 'master'
- Update API version of monitored Cinder
When checking response of Cinder API, a pattern match is done.
As of now, it is checked if "version 1" is installed.
This version is not supported any longer since Cinder train release, as mentioned in release notes:
https://docs.openstack.org/releasenotes/python-cinderclient/train.html
Now, http_check of monasca-agent accepts all known API versions: 1-3
Change-Id: I22b32bcc49760a2da38310aed8e04e44f691a974
Story: 2008021
Task: 40673
* Update monasca-agent from branch 'master'
- Avoid single quote in help text
Single quote in help text caused issues on Red Hat.
In order to avoid issues on any platform,
single quote (') has been removed.
Change-Id: Iccab9a225539a1d87a6ad6bfd873a65d36b8a515
Story:2007978
Task: 40601
* Update monasca-agent from branch 'master'
- Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.
Change-Id: Ia3f2c8abc87cf5551d3469d616790e8e9d567bce
* Update monasca-agent from branch 'master'
- Remove dependency on local hostname
The json_plugin tests read the localhost name in a different way
to how the hostname is fetched in the Monasca Agent check. This can
cause these tests to fail since the hostnames may differ. For example,
only one may contain .home as a suffix. In this change we avoid reading
the hostname from the system running the tests.
Story: 2007743
Task: 39921
Change-Id: Ifddba6aa9350f722a741a28a152ed9bc3e0b7da6
* Update monasca-agent from branch 'master'
- Merge "Add Python3 victoria unit tests"
- Add Python3 victoria unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for victoria.
See also the PTI in governance [1].
[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html
Change-Id: I4352f2231c91ad44ebbf78a693b9ba753338fd5f
* Update monasca-agent from branch 'master'
- Merge "Improve error handling in method that creates Monasca client"
- Improve error handling in method that creates Monasca client
Add error handler that prevent crash of forwarded
when agent is not able to connect to keystone
Story: 2007674
Task: 39781
Change-Id: If6366e5b94f9cbe3f21ce9dbeb26d28e3a36ae88
* Update monasca-agent from branch 'master'
- Merge "Remove .testr.conf"
- Remove .testr.conf
This commit removes .testr.conf since this repo already has
.stestr.conf. We just need .stestr.conf instead of .testr.conf.
Change-Id: I3bc6d4768f2673adbf22bb8106a5843c1eaaaf72
* Update monasca-agent from branch 'master'
- Fix parsing of StatsD metrics with Py3
When running with Py3 we compare a byte string to a unicode string
when parsing StatsD metrics. This patch adds some unit tests to
reproduce the bug and decodes the bytestring to make the existing
comparisons valid under Py3. When backporting to Train we can use
Oslo encodeutils. Clearly we could have more unit tests, but
this makes a start.
Change-Id: I6341f96f5c186428d2d829cabf618a6f84f40ce2
Story: 2007684
Task: 39796
* Update monasca-agent from branch 'master'
- Merge "Fix hacking min version to 3.0.1"
- Fix hacking min version to 3.0.1
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.
Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.
To avoid similar gate break in future, we need to bump the hacking min
version.
- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html
Change-Id: I75bfe1596031c441e0daf7f62a8d81aab279ec9f
* Update monasca-agent from branch 'master'
- Add debug output for libvirt ping checks
This patch adds some extra debug options to the ping check. It writes
the STDOUT of ping subprocess to a temporary file which can be logged in
the debug log level.
Change-Id: Ife9a1d409a8326fb9ff07b1b04508cd11f899d10
* Update monasca-agent from branch 'master'
- Merge "Do not copy /sbin/ip to /usr/bin/monasa-agent-ip"
- Do not copy /sbin/ip to /usr/bin/monasa-agent-ip
This patch removes the code that does the copy of /sbin/ip to
/usr/bin/monasca-agent-ip. There is a limitation with /sbin/ip
that limits copying it to a new name that is longer than
2 characters. The error is:
./monasca-agent-ip a
Object "nasca-agent-ip" is unknown, try "ip help".
As this is not working on RHEL,SLES, or Ubuntu this code
should be removed.
Change-Id: I439be00070eb1cf16416325f23a86fc7cd518acc
Story: 2001593
Task: 6543
* Update monasca-agent from branch 'master'
- Add remove configuration for matching arguments
The remove_config() function only removes an exact match for
the configured instance.
This will allow removing plugin configuration when all config is
not known.
Use case: A compute node has been removed, so any host_alive
ping checks that are configured for it should be removed. But at
the time of removal the list of target_hostnames to match are
not known.
Change-Id: I8050e1eed68d7b64f7a968b061afa69fe2e86d72
Story: 2004539
Task: 28287
* Update monasca-agent from branch 'master'
- Merge "Cleanup py27 support"
- Cleanup py27 support
Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
know about the requirement
- Remove obsolete sections from setup.cfg:
* Wheel is not needed for python 3 only repo
* Some other sections are obsolete
- Update classifiers
- Update requirements, no need for python_version anymore
Change-Id: Ie23843938154df3a969b7755e1ca82d6b672c580
* Update monasca-agent from branch 'master'
- Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I1dca4b2c7eccf1b19482dde60b88a132935b48b8
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Update monasca-agent from branch 'master'
- Merge "Remove incorrect assignment of ping_cmd to 'True'"
- Remove incorrect assignment of ping_cmd to 'True'
This patch removes an incorrect setting ping_cmd to 'True'.
This is needed as the code is expecting ping_check to be
a "str" and not a "boolean".
Change-Id: Id9978215cb11c3a0d8f756d8ff8a5e7f789170b4
Story: 2007517
Task: 39300
* Update monasca-agent from branch 'master'
- Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Change-Id: I6396403d0a62f5403fc5b7fb04b6ce790c332c84