1、#CiscoLive#CiscoLiveJon Hartman,Meraki TSA,CCIE 34941techdojoDEVNET-2177Simplicity at ScaleMeraki 202:Programmatic Action 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveEnter your personal notes hereCisco Webex App 3Questions?Use Cisco Webex App to chat with the speaker a
2、fter the sessionFind this session in the Cisco Live Mobile AppClick“Join the Discussion”Install the Webex App or go directly to the Webex spaceEnter messages/questions in the Webex spaceHowWebex spaces will be moderated by the speaker until June 9,2023.12343https:/ 2023 Cisco and/or its affiliates.A
3、ll rights reserved.Cisco PublicDEVNET-2177Agenda 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicIntroductionMechanismsExamplesConclusionDEVNET-21774 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveIn the beginning5DEVNET-2177 2023 Cisco and/or its affilia
4、tes.All rights reserved.Cisco Public#CiscoLiveIn the beginning6DEVNET-2177$BSS/BSS/OSSOSSMXMSMRMVMTMGHarvesterHarvesterCollectorCollector 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveIn the beginning7DEVNET-2177$BSS/BSS/OSSOSSMXMSMRMVMTMGHarvesterHarvesterCollectorColle
5、ctor 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveBusiness Outcomes8DEVNET-2177Data+Action=Result 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveBusiness Outcomes9DEVNET-2177Data+Action=Result 2023 Cisco and/or its affiliates.All rights reser
6、ved.Cisco Public#CiscoLiveBusiness Outcomes10DEVNET-2177Data+Action=ResultlocationstatuscounteventType?receivefetchstreamMethod?2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveBusiness Outcomes11DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABill
7、ingMonitoringPerformanceReportingService 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveBusiness Outcomes12DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABillingMonitoringPerformanceReportingServiceStoreProcess 2023 Cisco and/or its affiliates.A
8、ll rights reserved.Cisco Public#CiscoLiveBusiness Outcomes13DEVNET-2177locationstatuscounteventreceivefetchstreamAAABillingMonitoringPerformanceReportingServiceExample 1:Simple Logging 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE1:Simple Logging15DEVNET-217700:00:46:%
9、LINK-3-UPDOWN:Interface Port-channel1,changed state to down1.3.6.1.4.1.9.9.43.2.0.1 ciscoConfigManEventSyslogSNMP Traps 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE1:Simple Logging16DEVNET-2177sharedSecret:abc123,sentAt:2022-09-07T14:14:14.568284Z,organizationId:29304
10、18,organizationName:My organization,networkId:N_24329156,networkName:Main Office,deviceSerial:Q234-ABCD-5678,deviceName:My appliance,deviceModel:MX,alertTypeId:cellular_down,occurredAt:2018-02-11T00:00:00.123450Z,Webhook 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE1:S
11、imple Logging17DEVNET-2177sharedSecret:abc123,sentAt:2022-09-07T14:14:14.568284Z,organizationId:2930418,organizationName:My organization,networkId:N_24329156,networkName:Main Office,deviceSerial:Q234-ABCD-5678,deviceName:My appliance,deviceModel:MX,alertTypeId:cellular_down,occurredAt:2023-01-25T06:
12、47:32.123450Z,Webhook 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE1:Simple Logging18DEVNET-2177from flask import Flask,requestapp=Flask(_name_)app.route(/,methods=POST)def logging():with open(/tmp/logfile,a)as logfile:logfile.writelines(frequest.jsonoccurredAt freques
13、t.jsonalertTypeId frequest.jsondeviceNamen)return Success.Webhook 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE1:Simple Logging19DEVNET-21772023-01-25T01:36:12.527870Z power_supply_down Gateway McGatewayface2023-01-25T01:36:34.218564Z power_supply_down Gateway McGatewa
14、yface2023-01-25T01:36:50.113615Z power_supply_down Gateway McGatewayfaceLogfileExample 2:IM Notifications 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE2:IM Notifications21DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABillingMonitoringPerform
15、anceReportingServiceStoreProcess 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE2:IM Notifications22DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABillingMonitoringPerformanceReportingServiceStoreProcess 2023 Cisco and/or its affiliates.All rig
16、hts reserved.Cisco Public#CiscoLiveE2:IM Notifications23DEVNET-2177eventReportingWebhook 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE2:IM Notifications24DEVNET-2177 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicE2:IM Notifications25DEVNET-2177L_1234
17、567890987654321Q201-2345-6789 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE2:IM NotificationseventReporting26DEVNET-2177 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE2:IM Notifications27DEVNET-2177Data+Action=ResulteventreceiveReportingPr
18、ocessExample 3:Metric Display 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE3:Metric Display29DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABillingMonitoringPerformanceReportingServiceStoreProcess 2023 Cisco and/or its affiliates.All rights r
19、eserved.Cisco Public#CiscoLiveE3:Metric Display30DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABillingMonitoringPerformanceReportingServiceStoreProcess 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE3:Metric Display31DEVNET-2177Data+Action=Res
20、ultstatuscounteventfetchPerformanceStore 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE3:Metric Display32DEVNET-2177MRMVMT 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLive33E3:Metric DisplayDEVNET-2177 2023 Cisco and/or its affiliates.All righ
21、ts reserved.Cisco Public#CiscoLiveE3:Metric Display34DEVNET-2177https:/ 4:Person Detector 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE4:Person Detector36DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABillingMonitoringPerformanceReportingServ
22、iceStoreProcess 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE4:Person Detector37DEVNET-2177Data+Action=ResultlocationstatuscounteventreceivefetchstreamAAABillingMonitoringPerformanceReportingServiceStoreProcess 2023 Cisco and/or its affiliates.All rights reserved.Cisco
23、 Public#CiscoLiveE4:Person Detector38DEVNET-2177Data+Action=ResultcountstreamMonitoringProcess 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE4:Person Detector39DEVNET-2177RPi0wBlynclightHostDisplayAPIUSBhttp:/10.10.10.15:8888/light/0/on/greenRequestRequestlight_id:0,act
24、ion:on,color:greenResponseResponse 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLivePublisherE4:Person Detector40DEVNET-2177BrokerMQTT/merakimv/Q2EV-R6FG-BCSV/raw_detections objects:,ts:1673550196021/merakimv/Q2EV-R6FG-BCSV/0 ts:1673550196820,counts:person:0/merakimv/Q2EV-R
25、6FG-BCSV/light lux:6.2/merakimv/Q2EV-R6FG-BCSV/audio_analytics audioLevel:-61,ts:1673550196836 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLivePublisherE4:Person Detector41DEVNET-2177BrokerMQTT/merakimv/Q2EV-R6FG-BCSV/raw_detections objects:,ts:1673550196021/merakimv/Q2EV-
26、R6FG-BCSV/0 ts:1673550196820,counts:person:0/merakimv/Q2EV-R6FG-BCSV/light lux:6.2/merakimv/Q2EV-R6FG-BCSV/audio_analytics audioLevel:-61,ts:1673550196836 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLivePublisherE4:Person Detector42DEVNET-2177RPi0wBlynclightBrokerHostDispl
27、ayMQTTAPIUSB 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLivePublisherE4:Person Detector43DEVNET-2177RPi0wBlynclightPython ScriptSubscriberBrokerHostDisplayMQTTMQTTAPIUSB 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE4:Person Detector44DEVNET-
28、2177Python ScriptSubscribe to MQTT topic/merakimv/+/0Add people counts from every camera for last secondIf count 0&color is red,change it to green via API.If count=0&color is green,change it to red via API.2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLivePublisherPublisherE
29、4:Person Detector45DEVNET-2177RPi0wRPi0wBlynclightBlynclightPython Python ScriptScriptSubscriberSubscriberBrokerBrokerHostHostDisplayDisplayMQTTMQTTMQTTMQTTAPIAPIUSBUSB 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLivePublisherPublisherE4:Person Detector46DEVNET-2177RPi0wRP
30、i0wBlynclightBlynclightPython Python ScriptScriptSubscriberSubscriberBrokerBrokerHostHostDisplayDisplayMQTTMQTTMQTTMQTTAPIAPIUSBUSB 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveE4:Person Detector47DEVNET-2177http:/cs.co/meraki-kbyg Overview Libraries CodeConclusion 2023
31、 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveFinal thoughtsStart with an objective.Find a project home.(GitHub,VM)Elevate:API budget,action batches,SDK.Use your imagination!49DEVNET-2177 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveFill out you
32、r session surveys!Attendees who fill out a minimum of four session surveys and the overall event survey will get Cisco Live-branded socks(while supplies last)!50DEVNET-2177These points help you get on the leaderboard and increase your chances of winning daily and grand prizesAttendees will also earn
33、 100 points in theCisco Live Challenge for every survey completed.2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicContinue your educationVisit the Cisco Showcase for related demosBook your one-on-oneMeet the Engineer meetingAttend the interactive education with DevNet,Capture the Fl
34、ag,and Walk-in LabsVisit the On-Demand Library for more sessions at www.CiscoL you#CiscoLive 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLive53Gamify your Cisco Live experience!Get points Get points for attending this session!for attending this session!Open the Cisco Events App.Click on Cisco Live Challenge in the side menu.Click on View Your Badges at the top.Click the+at the bottom of the screen and scan the QR code:How:123453 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicDEVNET-2177#CiscoLive