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
       }
    }
 }