Report Site Insights


Exercise

Steps:

  1. Open the ​config.py​ file in the Python sandbox below. This is the global configuration file containing your Mist API Token, Mist UUIDs, Gmail credentials, and more.

  2. Update the ​gmail_id​ (username) and ​gmail_password​ (password) variables in the config.py file with your Gmail credentials. These are used to authenticate with the SMTP server and send email reports.

  3. Open the Mist web UI, navigate to Monitor, and select the Insights tab to see the site insights. Scroll to the bottom of the page for graphs of Pre-connection and Post-connection data.

  4. Modify main.py​ in the Python sandbox to include the email address which will receive the emailed report. This is saved under the ​recipient​ variable.

  5. Run main.py below and observe the following:

    • Call “Insights” REST API to get site statistics, focusing on Pre-connection latencies and Post-connection clients.
    • Process the JSON response object and print output to the console window.
    • Send email report containing the client and latency information.
  6. Check the email recipient’s Inbox to see the final report.