Commit Graph

442 Commits

Author SHA1 Message Date
root a8be13bdeb 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
2021-09-20 21:06:27 +02:00
Martin Chacon Piza ead3e8d90b 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
2021-06-13 18:50:37 +02:00
Zuul abc8f5982e Merge "Use importlib to take place of imp module" 2020-11-23 23:45:21 +00:00
likui c84e98d6b6 Remove six
Replace the following items with Python 3 style code.

- six.PY2
- six.add_metaclass
- six.string_types
- six.text_type
- six.moves
- six.StringIO
- six.wraps
- six.integer_types

Story: 2008305
Task: 41191

Change-Id: I68710421b69d4049c9e990451da491dc14251fb5
2020-11-13 16:16:58 +01:00
gugug 8bf8c8b006 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
2020-08-30 23:10:04 +08:00
bandorf e021416e60 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
2020-08-17 16:05:25 +02:00
bandorf caffc7fbcf 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
2020-08-10 17:17:29 +02:00
Zuul 5148493fb7 Merge "Do not copy /sbin/ip to /usr/bin/monasa-agent-ip" 2020-04-27 16:43:40 +00:00
Joseph Davis 8d4bd979d5 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
2020-04-23 15:56:21 -07:00
KeithMnemonic 17ba1346b7 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
2020-04-23 13:56:29 -04:00
Zuul 17c9300570 Merge "Remove incorrect assignment of ping_cmd to 'True'" 2020-04-14 13:50:28 +00:00
KeithMnemonic 6f330f6dc1 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
2020-04-07 10:27:28 -04:00
Andreas Jaeger cedadccc6f 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
2020-03-31 06:49:33 +00:00
Doug Szumski e4aba27933 Add Infiniband metrics plugin
This plugin adds initial support for gathering Infiniband counters.

Story: 2007044
Task: 37859
Change-Id: Id04c34bd9aabd61ccd4ce22b30e515e4ca627561
2020-01-14 11:33:03 +00:00
Guang Yee e1d73c4b5d add X.509 certificate check plugin
Currently we don't have any capability to monitor the internal TLS/SSL
certificates. i.e. SSL certificates used by MySQL for replication, RabbitMQ for
distribution, etc. The cert_check plugin is not adequate for this purpose
becaue it can only check on certficates over HTTPS endpoints. Furthermore,
checking on these internal certificates over the network is cumbersome
because the agent plugin would have to speak specific protocols.

This patch adds a cert_file_check plugin to detect the certificate expiry
(in days from now) for the given X.509 certificate file in PEM format.
Similar to cert_check plugin, this plugin will a metric
'cert_file.cert_expire_days' which contains the number of days from now the
given certificate will be expired. If the certificate has already expired,
this will be a negative number.

Change-Id: Id95cc7115823f972e234417223ab5906b57447cc
Story: 2006753
2019-11-13 08:35:54 -08:00
akhiljain23 3404a6df72 Update hacking version to 1.1.x
This commit updates hacking version in test-requirements
and fixes some related pep8 issues

Also ignores false positive bandit test
B105: hardcoded_password_string,
B106: hardcoded_password_funcarg
based on variable or argument names.
For more info refer [1][2]

[1] https://bandit.readthedocs.io/en/latest/plugins/b105_hardcoded_password_string.html
[2] https://bandit.readthedocs.io/en/latest/plugins/b106_hardcoded_password_funcarg.html

Change-Id: If779ebad11926594961577e0744093a8ba691610
Story: 2004930
Task: 29314
2019-06-26 12:49:13 +05:30
Luka Peschke c8b9f306ab Update the cloudkitty detection plugin search pattern
CloudKitty's v1 API has been updated to "CURRENT", this changes the detection
plugin accordingly.

Change-Id: Ib7b16fe6cd5f7446fb3183c95fdb8044b7776c91
2019-04-04 14:39:30 +02:00
Witek Bedyk 049a2b0b05 Do not add dimensions to init_config
monasca_setup adds dimensions passed as arguments to the
`init_config.keystone_config` section of http_check.yaml. These should
be set only for instances.

Change-Id: Iccdefbaaaf5cc3ad87848f1c51ae2a2a055e309e
Story: 2005296
Task: 30246
2019-03-28 19:02:53 +01:00
Ashwin Agate 9375de2876 monasca-setup httpcheck args plugin: keystone_config
* httpcheck args plugin setup now creates
  keystone_config in init_config only if required.

* unecessary keystone_config section in init_config for
  http_check.yaml file would cause all http check instances
  to fail because of missing keystone credentials
  like e.g. keystone_url, username, password, project.

* This change creates a keystone_config section
  in init_config only if keystone_url is
  being passed as an argument during httpcheck plugin
  setup.

Story: 2005296
Task: 30182

Change-Id: Id31d2e5b5d22cb6c6f1fbdb942dac4b1b5aea76d
2019-03-26 09:13:51 -07:00
Stig Telfer 2099661acb Ceph plugin detects client.admin keyring
In standard system locations, check for the client.admin key
for each detected Ceph cluster and conditionally suppress
Ceph agent checks that require it if it is not found.

Change-Id: If3a28ceb5cdde40749d077ad465054eba37c848c
Story: 2005172
2019-03-08 17:19:00 +00:00
Zuul b48e1e60bc Merge "Update OVS detection plugin for Keystone v3" 2019-03-05 19:23:58 +00:00
Zuul a4abb94996 Merge "Support setting statsd metric aggregation interval" 2019-02-28 13:43:41 +00:00
Doug Szumski 0aa392a527 Support setting statsd metric aggregation interval
This adds support for setting the statsd metrics aggregation interval
as part of Monasca setup. Setting this interval is useful for users
calculating rates from statsd metrics.

Story: 2005063
Task: 29607
Change-Id: I22f5f1700c438245fd7e98deb40d706358349b6c
2019-02-21 14:23:21 +00:00
Witek Bedyk 5fe2a6d7b9 Update OVS detection plugin for Keystone v3
To properly support Keystone V3, we must also properly convey the
domain information to the underlaying Keystone client.

Story: 2005045
Task: 29542

Change-Id: I57f233578132a3689a2182c53483d8110f15bcea
2019-02-19 14:44:44 +01:00
Zuul 73e0072802 Merge "Update log level classification info" 2019-02-15 10:06:32 +00:00
Guang Yee be58b5b95b properly convey Keystone v3 params
To properly support Keystone V3, we must also properly convey the
domain information to the underlaying Keystone client.

Change-Id: I725e107e418d15b65aabf24f8c05403f952f94d5
story: 2005018
Task: 29497
2019-02-15 08:09:07 +00:00
Michał Piotrowski 538aec2e1b Update log level classification info
It is possible monasca-setup configuration process informs user about
errors related to setting up other services, but system is working
correctly. It is expected to change some log level classification for
INFO or WARNING depends on type of message.

Story: 2004970
Task: 29425

Change-Id: Idb8101fea6e7c5c357d72d77b3b264db4cce8527
2019-02-15 08:36:17 +01:00
Zuul a1f391048a Merge "Improve error message when plugin detection fails." 2019-02-08 16:42:57 +00:00
Joseph Davis 710253232f Improve error message when plugin detection fails.
The previous message didn't give much detail, which has led to
some confusion and questions from users. This change attempts to
add some more detail and help in debugging why a plugin detection
might fail.

Story: 2004696
Task: 28712
Change-Id: Ifc0a1bca747f655765aaa23b23751b52d4586133
2019-02-08 15:36:58 +00:00
lvxianguo 269d8a3661 modify the description
Change-Id: I5c83f5b9210be9e6e2b6b490fe2f19410013cbfa
2019-01-10 19:03:42 +08:00
Guang Yee dd5441cd40 enable Keystone v3 support for http_check detection plugin
To properly support Keystone V3, we must also properly convey
the domain information to the Keystone authentication plugins.

Change-Id: I8c6539cf692e090290cfdf104eb22530a625aadb
story: 2004655
2018-12-20 18:31:18 -08:00
esampson b39994529c Fix urllib references
The transition form urllib2 to urllib was not quite right. Some changes were
missing .request and .error from the references.

Change-Id: Icdc0eb7456b5385a0ef3aa67018f7c64985ed7c7
Story: 2000975
Task: 27818
2018-11-06 08:52:07 -08:00
Denis Poisson 0402321ec8 Configure Keystone with detection_args for http_check detection plugin
Change-Id: I023962d70f12881ab775b9ce1135b676483ff61c
story: 2001843
task: 14458
2018-07-26 13:06:31 +02:00
Adrian Czarnecki 92ac626c9b Python3: Make monasca-setup compatible with py35
Change-Id: Ieb4039e5af8d876218ce9b20d6f293c3dff989a9
2018-07-03 15:08:58 +02:00
Zuul 89e563194e Merge "Removed dependency on supervisor" 2018-06-29 14:20:42 +00:00
Stefano Canepa a8a2bb845b Removed dependency on supervisor
To support python3 in the near future this was done:

* Removed dependency on supervisor.
* Added template configuration for systemd target that includes all
  services.
* Added templates configuration for systemd service for every single
  service.
* Changed monasca_setup to use the new templates.

In the meanwhile code was formated to cope with pep8 settings and some
other small changes were done to comply with pycodestyle and
pydocstring.

Task: 4126
Story: 2000975

Depends-On: https://review.openstack.org/#/c/566475/

Change-Id: I0d0c4ea41a830581d6b9f247fad6a2dda1f96cbe
2018-06-27 11:28:43 +02:00
weezhard 8198225294 Add Cloudkitty detection plugin (Cloudkitty - Rating Service)
Change-Id: I82415b88d131f8239e062bb73561cc45e26b3887
2018-05-26 00:40:55 +02:00
melissaml 38436b0b6d fix misspelling of 'monasca'
Change-Id: I098a85d2231370ad599d7a9d1ef7b97d4d6ceda4
2018-05-21 13:59:16 +08:00
James Gu 20ee322500 Correctly detects apache process when mod_perl is installed
Apache mod_perl sets the process name to the full command path
which is truncated to 15 characters by Linux convention. Adds
/usr/sbin/httpd to the apache process known names to the apache
detection plugin.

Change-Id: I6d45e9e6d5aef46d3a230911e7778d6ab7ca9265
story: 2001945
task: 15063
2018-05-14 22:46:10 +00:00
Jui Chandwaskar c983708637 Add Apache License
Added Apache 2.0 License for missed files

Change-Id: I72217d3cf0089434a9bbe1e5dfd57224a803704e
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
2018-04-14 11:50:07 +00:00
Zuul 4f3aa7e8a3 Merge "Update pep8 checks" 2018-04-13 08:15:18 +00:00
Jui Chandwaskar f837eee559 Update pep8 checks
* set the maximum line length to 100
* cleaned up the codes for pep8

Depends-On: https://review.openstack.org/560844
Change-Id: Id548b78b673cce869ef8291bdb6b4f1367b383ed
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
2018-04-12 11:05:01 +00:00
Zuul da8a8051b7 Merge "Avoid overwriting sys.path "ip" command" 2018-04-11 15:26:28 +00:00
Zuul ceca989b2a Merge "Add LXC swap metric collector and fix lxc bug" 2018-03-13 14:13:55 +00:00
Eduardo 1133a0a04f Add LXC swap metric collector and fix lxc bug
LXC plugin throw up a exception when try collect cpu metrics. This
patch fix it (tests are passing) and add swap collector.

Change-Id: I3b12ac6ce199006bc1e024d2b2626657519e4f0b
Story: 2001563
Task: 6507
2018-03-07 16:54:46 -03:00
Doug Szumski 8cee27345d Correct detection status in congestion plugin
The congestion plugin should only enable itself if
detection succeeds.

Task: 6664
Story: 2001645

Change-Id: I11d465450ef346565150c055187ba2cf5929ba4c
2018-03-07 14:10:14 +00:00
Dirk Mueller 5c9b2b1acc Avoid overwriting sys.path "ip" command
This is desastrous to the rest of the system when
run outside a venv, as it overwrites the system ip
and it loses then capabilities to run for everyone else

Story: 2001593
Task: 6542

Change-Id: Ie0b7ef25b0f2cf6aca61adda4de5767ac2300cae
2018-02-23 14:02:03 +01:00
James Gu ae8771f414 Add monasca agent plugin to monitor cassandra health
Adds detection plugin to monitor cassandra service, including
the process, and the data directory through the args.

Change-Id: Ic2c20bc878527f607c0eb871e98a79c1521c0507
Story: 2001499
task: 6289
2018-02-01 11:51:57 +01:00
Zuul 5a68eb6c59 Merge "Update congestion agent plugin" 2018-01-11 21:35:13 +00:00
Fouad Benamrane 4e4faac80c Update congestion agent plugin
This commit is for correcting some mistakes about the documentation
and small issues.

Change-Id: I0a1bda7353c7e742ceb36f182011b3b92dc18da1
2018-01-10 11:14:47 +01:00