DataStax Agent API example curl commands

Examples

Use the DataStax Agent API with cURL commands to directly hit an agent for useful information when troubleshooting an issue. Check the size of a diagnostic file before downloading. Determine the root cause of connection issues.

The location of the opscenterd.log file depends on the type of installation:

  • Package installations: /var/log/opscenter/opscenterd.log

  • Tarball installations: install_location/log/opscenterd.log

Some useful curl commands:

  • curl "http://agentIP:61621/v1/check-diagnostics-size" before getting diagnostics, which can take a substantial amount of time using curl -X GET --header 'Accept: application/json' 'http://localhost:61621/v1/diagnostics'.

  • If you see connection-status failed messages in the opscenterd.log, get more details using curl "http://54.152.37.135:61621/v1/connection-status" | json_pp (piped to JSON pretty print):

 $ curl "http://54.152.37.135:61621/connection-status" | json_pp
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
 100   935  100   935    0     0   3571      0 --:--:-- --:--:-- --:--:--  3582
 {
    "storage_cassandra" : {
       "config" : {
          "storage-keyspace" : "OpsCenter",
          "storage-port" : 9042,
          "storage-hosts" : [
             "172.31.6.241"
          ],
          "storage-cassandra-user" : null,
          "error" : "Authentication error on host /172.31.6.241:9042: Host /172.31.6.241:9042 requires authentication, but no authenticator found in Cluster configuration"
       },
       "started" : false
    },
    "install-type" : "package",
    "stomp" : {
       "started" : true,
       "config" : {
          "error" : null,
          "stomp-interface" : "172.31.0.97",
          "stomp-port" : 61620,
          "use-ssl?" : false
       }
    },
    "monitored_cassandra" : {
       "config" : {
          "monitored-cassandra-user" : null,
          "monitored-hosts" : [
             "172.31.6.241"
          ],
          "error" : "Authentication error on host /172.31.6.241:9042: Host /172.31.6.241:9042 requires authentication, but no authenticator found in Cluster configuration",
          "monitored-port" : 9042
       },
       "started" : false
    },
    "http" : {
       "config" : {
          "agent-rpc-interface" : "172.31.6.241",
          "api-port" : 61621,
          "use-ssl" : false
       }
    },
    "jmx" : {
       "started" : true,
       "config" : {
          "jmx-port" : 7199,
          "error" : null,
          "jmx-user" : null
       }
    }
 }

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com