Monitoring and Metrics

Introduction 

This document is intended to provide an overview of the monitoring capabilities of the MobiledgeX platform. It is written from the perspective of an Operator who is responsible for managing cloudlets, clusters, applications, and application instances. 

There are three types of monitoring information provided by the MobiledgeX platform: 

  • Metrics 

  • Events 

  • Logs 

Details are provided below for each of those types, including an overview of how to use the monitoring information from both the Edge-Cloud Console and the MobiledgeX API. 

Security and Permissions 

To access monitoring information, you need to be part of the organization that owns the object being queried. For example, to be able to query information about a given cluster or application instance, you must be part of the organization that owns the cluster or application. 

Account management is out of scope for this document, but an explanation of the roles available within the MobiledgeX platform and the security considerations for those roles are available in the documentation on the MobiledgeX Website. 

Details are provided below for each of those types, including an overview of how to use the monitoring information from both the Edge-Cloud Console and the MobiledgeX API. 

Security and Permissions 

To access monitoring information, you need to be part of the organization that owns the object being queried. For example, to be able to query information about a given cluster or application instance, you must be part of the organization that owns the cluster or application. 

Account management is out of scope for this document, but an explanation of the roles available within the MobiledgeX platform and the security considerations for those roles are available in the documentation on the MobiledgeX Documentation website.

Trace ID 

The MobiledgeX platform uses distributed tracing. Each discrete action/event within the MobiledgeX platform will include a trace-id. When troubleshooting with MobiledgeX Support, please include the relevant trace ids to expedite the process. 

Metrics 

The MobiledgeX platform collects a several metrics for the following components: 

  • Cloudlets 

  • Clusters 

  • Application Instances 

Cluster Metrics 

All cluster related metrics contain the following identifiers: 

  • time 

  • cluster 

  • clusterorg 

  • cloudlet 

  • cloudletorg 

Metric 

Measurement Unit 

Measurement Detail 

CPU 

Percentage 

CPU usage expressed as a percentage of allocated CPU. 

MEM 

Percentage 

Memory usage expressed as a percentage of allocated Memory. 

DISK 

Percentage 

Filesystem usage expressed as a percentage of available disk. 

NET 

Bytes/Sec 

Transmit and Received data expressed as bytes/sec averaged over sixty seconds (60s) 

TCP 

Integer 

Total number of tcp connections / retransmissions expressed as an integer. 

UDP 

Integer 

Total number of udp datagrams transmitted and received, plus any errors expressed as an integer. 

Application Instances 

All application instance (appinst) metrics include the following identifiers: 

  • time 

  • app 

  • ver 

  • pod 

  • cluster 

  • clusterorg 

  • cloudlet 

  • cloudletorg 

  • apporg 

Metric

Measurement Unit 

Measurement Detail 

CPU 

Percentage 

CPU usage expressed as a percentage of allocated CPU. 

MEM 

Bytes 

Memory footprint expressed in Bytes. 

DISK 

Bytes 

Filesystem usage expressed in Bytes. 

NET 

Bytes/Sec 

Transmit and Received data expressed as bytes/sec averaged over sixty seconds (60s) 

Connections per Port 

(Bytes Sent/Received) 

Bytes/Sec 

Bytes sent/received averaged over sixty seconds (60s). 

Connections per Port 

(Sessions) 

Sessions 

Count for accepted, handled, and active sessions. 

Connections per Port 

(Session Time Histogram) 

Connection time in ms. 

Data is reported for: 

  • P0 

  • P25 

  • P50 

  • P75 

  • P90 

  • P95 

  • P99 

  • P99.5 

  • P99.9 

  • P100 


Cloudlet Metrics 

All cloudlet metrics include the following identifiers: 

  • time 

  • cloudlet 

  • cloudletorg 

Metric 

Measurement Unit 

Measurement Detail 

Utilization 

Multiple; based on context 

  • diskMax: Max available Disk size in GB 

  • diskUsed: Disk used at a timestamp in GBs 

  • memMax: Max memory on this cloudlet in MB 

  • memUsed: Memory used at timestamp in MB 

  • vCpuMax: Max available number of vCPUs on this cloudlet 

  • vCpuUsed: Number vCPUs on this cloudlet at timestamp 

Network 

Bytes 

Broken down by bytes sent and bytes received. 

Multiple; based on context 

  • floatingIpsMax: Maximum available number of floating IP addresses 

  • floatingIpsUsed: Number of floating IP addresses in use on this cloudlet at timestamp 

  • ipv4Max: Maximum available number of external IPv4 addresses 

  • ipv4Used: Number of external IPv4 addresses in use on this cloudlet at timestamp 

Edge-Cloud Console Metrics 

The Monitoring Dashboard has been designed to allow users the ability to drill down from higher-level components to lower-level components to view metrics. For example, one can start at the cluster level and drill down to a single application instance.

Data and analytics are displayed accordingly, depending on your set filters. Depending on your role (RBAC), not all features and options are available to you.

Once in the Edge-Cloud Console, you can access the Monitoring menu item on the left side menu bar: 

Side menu bar

That will take you to a screen that allows you to view the metrics that you currently have permission to view. For example, an account with Developer/Manager permissions will see a screen similar to this: 

Cloudlet monitoring

The Monitoring Dashboard provides access to the following information types. Metric information are presented as tiles, where each tile can be enlarged to view the graphical representation for each metric type.

  • Cluster level resource utilization, performance, and status metrics

  • Load balancer (Layer 4) metrics and status

  • Application Instance resource utilization, performance, and status metrics

  • Application Instance event logs, showing state changes and other Application Instance events

  • Distributed Matching Engine (DME) metrics, including location-based metrics for remote users

  • Cloudlet level information including regions, operator, disk and memory usage, and more.

By default, when you first launch the monitoring page, metrics are displayed for App instances. You can simply navigate to the option to switch your view to either Cluster Instance or Cloudlet (if you are an Admin).

You can filter using the following options:

  • Organization

  • Time Ranges. While the maximum allocated days you can search for audit logs is one day (within the last 24hrs), you can further refine your search for logs with the span of the 24 hour period. Start time default is 12:00a.m. and End Time default is 11:59p.m.

  • App Inst, Cluster Inst, or Cloudlet

  • Region

  • Metric Type (CPU, Memory, Disk Usage, Network Sent, Network Received, Active Connections)

You can also refresh your data and specify your refresh rate by seconds, minutes, or hours. You will see a progress bar at the top of the page which serves as an indicator.

Map View

The Map view within the monitoring page displays cloudlets and their locations where your app instances are deployed. The map view changes as you filter by regions (US or EU). You can also filter by all regions.

Types of Logs

Historical activities performed by you and others within your organization are logged and viewed from the Edge-Cloud Console. These logs are used for diagnostic purposes or error correction, and each activity is logged by date and time. Events provides valuable information if you require support from MobiledgeX. Simply copy and paste the traceid, and email the traceid to [email protected] There are other log types available as described below.

  • Audit Logs: Logs user activities such as logging, creating applications, deleting users, creating policies, etc. You can specify a range within the audit log display by using the range picker (calendar).

  • Event Logs: These are system-generated events and can include services such as auto-provision policy, auto-scaling, application instance, or HA, where our platform will trigger events based on these user policies.

  • Usage Logs: These logs are generated to view the status (online or offline) of clusters, application instances status, or Cloudlets, and maintenance status.

To access the log types, navigate to the Log icon at the top of the page, and select it. The three log types will display where you select to view your desired logs.

Log icon

Log menu

MobiledgeX API Metrics 

The MobiledgeX Platform exposes a RESTful API that includes routes for the retrieval of metric information. RESTful the same API that the Monitoring Console is built on, so the data pulled from the APIs will match directly with the information shown in the Console. 

The MobiledgeX API endpoint is located at https://console.mobiledgex.net/api/v1/ and can be accessed via tools such as Postmate, Resty, and cURL. However, to provide a stable interface for users, MobiledgeX has created the mcctl utility, which can be downloaded from the MobiledgeX Artifactory Repository using your MobiledgeX console account credentials. These binaries are available for both amd_64 and MacOSX architecture. 

Additional documentation is available on the MobiledgeX website: 

  • mcctl Reference Guide 

The mcctl Utility 

Installing mcctl 

Once downloaded, you will need to add execute permission to the file to execute it. Adding execute permission can be done by using the terminal to run chmod 755 ./mcctl

Users of MacOS Catalina will need to take an additional step to authorize the application with Gatekeeper. This involves the following steps: 

1. Open finder in the directory (folder) where you have downloaded the mcctl program. This can be done by running open . in the terminal. 

2. Launch the app you’re trying to run and acknowledge the Gatekeeper warning that prevents the app from running. 

3. Head to System Preferences > Security and Privacy > General and look for a note at the bottom of the screen about an app launch being denied. 

4. Click Open Anyway to bypass Gatekeeper and launch the app. 

Logging In to the API 

ITo use mcctl, so you must first log into the API to retrieve an authorization token. 

$ mcctl login --addr  https://console-stage.mobiledgex.net  name=jschmidt             
password:
login successful
token saved to /home/jschmidt/.mctoken

Retrieving Metrics 

The examples below request the output in JSON format, but it is possible to retrieve the data in YAML or condensed JSON (JSON without extra whitespace formatting). 

All metrics commands can be qualified with a time or duration parameter. 

  • last N Shows the last N series of data. 

  • starttime datetime Start time of displayed data. 

  • endtime datetime End time of displayed data. 

$ mcctl --addr https://console.mobiledgex.net  metrics
The metrics command will show metrics for:

applications
clusters
cloudlets
All metrics commands can be qualified with a time or duration parameter.

last N Shows the last N series of data.
starttime datetime Start time of displayed data.
endtime datetime End time of displayed data.
Internal Notes: Details on the available metrics are available in the MobiledgeX Wiki at this link. This should be added to this doc for the developer portal.

Application Metrics
Required Args:
  region        Region name
  app-org       Organization or Company name of the App
  selector      Comma separated list of metrics to view

Optional Args:
  appname       App name
  appvers       App version
  cluster       Cluster name
  cluster-org   Organization or Company Name that a Cluster is used by
  cloudlet      Name of the cloudlet
  cloudlet-org  Company or Organization name of the cloudlet
  last          Display the last X metrics
  starttime     Time to start displaying stats from
  endtime       Time up to which to display stats

Application Instance Metrics 

Usage
Required Args:
  region        Region name
  app-org       Organization or Company name of the App
  selector      Comma-separated list of metrics to view

Optional Args:
  appname       App name
  appvers       App version
  cluster       Cluster name
  cluster-org   Organization or Company Name that a Cluster is used by
  cloudlet      Name of the cloudlet
  cloudlet-org  Company or Organization name of the cloudlet
  last          Display the last X metrics
  starttime     Time to start displaying stats from
  endtime       Time up to which to display stats

Example 

Note: Output has been abbreviated for clarity 

$ mcctl  --addr https://console.mobiledgex.net  --output-format json metrics app region=EU app-org=demoorg selector=cpu,mem,disk,network last=1 appname=mexfastapi10

{
  "data": [
    {
      "Series": [
        {
          "columns": [
            "time",
            "app",
            "ver",
            "cluster",
            "clusterorg",
            "cloudlet",
            "cloudletorg",
            "apporg",
            "pod",
            "cpu",
            "mem",
            "disk",
            "sendBytes",
            "recvBytes"
          ],
          "name": "appinst-network",
          "values": [
            [
              "2020-06-08T22:16:46.88950592Z",
              "mexfastapi10",
              null,
              "fastapiCluster",
              "demoorg",
              "hamburg-main",
              "TDG",
              "demoorg",
              "mexfastapi10",
              null,
              null,
              null,
              603979776,
              138412032
            ]
          ]
        },
        {
          "columns": [
            "time",
            "app",
            "ver",
            "cluster",
            "clusterorg",
            "cloudlet",
            "cloudletorg",
            "apporg",
            "pod",
            "cpu",
            "mem",
            "disk",
            "sendBytes",
            "recvBytes"
          ],
          "name": "appinst-mem",
          "values": [
            [
              "2020-06-08T22:16:46.88950592Z",
              "mexfastapi10",
              null,
              "fastapiCluster",
              "demoorg",
              "hamburg-main",
              "TDG",
              "demoorg",
              "mexfastapi10",
              null,
              269588889,
              null,
              null,
              null
            ]
          ]
        },
        {
          "columns": [
            "time",
            "app",
            "ver",
            "cluster",
            "clusterorg",
            "cloudlet",
            "cloudletorg",
            "apporg",
            "pod",
            "cpu",
            "mem",
            "disk",
            "sendBytes",
            "recvBytes"
          ],
          "name": "appinst-disk",
          "values": [
            [
              "2020-06-08T22:16:46.88950592Z",
              "mexfastapi10",
              null,
              "fastapiCluster",
              "demoorg",
              "hamburg-main",
              "TDG",
              "demoorg",
              "mexfastapi10",
              null,
              null,
              0,
              null,
              null
            ]
          ]
        },
        {
          "columns": [
            "time",
            "app",
            "ver",
            "cluster",
            "clusterorg",
            "cloudlet",
            "cloudletorg",
            "apporg",
            "pod",
            "cpu",
            "mem",
            "disk",
            "sendBytes",
            "recvBytes"
          ],
          "name": "appinst-cpu",
          "values": [
            [
              "2020-06-08T22:16:46.88950592Z",
              "mexfastapi10",
              null,
              "fastapiCluster",
              "demoorg",
              "hamburg-main",
              "TDG",
              "demoorg",
              "mexfastapi10",
              0.24,
              null,
              null,
              null,
              Null
           ]
          ]
        }
      ]
    }
  ]
}

Cloud Metrics

Usage

Required Args:
region        Region name
cloudlet-org  Company or Organization name of the cloudlet
selector      Comma-separated list of metrics to view

Optional Args:
cloudlet      Name of the cloudlet
last          Display the last X
metrics
starttime     Time to start displaying stats from
endtime       Time up to which to display stats
Data Keys
time
cloudlet
cloudletorg
vCpuUsed
vCpuMax
memUsed
memMax
diskUsed
diskMax
netSend
netRecv
floatingIpsUsed
floatingIpsMax
ipv4Used
ipv4Max

Example

$ mcctl  --addr https://console.mobiledgex.net  --output-format json metrics cloudlet region=EU cloudlet-org=TDG selector=utilization,network,ipusage last=1
{
  "data": [
    {
      "Series": [
        {
          "columns": [
            "time",
            "cloudlet",
            "cloudletorg",
            "vCpuUsed",
            "vCpuMax",
            "memUsed",
            "memMax",
            "diskUsed",
            "diskMax",
            "netSend",
            "netRecv",
            "floatingIpsUsed",
            "floatingIpsMax",
            "ipv4Used",
            "ipv4Max"
          ],
          "name": "cloudlet-utilization",
          "values": [
            [
              "2020-06-08T22:38:00.458128973Z",
              "munich-main",
              "TDG",
              188,
              200,
              350208,
              512000,
              920,
              5000,
              null,
              null,
              null,
              null,
              null,
              null
            ]
          ]
        },
        {
          "columns": [
            "time",
            "cloudlet",
            "cloudletorg",
            "vCpuUsed",
            "vCpuMax",
            "memUsed",
            "memMax",
            "diskUsed",
            "diskMax",
            "netSend",
            "netRecv",
            "floatingIpsUsed",
            "floatingIpsMax",
            "ipv4Used",
            "ipv4Max"
          ],
          "name": "cloudlet-network",
          "values": [
            [
              "2020-06-08T01:52:29.244553765Z",
              "berlin-main",
              "TDG",
              null,
              null,
              null,
              null,
              null,
              null,
              null,
              0,
              null,
              null,
              null,
              null
            ]
          ]
        },
        {
          "columns": [
            "time",
            "cloudlet",
            "cloudletorg",
            "vCpuUsed",
            "vCpuMax",
            "memUsed",
            "memMax",
            "diskUsed",
            "diskMax",
            "netSend",
            "netRecv",
            "floatingIpsUsed",
            "floatingIpsMax",
            "ipv4Used",
            "ipv4Max"
          ],
          "name": "cloudlet-ipusage",
          "values": [
            [
              "2020-06-08T22:38:08.425162762Z",
              "munich-main",
              "TDG",
              null,
              null,
              null,
              null,
              null,
              null,
              null,
              null,
              0,
              10,
              33,
              1004
            ]
          ]
        }
      ]
    }
  ]
}

Events

The MobiledgeX platform logs events as they occur - events include lifecycle milestones such as a cluster being created, an application instance autoscaling, a user is added, and so on.

Similar to the retrieval of metrics, a user can only view events that they haves permission to view, which means that they need to be members of the organization who’s events they wish to see.

Edge-Cloud Console Events

One way to view these events is in the MobiledgeX Web Console under the “Audit” sidebar item.

Events payload example

In the screenshot above, you can see the event payload includes data regarding all the events for a time window for the demo user.

MobiledgeX API Events

The same events that are presented in the MobiledgeX Web GUI can be viewed from the CLI by using the events command to the mcctl utility. The examples below request the output in JSON format, but it is possible to retrieve the data in YAML or condensed JSON (JSON without extra whitespace formatting).

The mcctl Utility

Installing mcctl

Once downloaded, you will need to add execute permission to the file i to execute it. This can be done by using the terminal to run chmod 755 ./mcctl.

 Users of MacOS Catalina will need to take an additional step to authorize the application with Gatekeeper. This involves the following steps:

  1. Open finder in the directory (folder) where you have downloaded the mcctl program. This can be done by running open . in the terminal.

  2. Launch the app you’re trying to run and acknowledge the Gatekeeper warning that prevents the app from running.

  3. Head to System Preferences > Security and Privacy > General and look for a note at the bottom of the screen about an app launch being denied.

  4. Click  Open Anyway to bypass Gatekeeper and launch the app.

Logging In to the API

To use mcctl, you must first log into the API to retrieve an authorization token.

$ mcctl login --addr  https://console-stage.mobiledgex.net  name=jschmidt                  
password:
login successful
token saved to
/home/jschmidt/.mctoken

Retrieving Events

The examples below request the output in JSON format, but it is possible to retrieve the data in YAML or condensed JSON (JSON without extra whitespace formatting).

All metrics commands can be qualified with a time or duration parameter.

  • last N Shows the last N series of data.

  • starttime datetime Start time of displayed data.

  • endtime datetime End time of displayed data.

     

$ mcctl --addr https://console.mobiledgex.net  events
The events command will show events for:

applications
clusters
cloudlets
All events commands can be qualified with a time or duration parameter.

last N Shows the last N series of data.
starttime datetime Start time of displayed data.
endtime datetime End time of displayed data.

Application Events

Usage
Required Args:
  region       Region name
  apporg       Organization or Company Name that a Developer is part of

Optional Args:
  appname      App name
  appvers      App version
  cluster      Cluster name
  cloudlet     Name of the cloudlet
  cloudletorg  Organization name owning of the cloudlet
  last         Display the last X Events
  starttime    Time to start displaying stats from
  endtime      Time up to which to display stats
Example
$ mcctl  --addr https://console.mobiledgex.net  --output-format json events app region=EU apporg=demoorg
{
  "data": [
    {
      "Series": [
        {
          "columns": [
            "time",
            "app",
            "ver",
            "cluster",
            "clusterorg",
            "cloudlet",
            "cloudletorg",
            "apporg",
            "event",
            "status"
          ],
          "name": "appinst",
          "values": [
            [
              "2020-06-11T21:45:37.030622125Z",
              "leotest",
              "1.1",
              "autoclusterleotest",
              "demoorg",
              "dusseldorf-main",
              "TDG",
              "demoorg",
              "DELETED",
              "DOWN"
            ],
            [
              "2020-06-11T16:17:18.954135649Z",
              "leotest",
              "1.1",
              "autoclusterleotest",
              "demoorg",
              "dusseldorf-main",
              "TDG",
              "demoorg",
              "CREATED",
              "UP"
            ],
            [
              "2020-06-11T16:09:28.014006366Z",
              "leotest",
              "1.0",
              "autoclusterleotest",
              "demoorg",
              "hamburg-main",
              "TDG",
              "demoorg",
              "DELETED",
              "DOWN"
            ],
            [
              "2020-05-22T16:50:59.47204115Z",
              "helm3-test",
              "1.0",
              "autoclusterhelm3-test",
              "demoorg",
              "dusseldorf-main",
              "TDG",
              "demoorg",
              "DELETED",
              "DOWN"
            ]
          ]
        }
      ]
    }
  ]
}

 

Cluster Events

Usage
Required Args:
  region       Region name
  clusterorg   

Optional Args:
  cluster      Cluster name
  cloudletorg  Organization name owning of the cloudlet
  cloudlet     Name of the cloudlet
  last         Display the last X Events
  starttime    Time to start displaying stats from
  endtime      Time up to which to display stats
 
Example
$ mcctl  --addr https://console.mobiledgex.net  --output-format json events cluster region=EU clusterorg=demoorg
{
  "data": [
    {
      "Series": [
        {
          "columns": [
            "time",
            "cluster",
            "clusterorg",
            "cloudlet",
            "cloudletorg",
            "flavor",
            "vcpu",
            "ram",
            "disk",
            "other",
            "event",
            "status"
          ],
          "name": "clusterinst",
          "values": [
            [
              "2020-06-11T21:45:37.030373227Z",
              "autoclusterleotest",
              "demoorg",
              "dusseldorf-main",
              "TDG",
              "m4.small",
              2,
              2048,
              20,
              "map[]",
              "DELETED",
              "DOWN"
            ],
            [
              "2020-06-11T16:16:56.117330464Z",
              "autoclusterleotest",
              "demoorg",
              "dusseldorf-main",
              "TDG",
              "m4.small",
              2,
              2048,
              20,
              "map[]",
              "CREATED",
              "UP"
            ],
            [
              "2020-06-11T16:09:28.013967166Z",
              "autoclusterleotest",
              "demoorg",
              "hamburg-main",
              "TDG",
              "m4.small",
              2,
              2048,
              20,
              "map[]",
              "DELETED",
              "DOWN"
            ]
          ]
        }
      ]
    }
  ]
}
 

Cloudlet Events

Usage
Required Args:
  region       Region name
  cloudletorg  Organization name owning of the cloudlet

Optional Args:
  cloudlet     Name of the cloudlet
  last         Display the last X Events
  starttime    Time to start displaying stats from
  endtime      Time up to which to display stats
Example
$ mcctl  --addr https://console.mobiledgex.net  --output-format json events cloudlet region=EU cloudletorg=TDG   
{
  "data": [
    {
      "Series": [
        {
          "columns": [
            "time",
            "cloudlet",
            "cloudletorg",
            "event",
            "status"
          ],
          "name": "cloudlet",
          "values": [
            [
              "2020-06-08T18:29:37.15500575Z",
              "berlin-test",
              "TDG",
              "DELETED",
              "DOWN"
            ],
            [
              "2020-06-08T12:43:46.058384029Z",
              "berlin-test",
              "TDG",
              "CREATED",
              "UP"
            ],
            [
              "2020-06-04T19:11:49.067685911Z",
              "Berlin-Main-Test",
              "TDG",
              "DELETED",
              "DOWN"
            ],
            [
              "2020-06-04T19:09:28.727345388Z",
              "Berlin-Main-Test",
              "TDG",
              "CREATED",
              "UP"
            ],
            [
              "2020-05-15T17:22:31.181937143Z",
              "frankfurt-5glab",
              "TDG",
              "CREATED",
              "UP"
            ]
          ]
        }
      ]
    }
  ]
}

Auditing

The MobiledgeX platform creates audit records for events and other cluster activity as they occur.

Similar to the retrieval of metrics, a user can only view audit logs that they have permission to view, which means that they need to be members of the organization who’s audit logs they wish to see.

Web Console Audit Logs

One way to view these audit logs is in the MobiledgeX Web Console under the “Audit” sidebar item.

Audit logs example

MobiledgeX API Audit Logs

The same audit logs that are presented in the MobiledgeX Web GUI can be viewed from the CLI by using the audit command to the mcctl utility. The examples below request the output in JSON format, but it is possible to retrieve the data in YAML or condensed JSON (JSON without extra whitespace formatting).

The mcctl Utility

Installing mcctl

Once downloaded, you will need to add execute permission to the file to execute it. This can be done by using the terminal to run chmod 755 ./mcctl.

Users of MacOS Catalina will need to take an additional step to authorize the application with Gatekeeper. This involves the following steps:

  1. Open finder in the directory (folder) where you have downloaded the mcctl program. This can be done by running open . in the terminal.

  2. Launch the app you’re trying to run and acknowledge the Gatekeeper warning that prevents the app from running.

  3. Head to System Preferences > Security and Privacy > General and look for a note at the bottom of the screen about an app launch being denied.

  4. Click on “Open Anyway” to bypass Gatekeeper and launch the app.

Logging In to the API

To use mcctl, you must first log into the API to retrieve an authorization token.

$ mcctl login --addr  https://console-stage.mobiledgex.net  name=jschmidt                   
password:
login successful
token saved to /home/jschmidt/.mctoken

Retrieving Audit Logs

The examples below request the output in JSON format, but it is possible to retrieve the data in YAML or condensed JSON (JSON without extra whitespace formatting).

 All audit commands can be qualified with a time or duration parameter.

  • last N Shows the last N series of data.

  • starttime datetime Start time of displayed data.

  • endtime datetime End time of displayed data.

 $ mcctl --addr https://console.mobiledgex.net audit
show audit logs

Usage:
  mcctl audit [command]

Available Commands:
  showself
  showorg

Flags:
  -h, --help   help for audit

Global Flags:
      --addr string            MC address (default "http://127.0.0.1:9900")
      --data string            json formatted input data, alternative to name=val args list
      --datafile string        file containing json/yaml formatted input data, alternative to name=val args list
      --debug                  debug
      --output-format string   output format: yaml, json, or json-compact (default "yaml")
      --output-stream          stream output incrementally if supported by command (default true)
      --parsable               generate parsable output
      --silence-usage          silence-usage
      --skipverify             don't verify cert for TLS connections
      --token string           JWT token

Use "mcctl audit [command] --help" for more information about a command.
 

Self-Audit

The self-audit option will return all information associated with the user that is logged into the API.

Usage
Required Args:

Optional Args:
  limit
Example
$ mcctl  --addr https://console.mobiledgex.net  --output-format json audit showself

[
  {
    "operationname": "/api/v1/auth/metrics/app",
    "username": "jay.schmidt",
    "clientip": "172.17.0.1",
    "status": 400,
    "starttime": 1591654143039652,
    "duration": 274,
    "request": "{\"appinst\":{\"app_key\":{\"organization\":\"demoorg\"}},\"region\":\"EU\",\"selector\":\"cpu,mem,disk,network,tcp,udp\"}",
    "response": "{\"message\":\"Invalid appinst selector: tcp\"}",
    "error": "",
    "traceid": "442ca89d3418b6af"
  },
  {
    "operationname": "/api/v1/auth/metrics/cloudlet",
    "username": "jay.schmidt",
    "clientip": "172.17.0.1",
    "status": 400,
    "starttime": 1591654011509158,
    "duration": 193,
    "request": "{\"cloudlet\":{\"organization\":\"TDG\"},\"region\":\"EU\",\"selector\":\"cpu\"}",
    "response": "{\"message\":\"Invalid cloudlet selector: cpu\"}",
    "error": "",
    "traceid": "04a229ee7dfde458"
  },
  {
    "operationname": "/api/v1/login",
    "username": "jay.schmidt",
    "clientip": "172.17.0.1",
    "status": 400,
    "starttime": 1591641868552332,
    "duration": 1082826,
    "request": "{\"username\":\"jay.schmidt\",\"password\":\"\"}",
    "response": "{\"message\":\"Invalid username or password\"}",
    "error": "",
    "traceid": "5d425c8cb9dbc53c"
  }
]

Organization Audit

The self-audit option will return all information associated with the user that is logged into the API. By default, this command will show audit information for the current organization. If the user running the command belongs to more than one organization, the org option should be provided to the mcctl utility.

Usage
Required Args:

Optional Args:
  org
  limit
Example
$ mcctl --addr https://console.mobiledgex.net --output-format=json audit  showorg org=demoorg
[
  {
    "operationname": "/ws/api/v1/auth/ctrl/DeleteClusterInst",
    "username": "bibin.george",
    "clientip": "172.17.0.1",
    "status": 200,
    "starttime": 1592981517233561,
    "duration": 26236424,
    "request": "{\"Region\":\"EU\",\"ClusterInst\":{\"key\":{\"cluster_key\":{\"name\":\"autoclusterhelm-test\"},\"cloudlet_key\":{\"organization\":\"TDG\",\"name\":\"munich-main\"},\"organization\":\"demoorg\"},\"flavor\":{\"name\":\"m4.small\"},\"status\":{}}}",
    "response": "{\"code\":200,\"data\":{\"message\":\"Deleting\"}}\n{\"code\":200,\"data\":{\"message\":\"NotPresent\"}}\n{\"code\":200,\"data\":{\"message\":\"Deleted ClusterInst successfully\"}}",
    "error": "",
    "traceid": "48a6cb3af58f20a2"
  },
  {
    "operationname": "/ws/api/v1/auth/ctrl/DeleteClusterInst",
    "username": "bibin.george",
    "clientip": "172.17.0.1",
    "status": 200,
    "starttime": 1592885422265352,
    "duration": 24595609,
    "request": "{\"Region\":\"EU\",\"ClusterInst\":{\"key\":{\"cluster_key\":{\"name\":\"autoclusterjaytest\"},\"cloudlet_key\":{\"organization\":\"TDG\",\"name\":\"munich-main\"},\"organization\":\"demoorg\"},\"flavor\":{\"name\":\"m4.small\"},\"status\":{}}}",
    "response": "{\"code\":200,\"data\":{\"message\":\"Deleting\"}}\n{\"code\":200,\"data\":{\"message\":\"NotPresent\"}}\n{\"code\":200,\"data\":{\"message\":\"Deleted ClusterInst successfully\"}}",
    "error": "",
    "traceid": "5b463e6f350f98cd"
  },
  {
    "operationname": "/ws/api/v1/auth/ctrl/CreateAppInst",
    "username": "demo",
    "clientip": "172.17.0.1",
    "status": 200,
    "starttime": 1592845090049456,
    "duration": 48787142,
    "request": "{\"Region\":\"EU\",\"AppInst\":{\"key\":{\"app_key\":{\"organization\":\"demoorg\",\"name\":\"mexfastapi\",\"version\":\"1.0\"},\"cluster_inst_key\":{\"cluster_key\":{\"name\":\"paulotestcluster\"},\"cloudlet_key\":{\"organization\":\"TDG\",\"name\":\"dusseldorf-main\"},\"organization\":\"demoorg\"}},\"cloudlet_loc\":{},\"mapped_ports\":null,\"flavor\":{},\"runtime_info\":{},\"created_at\":{},\"status\":{}}}",
    "response": "{\"code\":200,\"data\":{\"message\":\"Creating\"}}\n{\"code\":200,\"data\":{\"message\":\"Seeding docker secret\"}}\n{\"code\":200,\"data\":{\"message\":\"Deploying Docker App\"}}\n{\"code\":200,\"data\":{\"message\":\"Configuring Firewall Rules and DNS\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating\"}}\n{\"code\":200,\"data\":{\"message\":\"Ready\"}}\n{\"code\":200,\"data\":{\"message\":\"Created AppInst successfully\"}}",
    "error": "",
    "traceid": "2d0709f0917e88b9"
  },
  {
    "operationname": "/ws/api/v1/auth/ctrl/CreateClusterInst",
    "username": "demo",
    "clientip": "172.17.0.1",
    "status": 200,
    "starttime": 1592844840170170,
    "duration": 195893093,
    "request": "{\"Region\":\"EU\",\"ClusterInst\":{\"key\":{\"cluster_key\":{\"name\":\"mextestpaulokubernetes\"},\"cloudlet_key\":{\"organization\":\"TDG\",\"name\":\"dusseldorf-main\"},\"organization\":\"demoorg\"},\"flavor\":{\"name\":\"m4.medium\"},\"ip_access\":1,\"deployment\":\"kubernetes\",\"num_masters\":1,\"num_nodes\":1,\"status\":{}}}",
    "response": "{\"code\":200,\"data\":{\"message\":\"Creating\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating Heat Stack for dusseldorf-main-mextestpaulokubernetes-demoorg\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating Heat Stack for dusseldorf-main-mextestpaulokubernetes-demoorg, Heat Stack Status: CREATE_IN_PROGRESS\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating Heat Stack for dusseldorf-main-mextestpaulokubernetes-demoorg, Heat Stack Status: CREATE_COMPLETE\"}}\n{\"code\":200,\"data\":{\"message\":\"Setting Up Root LB\"}}\n{\"code\":200,\"data\":{\"message\":\"Waiting for Cluster to Initialize\"}}\n{\"code\":200,\"data\":{\"message\":\"Waiting for Cluster to Initialize, Checking Master for Available Nodes\"}}\n{\"code\":200,\"data\":{\"message\":\"Waiting for Cluster to Initialize, 1 of 1 nodes active\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating config map\"}}\n{\"code\":200,\"data\":{\"message\":\"Ready\"}}\n{\"code\":200,\"data\":{\"message\":\"Created ClusterInst successfully\"}}",
    "error": "",
    "traceid": "2089b303b0000cc3"
  },
  {
    "operationname": "/ws/api/v1/auth/ctrl/CreateAppInst",
    "username": "demo",
    "clientip": "172.17.0.1",
    "status": 200,
    "starttime": 1592844780789615,
    "duration": 1705256,
    "request": "{\"Region\":\"EU\",\"AppInst\":{\"key\":{\"app_key\":{\"organization\":\"demoorg\",\"name\":\"mexfastapi\",\"version\":\"7.0\"},\"cluster_inst_key\":{\"cluster_key\":{\"name\":\"paulotestcluster\"},\"cloudlet_key\":{\"organization\":\"TDG\",\"name\":\"dusseldorf-main\"},\"organization\":\"demoorg\"}},\"cloudlet_loc\":{},\"mapped_ports\":null,\"flavor\":{},\"runtime_info\":{},\"created_at\":{},\"status\":{}}}",
    "response": "{\"code\":400,\"data\":{\"message\":\"Cannot deploy kubernetes App into docker ClusterInst\"}}",
    "error": "",
    "traceid": "4f15595e9d6ed33e"
  },
  {
    "operationname": "/ws/api/v1/auth/ctrl/CreateClusterInst",
    "username": "demo",
    "clientip": "172.17.0.1",
    "status": 200,
    "starttime": 1592844452756173,
    "duration": 66889355,
    "request": "{\"Region\":\"EU\",\"ClusterInst\":{\"key\":{\"cluster_key\":{\"name\":\"paulotestcluster\"},\"cloudlet_key\":{\"organization\":\"TDG\",\"name\":\"dusseldorf-main\"},\"organization\":\"demoorg\"},\"flavor\":{\"name\":\"m4.medium\"},\"ip_access\":1,\"deployment\":\"docker\",\"status\":{}}}",
    "response": "{\"code\":200,\"data\":{\"message\":\"Creating\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating Dedicated VM for Docker\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating Heat Stack for dusseldorf-main-paulotestcluster-demoorg\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating Heat Stack for dusseldorf-main-paulotestcluster-demoorg, Heat Stack Status: CREATE_IN_PROGRESS\"}}\n{\"code\":200,\"data\":{\"message\":\"Creating Heat Stack for dusseldorf-main-paulotestcluster-demoorg, Heat Stack Status: CREATE_COMPLETE\"}}\n{\"code\":200,\"data\":{\"message\":\"Setting Up Root LB\"}}\n{\"code\":200,\"data\":{\"message\":\"Ready\"}}\n{\"code\":200,\"data\":{\"message\":\"Created ClusterInst successfully\"}}",
    "error": "",
    "traceid": "4dc36ef8c437ddac"
  }
]