Cassandra

Provides access to a Cassandra cluster via cassandra() wrapper object.

cassandra(node, keyspace, username=None, password=None, port=9042, connect_timeout=1, protocol_version=3)

Initialize cassandra wrapper.

Parameters:
  • node (str) – Cassandra host.
  • keyspace (str) – Cassandra keyspace used during the session.
  • username (str) – Username used in connection. It is recommended to use unprivileged user for cassandra checks.
  • password (str) – Password used in connection.
  • port (int) – Cassandra host port. Default is 9042.
  • connect_timeout (int) – Connection timeout.
  • protocol_version (str) – Protocol version used in connection. Default is 3.

Note

You should always use an unprivileged user to access your databases. Use plugin.cassandra.user and plugin.cassandra.pass to configure credentials for the zmon-worker.

execute(stmt)

Execute a CQL statement against the specified keyspace.

Parameters:stmt (str) – CQL statement
Returns:CQL result
Return type:list