Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of openstack-swift from liberty #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cmarodrigues
Copy link

I have openstack-swift liberty and i have some issues with some checks:

/etc/scripts/check_swift_object_servers

Usage:
usage: swift-recon <server_type> [-v] [--suppress] [-a] [-r] [-u] [-d]
[-l] [-T] [--md5] [--auditor] [--updater] [--expirer] [--sockstat]
[--human-readable]

    <server_type>   account|container|object
    Defaults to object server.

    ex: swift-recon container -l --auditor

swift-recon: error: no such option: --objmd5

/etc/scripts/check_swift_dispersion /etc/swift/dispersion.conf

/usr/lib/python2.7/site-packages/keystoneclient/service_catalog.py:196: UserWarning: Providing attr without filter_value to get_urls() is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release. Either both should be provided or neither should be provided.
'Providing attr without filter_value to get_urls() is '
Traceback (most recent call last):
File "/etc/scripts/check_swift_dispersion", line 41, in
stats = json.load(report)
File "/usr/lib64/python2.7/json/init.py", line 290, in load
**kw)
File "/usr/lib64/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

So i propose the following changes:

--- check_swift_dispersion.orig 2015-10-28 12:25:13.295319852 +0000
+++ check_swift_dispersion 2015-10-28 12:26:04.662768280 +0000
@@ -32,11 +32,11 @@
STATE_UNKNOWN=3
STATE_DEPENDENT=4

-dispersion_config = os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/swift.conf")
+dispersion_config = os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/dispersion.conf")
if len(argv) > 1:
dispersion_config = argv[1]

-with os.popen("swift-dispersion-report -j %s"
+with os.popen("swift-dispersion-report -j %s | grep "^{""
% dispersion_config) as report:
stats = json.load(report)

--- check_swift_object_servers.orig 2015-10-28 12:24:55.335163069 +0000
+++ check_swift_object_servers 2015-10-28 12:25:00.839211116 +0000
@@ -56,7 +56,7 @@
exit $STATE_UNKNOWN
fi

-CHECK=$(swift-recon --objmd5 | grep ' error')
+CHECK=$(swift-recon --md5 | grep ' error')
echo $CHECK

if echo "$CHECK" | grep -q ' 0 error'

johnl added 2 commits May 13, 2014 22:59
The json format output from swift-dispersion-report changed. The
"missing" key names now have a decimal number, not words. Fixes redhat-cip#29

Ideally should support the old format too I suppose?
Setting environment variables in nrpe configs is tricky - command line
args are much easier.
@sbadia
Copy link
Contributor

sbadia commented Oct 29, 2015

Hi @cmarodrigues @johnl ! Thanks for this patch :-)
But it's possible to resubmit your patch on monitoring-for-openstack repository (using OpenStack workflow), because this repo is not active anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants