nerdexam
CiscoCisco

300-835 · Question #58

300-835 Question #58: Real Exam Question with Answer & Explanation

Completed Python script: ``python import requests import xml.etree.ElementTree as ET import sched,time from sched import scheduler import time def main(sc): url = 'https://192.168.159.12/status.xml' payload = { "Authorization": "Basic RTAwMjZhMDhJVjIyVVlQ==", } response = request

Collaboration Endpoints

Question

A software engineer must configure a Cisco TelePresence device and custom reporting dashboard to retrieve and display the temperature of the device every minute. Drag and drop the code snippets from the bottom onto the boxes in the code to collect and send the data by using the xAPI. Not all options are used.

Explanation

Completed Python script:

import requests
import xml.etree.ElementTree as ET
import sched,time
from sched import scheduler
import time

def main(sc):
    url = 'https://192.168.159.12/status.xml'
    payload = {
        "Authorization": "Basic RTAwMjZhMDhJVjIyVVlQ==",
    }
    response = requests.get(url, headers=payload)
    
    tree = ET.fromstring(response.text)
    current_temp = tree.find('SystemUnit').find('Hardware').find('Temperature').find('Threshold').find('Status').text
    threshold_temp = tree.find('SystemUnit').find('Hardware').find('Temperature').find('Threshold').text
    
    if float(current_temp) > float(threshold_temp):
        print("Temperature too high.")
    
    s.enter(60, 1, main, (sc,))

s = scheduler(time.time, time.sleep)
s.enter(60, 1, main, (s,))
s.run()

Topics

#xAPI#Endpoint Monitoring#Data Collection#TelePresence Devices

Community Discussion

No community discussion yet for this question.

Full 300-835 PracticeBrowse All 300-835 Questions