Skip to content

Getting error with Cassandra version 3.11.3 #7

@alochym01

Description

@alochym01

Hi

i using the following code to test Cassandra JMX query but getting error jsondecode error

My cassandra default install and setup from official web site

my java version, centos 7, python 3.6.6

(py3.6.6rc1) [hadn@localhost ~]$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

[hadn@localhost ~]$ uname -r
3.10.0-514.el7.x86_64
[hadn@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux`

[hadn@localhost ~]$ python
Python 3.6.6rc1 (default, Aug 10 2018, 09:40:06)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.

from jmxquery import JMXConnection, JMXQuery

jmx = JMXConnection("service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi",jmx_username="admin", jmx_password="admin")

wowza_object = jmx.query([JMXQuery(":")])
with open("to_string.txt", "w") as f:
for i in wowza_object:
#print(i.to_string())
f.write(i.to_string() + "\n")

with open("to_query_string.txt", "w") as f:
for i in wowza_object:
#print(i.to_query_string())
f.write(i.to_query_string() + "\n")
print(i.to_query_string())

[hadn@localhost ~]$ rpm -qi cassandra Name : cassandra Version : 3.11.3 Release : 1 Architecture: noarch Install Date: Fri 10 Aug 2018 09:30:57 AM EDT Group : Development/Libraries Size : 39319216 License : Apache Software License 2.0 Signature : RSA/SHA256, Wed 25 Jul 2018 02:59:43 AM EDT, Key ID a278b781fe4b2bda Source RPM : cassandra-3.11.3-1.src.rpm Build Date : Wed 25 Jul 2018 02:16:54 AM EDT Build Host : 1e1e3559cbdd Relocations : (not relocatable) URL : http://cassandra.apache.org/ Summary : Cassandra is a highly scalable, eventually consistent, distributed, structured key-value store. Description : Cassandra is a distributed (peer-to-peer) system for the management and storage of structured data.

(py3.6.6rc1) [hadn@localhost ~]$ python jconsole_cassandra.py Traceback (most recent call last): File "jconsole_cassandra.py", line 5, in <module> wowza_object = jmx.query([JMXQuery("*:*")]) File "/home/hadn/py3.6.6rc1/lib/python3.6/site-packages/jmxquery/__init__.py", line 209, in query return self.__run_jar(queries) File "/home/hadn/py3.6.6rc1/lib/python3.6/site-packages/jmxquery/__init__.py", line 170, in __run_jar metrics = self.__load_from_json(jsonOutput) File "/home/hadn/py3.6.6rc1/lib/python3.6/site-packages/jmxquery/__init__.py", line 180, in __load_from_json jsonMetrics = json.loads(jsonOutput) File "/home/hadn/.pyenv/versions/3.6.6rc1/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/home/hadn/.pyenv/versions/3.6.6rc1/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/home/hadn/.pyenv/versions/3.6.6rc1/lib/python3.6/json/decoder.py", line 355, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 467 column 177 (char 89736)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions