Tom Lasswell

Members
  • Content count

    101
  • Joined

  • Last visited

  • Days Won

    12

Community Reputation

21 Excellent

About Tom Lasswell

  • Rank
    Community All Star

Recent Profile Visitors

930 profile views
  1. multiple parallel datapoint thresholds

    As a workaround, typically we create a "cloned" datapoint that allows for the alerts to go for different threshold responses.
  2. LogicMonitor Portal Metrics

    Found it it's in the call to LM, int itemsPerPage = 800
  3. LogicMonitor Portal Metrics

    @Kerry DeVilbiss this is awesome. Question for y'all on this, the total alert count looks to be maxing at 800. I haven't done any troubleshooting yet to see if that's just what it's reporting, but curious if that's a limitation somewhere in the script.
  4. Warning

    @farnaz It's in the recently deleted area.
  5. Ad-hoc script running

    @mnagel that's a good point. Opsnotes would be great to put an alert was generated and these were the processes working there, I pieced together a small powershell script that uses perfmon (so we can get the % without any additional calculations) you could convert this to groovy with a wmi query and use a complex datapoint with a groovy calculation with an if cpu datapoint is x then calculate and post the opsnote to the device. Obviously this would need to be adjusted to fit LM wildcards and parameters. $Cred = (Get-Credential) #New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User, $Pass $HostList =@('server1','server2') foreach ($CurrHost in $HostList) { if((Test-Connection -Cn $CurrHost -BufferSize 16 -Count 1 -ea 0 -quiet)) { (gwmi Win32_PerfFormattedData_PerfProc_Process) | foreach {if ($_.PercentProcessorTime -gt 1) { $_.name + " " + $_.PercentProcessorTime }} } } I've got a conference this week where I'll have some time may work on this. This is one of the biggest things for our engineers is capturing the processes as they're running when the alert triggers, most often times we miss it.
  6. Ad-hoc script running

    @Mike Suding I saw this before, thinking about modifying this idea into pushing a configsource query and grabbing it that way. @mnagel opsnotes seems like an interesting idea as well
  7. Cisco Firepower data source

    @Kerry DeVilbiss I believe we have one in our dev environment. would be open to help test. REST APIs on these Cisco products are getting much better than using SNMP for sure.
  8. @viresh18 this is a great question, you're referencing the RPC API however, I'm not sure about the data ingest portion of Grafana but REST is the way to go now for the data. The REST get data methods are far better and provides better JSON as well as a CSV output for processing. Be aware there are limits on your API queries, so you'll want to define these in a way where you don't hit your limits. these articles should give you some info: https://grafana.com/plugins/grafana-simple-json-datasource https://community.grafana.com/t/grafana-simplejson-dashboard/5627/2 I'd love to see if you end up with anything useful using Grafana.
  9. Cisco ACI monitoring documenation

    @Brent Reeves ACI monitoring is a quite complicated area. We've developed some custom things around the way we want to monitor and document things, but I do have a few basic monitoring ones that I can share. It may take a while to go through security validation though on the LM side. Ultimately, building the datasources isn't highly complicated for getting the data out of the ACI console. My engineers are mostly versed in PowerShell so this example is how to login and pull data via REST from the APIC for data, but to find the calls you'd want to make you'd use dev tools in Chrome and watch the REST calls that it makes as you browse the pages for the data you'd want. Example: Get all interface statistics: Active Discovery: # This is where we save the cookies! $global:CookieJar = New-Object System.Net.CookieContainer $global:LoggedIn = $False $global:LoggingIn = $False function ACI-API-Call([string]$method, [string]$encoding, [string]$url, $headers, [string]$postData) { $return_value = New-Object PsObject -Property @{httpCode = ""; httpResponse = ""} ## Create the request [System.Net.HttpWebRequest] $request = [System.Net.HttpWebRequest] [System.Net.WebRequest]::Create($url) # Ignore SSL certificate errors [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} [System.Net.ServicePointManager]::SecurityProtocol = 3072 # <-- ACI NEEDS THIS!! # We want cookies! $request.CookieContainer = $global:CookieJar ## Add the method (GET, POST, etc.) $request.Method = $method ## Add an headers to the request foreach($key in $headers.keys) { $request.Headers.Add($key, $headers[$key]) } # If we're logged in, add the saved cookies to this request if ($global:LoggedIn -eq $True) { $request.CookieContainer = $global:CookieJar $global:LoggingIn = $False } else { # We're not logged in to the APIC, start login first if($global:LoggingIn -eq $False) { $global:LoggingIn = $True ACI-Login $apic $username $password } } ## We are using $encoding for the request as well as the expected response $request.Accept = $encoding ## Send a custom user agent if you want $request.UserAgent = "PowerShell script" ## Create the request body if the verb accepts it (NOTE: utf-8 is assumed here) if ($method -eq "POST" -or $method -eq "PUT") { $bytes = [System.Text.Encoding]::UTF8.GetBytes($postData) $request.ContentType = $encoding $request.ContentLength = $bytes.Length [System.IO.Stream] $outputStream = [System.IO.Stream]$request.GetRequestStream() $outputStream.Write($bytes,0,$bytes.Length) $outputStream.Close() } ## This is where we actually make the call. try { [System.Net.HttpWebResponse] $response = [System.Net.HttpWebResponse] $request.GetResponse() foreach($cookie in $response.Cookies) { # We've found the APIC cookie and can conclude our login business if($cookie.Name -eq "APIC-cookie") { $global:LoggedIn = $True $global:LoggingIn = $False } } $sr = New-Object System.IO.StreamReader($response.GetResponseStream()) $txt = $sr.ReadToEnd() ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host "CONTENT-TYPE: " $response.ContentType ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host "RAW RESPONSE DATA:" . $txt ## Return the response body to the caller $return_value.httpResponse = $txt $return_value.httpCode = [int]$response.StatusCode return $return_value } ## This catches errors from the server (404, 500, 501, etc.) catch [Net.WebException] { [System.Net.HttpWebResponse] $resp = [System.Net.HttpWebResponse] $_.Exception.Response ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host $resp.StatusCode -ForegroundColor Red -BackgroundColor Yellow ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host $resp.StatusDescription -ForegroundColor Red -BackgroundColor Yellow ## Return the error to the caller # if the APIC returns a 403, the session most likely has been expired. Login again and rerun the API call if($resp.StatusCode -eq 403) { # We do this by resetting the global login variables and simply call the ACI-API-Call function again $global:LoggedIn = $False $global:LoggingIn = $False ACI-API-Call $method $encoding $url $headers $postData } $return_value.httpResponse = $resp.StatusDescription $return_value.httpCode = [int]$resp.StatusCode return $return_value } } # Use this function to login to the APIC function ACI-Login([string]$apic, [string]$username, [string]$password) { # This is the URL we're going to be logging in to $loginurl = "https://" + $apic + "/api/aaaLogin.xml" # Format the XML body for a login $creds = '<aaaUser name="' + $username + '" pwd="' + $password + '"/>' # Execute the API Call $result = ACI-API-Call "POST" "application/xml" $loginurl "" $creds if($result.httpResponse.Contains("Unauthorized")) { Write-Host "Authentication to APIC failed!" result 1 Exit } else { #Write-Host "Authenticated to the APIC!" } } $apic = "##system.hostname##" $username = "##aci.user##" $password = "##aci.pass##" ACI-Login $apic $username $password $url = "https://##system.hostname##/api/node/mo/topology/pod-1.json?query-target=children&target-subtree-class=fabricNode&query-target-filter=and(ne(fabricNode.role,%22controller%22))" $result = ACI-API-Call "GET" "application/json" $url "" $resultjson = $result.httpResponse | ConvertFrom-Json foreach ($nodeinfo in $resultjson.imdata) { $node = "node-$($nodeinfo.fabricNode.attributes.id)" ACI-Login $apic $username $password $url = "https://##system.hostname##/api/node/class/topology/pod-1/$node/l1PhysIf.json" $result2 = ACI-API-Call "GET" "application/json" $url "" $result2json = $result2.httpResponse | ConvertFrom-Json foreach ($data in $result2json.imdata) { $dn = $data.l1PhysIf.attributes.dn $url = "https://##system.hostname##/api/node/mo/$dn/phys.json" $result6 = ACI-API-Call "GET" "application/json" $url "" $result6json = $result6.httpResponse | ConvertFrom-Json $etherinfo = $result6json.imdata[0].ethpmPhysIf.attributes $unique = $($node + $($data.l1PhysIf.attributes.id)).replace("/","").Replace("-","") $ilps = "auto.nodename=$node" $ilps += "&auto.portoperSt=$($etherinfo.operSt)" $ilps += "&auto.portaccessVlan=$($etherinfo.accessVlan)" $ilps += "&auto.portallowedVlans=$($etherinfo.allowedVlans)" $ilps += "&auto.portadminSt=$($data.l1PhysIf.attributes.adminSt)" $ilps += "&auto.portautoNeg=$($data.l1PhysIf.attributes.autoNeg)" $ilps += "&auto.portbrkoutMap=$($data.l1PhysIf.attributes.brkoutMap)" $ilps += "&auto.portdn=$($data.l1PhysIf.attributes.dn)" $ilps += "&auto.portdescripton=$($data.l1PhysIf.attributes.descr)" $ilps += "&auto.portfecMode=$($data.l1PhysIf.attributes.fecMode)" $ilps += "&auto.portlayer=$($data.l1PhysIf.attributes.layer)" $ilps += "&auto.portlinkDebounce=$($data.l1PhysIf.attributes.linkDebounce)" $ilps += "&auto.portmdix=$($data.l1PhysIf.attributes.mdix)" $ilps += "&auto.portmedium=$($data.l1PhysIf.attributes.medium)" $ilps += "&auto.portmode=$($data.l1PhysIf.attributes.mode)" $ilps += "&auto.portmtu=$($data.l1PhysIf.attributes.mtu)" $ilps += "&auto.portportT=$($data.l1PhysIf.attributes.portT)" $ilps += "&auto.portprioFlowCtrl=$($data.l1PhysIf.attributes.prioFlowCtrl)" $ilps += "&auto.portspanMode=$($data.l1PhysIf.attributes.spanMode)" $ilps += "&auto.portspeed=$($data.l1PhysIf.attributes.speed)" $ilps += "&auto.portswitchingSt=$($data.l1PhysIf.attributes.switchingSt)" $ilps += "&auto.porttrunkLog=$($data.l1PhysIf.attributes.trunkLog)" $ilps += "&auto.portusage=$($data.l1PhysIf.attributes.usage)" $unique = $($node + $($data.l1PhysIf.attributes.id)).replace("/","").Replace("-","") write-host "$unique##$($node)_$($data.l1PhysIf.attributes.id)##$($data.l1PhysIf.attributes.descr)####$ilps" } } Collection: # This is where we save the cookies! $global:CookieJar = New-Object System.Net.CookieContainer $global:LoggedIn = $False $global:LoggingIn = $False function ACI-API-Call([string]$method, [string]$encoding, [string]$url, $headers, [string]$postData) { $return_value = New-Object PsObject -Property @{httpCode = ""; httpResponse = ""} ## Create the request [System.Net.HttpWebRequest] $request = [System.Net.HttpWebRequest] [System.Net.WebRequest]::Create($url) # Ignore SSL certificate errors [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} [System.Net.ServicePointManager]::SecurityProtocol = 3072 # <-- ACI NEEDS THIS!! # We want cookies! $request.CookieContainer = $global:CookieJar ## Add the method (GET, POST, etc.) $request.Method = $method ## Add an headers to the request foreach($key in $headers.keys) { $request.Headers.Add($key, $headers[$key]) } # If we're logged in, add the saved cookies to this request if ($global:LoggedIn -eq $True) { $request.CookieContainer = $global:CookieJar $global:LoggingIn = $False } else { # We're not logged in to the APIC, start login first if($global:LoggingIn -eq $False) { $global:LoggingIn = $True ACI-Login $apic $username $password } } ## We are using $encoding for the request as well as the expected response $request.Accept = $encoding ## Send a custom user agent if you want $request.UserAgent = "PowerShell script" ## Create the request body if the verb accepts it (NOTE: utf-8 is assumed here) if ($method -eq "POST" -or $method -eq "PUT") { $bytes = [System.Text.Encoding]::UTF8.GetBytes($postData) $request.ContentType = $encoding $request.ContentLength = $bytes.Length [System.IO.Stream] $outputStream = [System.IO.Stream]$request.GetRequestStream() $outputStream.Write($bytes,0,$bytes.Length) $outputStream.Close() } ## This is where we actually make the call. try { [System.Net.HttpWebResponse] $response = [System.Net.HttpWebResponse] $request.GetResponse() foreach($cookie in $response.Cookies) { # We've found the APIC cookie and can conclude our login business if($cookie.Name -eq "APIC-cookie") { $global:LoggedIn = $True $global:LoggingIn = $False } } $sr = New-Object System.IO.StreamReader($response.GetResponseStream()) $txt = $sr.ReadToEnd() ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host "CONTENT-TYPE: " $response.ContentType ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host "RAW RESPONSE DATA:" . $txt ## Return the response body to the caller $return_value.httpResponse = $txt $return_value.httpCode = [int]$response.StatusCode return $return_value } ## This catches errors from the server (404, 500, 501, etc.) catch [Net.WebException] { [System.Net.HttpWebResponse] $resp = [System.Net.HttpWebResponse] $_.Exception.Response ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host $resp.StatusCode -ForegroundColor Red -BackgroundColor Yellow ## NOTE: comment out the next line if you don't want this function to print to the terminal #Write-Host $resp.StatusDescription -ForegroundColor Red -BackgroundColor Yellow ## Return the error to the caller # if the APIC returns a 403, the session most likely has been expired. Login again and rerun the API call if($resp.StatusCode -eq 403) { # We do this by resetting the global login variables and simply call the ACI-API-Call function again $global:LoggedIn = $False $global:LoggingIn = $False ACI-API-Call $method $encoding $url $headers $postData } $return_value.httpResponse = $resp.StatusDescription $return_value.httpCode = [int]$resp.StatusCode return $return_value } } # Use this function to login to the APIC function ACI-Login([string]$apic, [string]$username, [string]$password) { # This is the URL we're going to be logging in to $loginurl = "https://" + $apic + "/api/aaaLogin.xml" # Format the XML body for a login $creds = '<aaaUser name="' + $username + '" pwd="' + $password + '"/>' # Execute the API Call $result = ACI-API-Call "POST" "application/xml" $loginurl "" $creds if($result.httpResponse.Contains("Unauthorized")) { Write-Host "Authentication to APIC failed!" result 1 Exit } else { #Write-Host "Authenticated to the APIC!" } } $apic = "##system.hostname##" $username = "##aci.user##" $password = "##aci.pass##" ACI-Login $apic $username $password $url = "https://##system.hostname##/api/node/mo/topology/pod-1.json?query-target=children&target-subtree-class=fabricNode&query-target-filter=and(ne(fabricNode.role,%22controller%22))" $result = ACI-API-Call "GET" "application/json" $url "" $resultjson = $result.httpResponse | ConvertFrom-Json foreach ($nodeinfo in $resultjson.imdata) { $node = "node-$($nodeinfo.fabricNode.attributes.id)" ACI-Login $apic $username $password $url = "https://##system.hostname##/api/node/class/topology/pod-1/$node/l1PhysIf.json?rsp-subtree-include=health" $result2 = ACI-API-Call "GET" "application/json" $url "" $result2json = $result2.httpResponse | ConvertFrom-Json foreach ($data in $result2json.imdata) { $unique = $($node + $($data.l1PhysIf.attributes.id)).replace("/","").Replace("-","") $dn = $data.l1PhysIf.attributes.dn $url = "https://##system.hostname##/api/node/mo/$dn/phys.json" $result6 = ACI-API-Call "GET" "application/json" $url "" $result6json = $result6.httpResponse | ConvertFrom-Json $etherinfo = $result6json.imdata[0].ethpmPhysIf.attributes if ($etherinfo.operSpeed -eq "inherit") {write-host "$unique.basicspeed=10737418240"} if ($etherinfo.operSpeed -eq "10G") {write-host "$unique.basicspeed=10737418240"} if ($etherinfo.operSpeed -eq "1G") {write-host "$unique.basicspeed=1073741824"} if ($etherinfo.operSpeed -eq "100M") {write-host "$unique.basicspeed=104857600"} if ($etherinfo.operSt -ne "up") {write-host "$unique.operSt=1"} if ($etherinfo.operSt -eq "up") {write-host "$unique.operSt=0"} write-host "$unique.operStQualCode=$($etherinfo.operStQualCode)" if ($etherinfo.operSt -eq "up") { $url = "https://##system.hostname##/api/node/mo/$dn/dbgEtherStats.json" $result3 = ACI-API-Call "GET" "application/json" $url "" $result3json = $result3.httpResponse | ConvertFrom-Json $etherstats = $result3json.imdata[0].rmonEtherStats.attributes if ($($data.l1PhysIf.attributes.adminSt) -ne "up") { write-host "$unique.adminSt=1" } if ($($data.l1PhysIf.attributes.adminSt) -eq "up") { write-host "$unique.adminSt=0" } write-host "$unique.healthScore=$($data.l1PhysIf.children[0].healthInst.attributes.cur)" write-host "$unique.broadcastPkts=$($etherstats.broadcastPkts)" write-host "$unique.cRCAlignErrors=$($etherstats.cRCAlignErrors)" write-host "$unique.collisions=$($etherstats.collisions)" write-host "$unique.dropEvents=$($etherstats.dropEvents)" write-host "$unique.fragments=$($etherstats.fragments)" write-host "$unique.jabbers=$($etherstats.jabbers)" write-host "$unique.multicastPkts=$($etherstats.multicastPkts)" write-host "$unique.octets=$($etherstats.octets)" write-host "$unique.oversizePkts=$($etherstats.oversizePkts)" write-host "$unique.pkts=$($etherstats.pkts)" write-host "$unique.pkts1024to1518Octets=$($etherstats.pkts1024to1518Octets)" write-host "$unique.pkts128to255Octets=$($etherstats.pkts128to255Octets)" write-host "$unique.pkts256to511Octets=$($etherstats.pkts256to511Octets)" write-host "$unique.pkts64Octets=$($etherstats.pkts64Octets)" write-host "$unique.pkts65to127Octets=$($etherstats.pkts65to127Octets)" write-host "$unique.rXNoErrors=$($etherstats.rXNoErrors)" write-host "$unique.rxOversizePkts=$($etherstats.rxOversizePkts)" write-host "$unique.tXNoErrors=$($etherstats.tXNoErrors)" write-host "$unique.txOversizePkts=$($etherstats.txOversizePkts)" write-host "$unique.undersizePkts=$($etherstats.undersizePkts)" $url = "https://##system.hostname##/api/node/mo/$dn/dbgIfIn.json" $result4 = ACI-API-Call "GET" "application/json" $url "" $result4json = $result4.httpResponse | ConvertFrom-Json $etherinstats = $result4json.imdata[0].rmonIfIn.attributes write-host "$unique.inbroadcastPkts=$($etherinstats.broadcastPkts)" write-host "$unique.indiscards=$($etherinstats.discards)" write-host "$unique.inerrors=$($etherinstats.errors)" write-host "$unique.inmulticastPkts=$($etherinstats.multicastPkts)" write-host "$unique.innUcastPkts=$($etherinstats.nUcastPkts)" write-host "$unique.inoctets=$($etherinstats.octets)" write-host "$unique.inucastPkts=$($etherinstats.ucastPkts)" $url = "https://##system.hostname##/api/node/mo/$dn/dbgIfOut.json" $result5 = ACI-API-Call "GET" "application/json" $url "" $result5json = $result5.httpResponse | ConvertFrom-Json $etheroutstats = $result5json.imdata[0].rmonIfOut.attributes write-host "$unique.outbroadcastPkts=$($etheroutstats.broadcastPkts)" write-host "$unique.outdiscards=$($etheroutstats.discards)" write-host "$unique.outerrors=$($etheroutstats.errors)" write-host "$unique.outmulticastPkts=$($etheroutstats.multicastPkts)" write-host "$unique.outnUcastPkts=$($etheroutstats.nUcastPkts)" write-host "$unique.outoctets=$($etheroutstats.octets)" write-host "$unique.outucastPkts=$($etheroutstats.ucastPkts)" } } } Full XML: <?xml version="1.0" encoding="UTF-8" ?> <feed version="1.0" hasPendingRequests="false" > <company></company> <status>200</status> <errmsg>OK</errmsg> <interval>0</interval> <entry type="predatasource"> <version>1516221145</version> <name>Cisco ACI Fabric Physical Interfaces-</name> <displayedas>Physical Interfaces-</displayedas> <description>Checks the ACI Physical Interfaces</description> <collector>batchscript</collector> <hasMultiInstances>true</hasMultiInstances> <schedule>180</schedule> <appliesTo>aci.user &#38;&#38; aci.pass</appliesTo> <wildcardauto>true</wildcardauto> <wildcardpersist>false</wildcardpersist> <wildcardlinuxscript>ad_script</wildcardlinuxscript> <wildcardlinuxcmdline>type=&#34;powerShell&#34; </wildcardlinuxcmdline> <wildcardwinscript>ad_script</wildcardwinscript> <wildcardwincmdline>type=&#34;powerShell&#34; </wildcardwincmdline> <wildcardgroovyscript># This is where we save the cookies! $global:CookieJar = New-Object System.Net.CookieContainer $global:LoggedIn = $False $global:LoggingIn = $False function ACI-API-Call([string]$method, [string]$encoding, [string]$url, $headers, [string]$postData) { $return_value = New-Object PsObject -Property @{httpCode = &#34;&#34;; httpResponse = &#34;&#34;} ## Create the request [System.Net.HttpWebRequest] $request = [System.Net.HttpWebRequest] [System.Net.WebRequest]::Create($url) # Ignore SSL certificate errors [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} [System.Net.ServicePointManager]::SecurityProtocol = 3072 # &#60;-- ACI NEEDS THIS!! # We want cookies! $request.CookieContainer = $global:CookieJar ## Add the method (GET, POST, etc.) $request.Method = $method ## Add an headers to the request foreach($key in $headers.keys) { $request.Headers.Add($key, $headers[$key]) } # If we&#39;re logged in, add the saved cookies to this request if ($global:LoggedIn -eq $True) { $request.CookieContainer = $global:CookieJar $global:LoggingIn = $False } else { # We&#39;re not logged in to the APIC, start login first if($global:LoggingIn -eq $False) { $global:LoggingIn = $True ACI-Login $apic $username $password } } ## We are using $encoding for the request as well as the expected response $request.Accept = $encoding ## Send a custom user agent if you want $request.UserAgent = &#34;PowerShell script&#34; ## Create the request body if the verb accepts it (NOTE: utf-8 is assumed here) if ($method -eq &#34;POST&#34; -or $method -eq &#34;PUT&#34;) { $bytes = [System.Text.Encoding]::UTF8.GetBytes($postData) $request.ContentType = $encoding $request.ContentLength = $bytes.Length [System.IO.Stream] $outputStream = [System.IO.Stream]$request.GetRequestStream() $outputStream.Write($bytes,0,$bytes.Length) $outputStream.Close() } ## This is where we actually make the call. try { [System.Net.HttpWebResponse] $response = [System.Net.HttpWebResponse] $request.GetResponse() foreach($cookie in $response.Cookies) { # We&#39;ve found the APIC cookie and can conclude our login business if($cookie.Name -eq &#34;APIC-cookie&#34;) { $global:LoggedIn = $True $global:LoggingIn = $False } } $sr = New-Object System.IO.StreamReader($response.GetResponseStream()) $txt = $sr.ReadToEnd() ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host &#34;CONTENT-TYPE: &#34; $response.ContentType ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host &#34;RAW RESPONSE DATA:&#34; . $txt ## Return the response body to the caller $return_value.httpResponse = $txt $return_value.httpCode = [int]$response.StatusCode return $return_value } ## This catches errors from the server (404, 500, 501, etc.) catch [Net.WebException] { [System.Net.HttpWebResponse] $resp = [System.Net.HttpWebResponse] $_.Exception.Response ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host $resp.StatusCode -ForegroundColor Red -BackgroundColor Yellow ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host $resp.StatusDescription -ForegroundColor Red -BackgroundColor Yellow ## Return the error to the caller # if the APIC returns a 403, the session most likely has been expired. Login again and rerun the API call if($resp.StatusCode -eq 403) { # We do this by resetting the global login variables and simply call the ACI-API-Call function again $global:LoggedIn = $False $global:LoggingIn = $False ACI-API-Call $method $encoding $url $headers $postData } $return_value.httpResponse = $resp.StatusDescription $return_value.httpCode = [int]$resp.StatusCode return $return_value } } # Use this function to login to the APIC function ACI-Login([string]$apic, [string]$username, [string]$password) { # This is the URL we&#39;re going to be logging in to $loginurl = &#34;https://&#34; + $apic + &#34;/api/aaaLogin.xml&#34; # Format the XML body for a login $creds = &#39;&#60;aaaUser name=&#34;&#39; + $username + &#39;&#34; pwd=&#34;&#39; + $password + &#39;&#34;/&#62;&#39; # Execute the API Call $result = ACI-API-Call &#34;POST&#34; &#34;application/xml&#34; $loginurl &#34;&#34; $creds if($result.httpResponse.Contains(&#34;Unauthorized&#34;)) { Write-Host &#34;Authentication to APIC failed!&#34; result 1 Exit } else { #Write-Host &#34;Authenticated to the APIC!&#34; } } $apic = &#34;##system.hostname##&#34; $username = &#34;##aci.user##&#34; $password = &#34;##aci.pass##&#34; ACI-Login $apic $username $password $url = &#34;https://##system.hostname##/api/node/mo/topology/pod-1.json?query-target=children&#38;target-subtree-class=fabricNode&#38;query-target-filter=and(ne(fabricNode.role,%22controller%22))&#34; $result = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $resultjson = $result.httpResponse | ConvertFrom-Json foreach ($nodeinfo in $resultjson.imdata) { $node = &#34;node-$($nodeinfo.fabricNode.attributes.id)&#34; ACI-Login $apic $username $password $url = &#34;https://##system.hostname##/api/node/class/topology/pod-1/$node/l1PhysIf.json&#34; $result2 = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $result2json = $result2.httpResponse | ConvertFrom-Json foreach ($data in $result2json.imdata) { $dn = $data.l1PhysIf.attributes.dn $url = &#34;https://##system.hostname##/api/node/mo/$dn/phys.json&#34; $result6 = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $result6json = $result6.httpResponse | ConvertFrom-Json $etherinfo = $result6json.imdata[0].ethpmPhysIf.attributes $unique = $($node + $($data.l1PhysIf.attributes.id)).replace(&#34;/&#34;,&#34;&#34;).Replace(&#34;-&#34;,&#34;&#34;) $ilps = &#34;auto.nodename=$node&#34; $ilps += &#34;&#38;auto.portoperSt=$($etherinfo.operSt)&#34; $ilps += &#34;&#38;auto.portaccessVlan=$($etherinfo.accessVlan)&#34; $ilps += &#34;&#38;auto.portallowedVlans=$($etherinfo.allowedVlans)&#34; $ilps += &#34;&#38;auto.portadminSt=$($data.l1PhysIf.attributes.adminSt)&#34; $ilps += &#34;&#38;auto.portautoNeg=$($data.l1PhysIf.attributes.autoNeg)&#34; $ilps += &#34;&#38;auto.portbrkoutMap=$($data.l1PhysIf.attributes.brkoutMap)&#34; $ilps += &#34;&#38;auto.portdn=$($data.l1PhysIf.attributes.dn)&#34; $ilps += &#34;&#38;auto.portdescripton=$($data.l1PhysIf.attributes.descr)&#34; $ilps += &#34;&#38;auto.portfecMode=$($data.l1PhysIf.attributes.fecMode)&#34; $ilps += &#34;&#38;auto.portlayer=$($data.l1PhysIf.attributes.layer)&#34; $ilps += &#34;&#38;auto.portlinkDebounce=$($data.l1PhysIf.attributes.linkDebounce)&#34; $ilps += &#34;&#38;auto.portmdix=$($data.l1PhysIf.attributes.mdix)&#34; $ilps += &#34;&#38;auto.portmedium=$($data.l1PhysIf.attributes.medium)&#34; $ilps += &#34;&#38;auto.portmode=$($data.l1PhysIf.attributes.mode)&#34; $ilps += &#34;&#38;auto.portmtu=$($data.l1PhysIf.attributes.mtu)&#34; $ilps += &#34;&#38;auto.portportT=$($data.l1PhysIf.attributes.portT)&#34; $ilps += &#34;&#38;auto.portprioFlowCtrl=$($data.l1PhysIf.attributes.prioFlowCtrl)&#34; $ilps += &#34;&#38;auto.portspanMode=$($data.l1PhysIf.attributes.spanMode)&#34; $ilps += &#34;&#38;auto.portspeed=$($data.l1PhysIf.attributes.speed)&#34; $ilps += &#34;&#38;auto.portswitchingSt=$($data.l1PhysIf.attributes.switchingSt)&#34; $ilps += &#34;&#38;auto.porttrunkLog=$($data.l1PhysIf.attributes.trunkLog)&#34; $ilps += &#34;&#38;auto.portusage=$($data.l1PhysIf.attributes.usage)&#34; $unique = $($node + $($data.l1PhysIf.attributes.id)).replace(&#34;/&#34;,&#34;&#34;).Replace(&#34;-&#34;,&#34;&#34;) write-host &#34;$unique##$($node)_$($data.l1PhysIf.attributes.id)##$($data.l1PhysIf.attributes.descr)####$ilps&#34; } } </wildcardgroovyscript> <wildcardschedule>1440</wildcardschedule> <wildcarddisable>false</wildcarddisable> <wildcarddeleteinactive>false</wildcarddeleteinactive> <agdmethod>ilp</agdmethod> <agdparams>auto.nodename</agdparams> <group>Cisco ACI Fabric</group> <tags></tags> <technology>requires powershell</technology> <adlist><![CDATA[{"agdmethod":"ilp","method":"ad_script","agdparams":"auto.nodename","id":0,"filters":[{"attribute":"auto.portoperSt","operation":"NotEqual","value":"down"}],"params":{"type":"powerShell","groovyscript":"# This is where we save the cookies!\r\n$global:CookieJar = New-Object System.Net.CookieContainer\r\n$global:LoggedIn = $False\r\n$global:LoggingIn = $False\r\n\r\nfunction ACI-API-Call([string]$method, [string]$encoding, [string]$url, $headers, [string]$postData)\r\n{\r\n $return_value = New-Object PsObject -Property @{httpCode = \"\"; httpResponse = \"\"}\r\n\r\n ## Create the request\r\n [System.Net.HttpWebRequest] $request = [System.Net.HttpWebRequest] [System.Net.WebRequest]::Create($url)\r\n\r\n # Ignore SSL certificate errors\r\n [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}\r\n [System.Net.ServicePointManager]::SecurityProtocol = 3072 # <-- ACI NEEDS THIS!!\r\n\r\n # We want cookies!\r\n $request.CookieContainer = $global:CookieJar\r\n\r\n ## Add the method (GET, POST, etc.)\r\n $request.Method = $method\r\n ## Add an headers to the request\r\n foreach($key in $headers.keys)\r\n {\r\n $request.Headers.Add($key, $headers[$key])\r\n }\r\n\r\n # If we're logged in, add the saved cookies to this request\r\n if ($global:LoggedIn -eq $True) {\r\n $request.CookieContainer = $global:CookieJar\r\n $global:LoggingIn = $False\r\n }\r\n else\r\n {\r\n # We're not logged in to the APIC, start login first\r\n if($global:LoggingIn -eq $False)\r\n {\r\n $global:LoggingIn = $True\r\n ACI-Login $apic $username $password\r\n }\r\n }\r\n\r\n ## We are using $encoding for the request as well as the expected response\r\n $request.Accept = $encoding\r\n ## Send a custom user agent if you want\r\n $request.UserAgent = \"PowerShell script\"\r\n\r\n ## Create the request body if the verb accepts it (NOTE: utf-8 is assumed here)\r\n if ($method -eq \"POST\" -or $method -eq \"PUT\") {\r\n $bytes = [System.Text.Encoding]::UTF8.GetBytes($postData)\r\n $request.ContentType = $encoding\r\n $request.ContentLength = $bytes.Length\r\n\r\n [System.IO.Stream] $outputStream = [System.IO.Stream]$request.GetRequestStream()\r\n $outputStream.Write($bytes,0,$bytes.Length)\r\n $outputStream.Close()\r\n }\r\n\r\n ## This is where we actually make the call.\r\n try\r\n {\r\n [System.Net.HttpWebResponse] $response = [System.Net.HttpWebResponse] $request.GetResponse()\r\n\r\n foreach($cookie in $response.Cookies)\r\n {\r\n # We've found the APIC cookie and can conclude our login business\r\n if($cookie.Name -eq \"APIC-cookie\")\r\n {\r\n $global:LoggedIn = $True\r\n $global:LoggingIn = $False\r\n }\r\n }\r\n\r\n $sr = New-Object System.IO.StreamReader($response.GetResponseStream())\r\n $txt = $sr.ReadToEnd()\r\n ## NOTE: comment out the next line if you don't want this function to print to the terminal\r\n #Write-Host \"CONTENT-TYPE: \" $response.ContentType\r\n ## NOTE: comment out the next line if you don't want this function to print to the terminal\r\n #Write-Host \"RAW RESPONSE DATA:\" . $txt\r\n ## Return the response body to the caller\r\n $return_value.httpResponse = $txt\r\n $return_value.httpCode = [int]$response.StatusCode\r\n return $return_value\r\n }\r\n ## This catches errors from the server (404, 500, 501, etc.)\r\n catch [Net.WebException] {\r\n [System.Net.HttpWebResponse] $resp = [System.Net.HttpWebResponse] $_.Exception.Response\r\n ## NOTE: comment out the next line if you don't want this function to print to the terminal\r\n #Write-Host $resp.StatusCode -ForegroundColor Red -BackgroundColor Yellow\r\n ## NOTE: comment out the next line if you don't want this function to print to the terminal\r\n #Write-Host $resp.StatusDescription -ForegroundColor Red -BackgroundColor Yellow\r\n ## Return the error to the caller\r\n\r\n # if the APIC returns a 403, the session most likely has been expired. Login again and rerun the API call\r\n if($resp.StatusCode -eq 403)\r\n {\r\n # We do this by resetting the global login variables and simply call the ACI-API-Call function again\r\n $global:LoggedIn = $False\r\n $global:LoggingIn = $False\r\n ACI-API-Call $method $encoding $url $headers $postData\r\n }\r\n\r\n $return_value.httpResponse = $resp.StatusDescription\r\n $return_value.httpCode = [int]$resp.StatusCode\r\n return $return_value\r\n }\r\n}\r\n\r\n# Use this function to login to the APIC\r\nfunction ACI-Login([string]$apic, [string]$username, [string]$password)\r\n{\r\n # This is the URL we're going to be logging in to\r\n $loginurl = \"https://\" + $apic + \"/api/aaaLogin.xml\"\r\n # Format the XML body for a login\r\n $creds = '<aaaUser name=\"' + $username + '\" pwd=\"' + $password + '\"/>'\r\n # Execute the API Call\r\n $result = ACI-API-Call \"POST\" \"application/xml\" $loginurl \"\" $creds\r\n\r\n if($result.httpResponse.Contains(\"Unauthorized\")) {\r\n Write-Host \"Authentication to APIC failed!\"\r\n result 1\r\n Exit\r\n }\r\n else {\r\n #Write-Host \"Authenticated to the APIC!\"\r\n }\r\n}\r\n\r\n$apic = \"##system.hostname##\"\r\n$username = \"##aci.user##\"\r\n$password = \"##aci.pass##\"\r\n\r\nACI-Login $apic $username $password\r\n$url = \"https://##system.hostname##/api/node/mo/topology/pod-1.json?query-target=children&target-subtree-class=fabricNode&query-target-filter=and(ne(fabricNode.role,%22controller%22))\" \r\n$result = ACI-API-Call \"GET\" \"application/json\" $url \"\"\r\n$resultjson = $result.httpResponse | ConvertFrom-Json\r\n\r\nforeach ($nodeinfo in $resultjson.imdata) {\r\n $node = \"node-$($nodeinfo.fabricNode.attributes.id)\"\r\n ACI-Login $apic $username $password\r\n $url = \"https://##system.hostname##/api/node/class/topology/pod-1/$node/l1PhysIf.json\" \r\n $result2 = ACI-API-Call \"GET\" \"application/json\" $url \"\"\r\n $result2json = $result2.httpResponse | ConvertFrom-Json\r\n \r\n foreach ($data in $result2json.imdata) {\r\n $dn = $data.l1PhysIf.attributes.dn\r\n $url = \"https://##system.hostname##/api/node/mo/$dn/phys.json\" \r\n $result6 = ACI-API-Call \"GET\" \"application/json\" $url \"\"\r\n $result6json = $result6.httpResponse | ConvertFrom-Json\r\n $etherinfo = $result6json.imdata[0].ethpmPhysIf.attributes\r\n\r\n $unique = $($node + $($data.l1PhysIf.attributes.id)).replace(\"/\",\"\").Replace(\"-\",\"\")\r\n $ilps = \"auto.nodename=$node\"\r\n $ilps += \"&auto.portoperSt=$($etherinfo.operSt)\"\r\n $ilps += \"&auto.portaccessVlan=$($etherinfo.accessVlan)\"\r\n $ilps += \"&auto.portallowedVlans=$($etherinfo.allowedVlans)\"\r\n $ilps += \"&auto.portadminSt=$($data.l1PhysIf.attributes.adminSt)\"\r\n $ilps += \"&auto.portautoNeg=$($data.l1PhysIf.attributes.autoNeg)\"\r\n $ilps += \"&auto.portbrkoutMap=$($data.l1PhysIf.attributes.brkoutMap)\"\r\n $ilps += \"&auto.portdn=$($data.l1PhysIf.attributes.dn)\"\r\n $ilps += \"&auto.portdescripton=$($data.l1PhysIf.attributes.descr)\"\r\n $ilps += \"&auto.portfecMode=$($data.l1PhysIf.attributes.fecMode)\"\r\n $ilps += \"&auto.portlayer=$($data.l1PhysIf.attributes.layer)\"\r\n $ilps += \"&auto.portlinkDebounce=$($data.l1PhysIf.attributes.linkDebounce)\"\r\n $ilps += \"&auto.portmdix=$($data.l1PhysIf.attributes.mdix)\"\r\n $ilps += \"&auto.portmedium=$($data.l1PhysIf.attributes.medium)\"\r\n $ilps += \"&auto.portmode=$($data.l1PhysIf.attributes.mode)\"\r\n $ilps += \"&auto.portmtu=$($data.l1PhysIf.attributes.mtu)\"\r\n $ilps += \"&auto.portportT=$($data.l1PhysIf.attributes.portT)\"\r\n $ilps += \"&auto.portprioFlowCtrl=$($data.l1PhysIf.attributes.prioFlowCtrl)\"\r\n $ilps += \"&auto.portspanMode=$($data.l1PhysIf.attributes.spanMode)\"\r\n $ilps += \"&auto.portspeed=$($data.l1PhysIf.attributes.speed)\"\r\n $ilps += \"&auto.portswitchingSt=$($data.l1PhysIf.attributes.switchingSt)\"\r\n $ilps += \"&auto.porttrunkLog=$($data.l1PhysIf.attributes.trunkLog)\"\r\n $ilps += \"&auto.portusage=$($data.l1PhysIf.attributes.usage)\"\r\n $unique = $($node + $($data.l1PhysIf.attributes.id)).replace(\"/\",\"\").Replace(\"-\",\"\")\r\n write-host \"$unique##$($node)_$($data.l1PhysIf.attributes.id)##$($data.l1PhysIf.attributes.descr)####$ilps\"\r\n }\r\n}\r\n"}}]]></adlist> <schemaVersion>2</schemaVersion> <dataSourceType>1</dataSourceType> <attributes> <attribute> <name>scripttype</name> <value>powerShell</value> <comment></comment> </attribute> <attribute> <name>scriptgroovy</name> <value># This is where we save the cookies! $global:CookieJar = New-Object System.Net.CookieContainer $global:LoggedIn = $False $global:LoggingIn = $False function ACI-API-Call([string]$method, [string]$encoding, [string]$url, $headers, [string]$postData) { $return_value = New-Object PsObject -Property @{httpCode = &#34;&#34;; httpResponse = &#34;&#34;} ## Create the request [System.Net.HttpWebRequest] $request = [System.Net.HttpWebRequest] [System.Net.WebRequest]::Create($url) # Ignore SSL certificate errors [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} [System.Net.ServicePointManager]::SecurityProtocol = 3072 # &#60;-- ACI NEEDS THIS!! # We want cookies! $request.CookieContainer = $global:CookieJar ## Add the method (GET, POST, etc.) $request.Method = $method ## Add an headers to the request foreach($key in $headers.keys) { $request.Headers.Add($key, $headers[$key]) } # If we&#39;re logged in, add the saved cookies to this request if ($global:LoggedIn -eq $True) { $request.CookieContainer = $global:CookieJar $global:LoggingIn = $False } else { # We&#39;re not logged in to the APIC, start login first if($global:LoggingIn -eq $False) { $global:LoggingIn = $True ACI-Login $apic $username $password } } ## We are using $encoding for the request as well as the expected response $request.Accept = $encoding ## Send a custom user agent if you want $request.UserAgent = &#34;PowerShell script&#34; ## Create the request body if the verb accepts it (NOTE: utf-8 is assumed here) if ($method -eq &#34;POST&#34; -or $method -eq &#34;PUT&#34;) { $bytes = [System.Text.Encoding]::UTF8.GetBytes($postData) $request.ContentType = $encoding $request.ContentLength = $bytes.Length [System.IO.Stream] $outputStream = [System.IO.Stream]$request.GetRequestStream() $outputStream.Write($bytes,0,$bytes.Length) $outputStream.Close() } ## This is where we actually make the call. try { [System.Net.HttpWebResponse] $response = [System.Net.HttpWebResponse] $request.GetResponse() foreach($cookie in $response.Cookies) { # We&#39;ve found the APIC cookie and can conclude our login business if($cookie.Name -eq &#34;APIC-cookie&#34;) { $global:LoggedIn = $True $global:LoggingIn = $False } } $sr = New-Object System.IO.StreamReader($response.GetResponseStream()) $txt = $sr.ReadToEnd() ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host &#34;CONTENT-TYPE: &#34; $response.ContentType ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host &#34;RAW RESPONSE DATA:&#34; . $txt ## Return the response body to the caller $return_value.httpResponse = $txt $return_value.httpCode = [int]$response.StatusCode return $return_value } ## This catches errors from the server (404, 500, 501, etc.) catch [Net.WebException] { [System.Net.HttpWebResponse] $resp = [System.Net.HttpWebResponse] $_.Exception.Response ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host $resp.StatusCode -ForegroundColor Red -BackgroundColor Yellow ## NOTE: comment out the next line if you don&#39;t want this function to print to the terminal #Write-Host $resp.StatusDescription -ForegroundColor Red -BackgroundColor Yellow ## Return the error to the caller # if the APIC returns a 403, the session most likely has been expired. Login again and rerun the API call if($resp.StatusCode -eq 403) { # We do this by resetting the global login variables and simply call the ACI-API-Call function again $global:LoggedIn = $False $global:LoggingIn = $False ACI-API-Call $method $encoding $url $headers $postData } $return_value.httpResponse = $resp.StatusDescription $return_value.httpCode = [int]$resp.StatusCode return $return_value } } # Use this function to login to the APIC function ACI-Login([string]$apic, [string]$username, [string]$password) { # This is the URL we&#39;re going to be logging in to $loginurl = &#34;https://&#34; + $apic + &#34;/api/aaaLogin.xml&#34; # Format the XML body for a login $creds = &#39;&#60;aaaUser name=&#34;&#39; + $username + &#39;&#34; pwd=&#34;&#39; + $password + &#39;&#34;/&#62;&#39; # Execute the API Call $result = ACI-API-Call &#34;POST&#34; &#34;application/xml&#34; $loginurl &#34;&#34; $creds if($result.httpResponse.Contains(&#34;Unauthorized&#34;)) { Write-Host &#34;Authentication to APIC failed!&#34; result 1 Exit } else { #Write-Host &#34;Authenticated to the APIC!&#34; } } $apic = &#34;##system.hostname##&#34; $username = &#34;##aci.user##&#34; $password = &#34;##aci.pass##&#34; ACI-Login $apic $username $password $url = &#34;https://##system.hostname##/api/node/mo/topology/pod-1.json?query-target=children&#38;target-subtree-class=fabricNode&#38;query-target-filter=and(ne(fabricNode.role,%22controller%22))&#34; $result = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $resultjson = $result.httpResponse | ConvertFrom-Json foreach ($nodeinfo in $resultjson.imdata) { $node = &#34;node-$($nodeinfo.fabricNode.attributes.id)&#34; ACI-Login $apic $username $password $url = &#34;https://##system.hostname##/api/node/class/topology/pod-1/$node/l1PhysIf.json?rsp-subtree-include=health&#34; $result2 = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $result2json = $result2.httpResponse | ConvertFrom-Json foreach ($data in $result2json.imdata) { $unique = $($node + $($data.l1PhysIf.attributes.id)).replace(&#34;/&#34;,&#34;&#34;).Replace(&#34;-&#34;,&#34;&#34;) $dn = $data.l1PhysIf.attributes.dn $url = &#34;https://##system.hostname##/api/node/mo/$dn/phys.json&#34; $result6 = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $result6json = $result6.httpResponse | ConvertFrom-Json $etherinfo = $result6json.imdata[0].ethpmPhysIf.attributes if ($etherinfo.operSpeed -eq &#34;inherit&#34;) {write-host &#34;$unique.basicspeed=10737418240&#34;} if ($etherinfo.operSpeed -eq &#34;10G&#34;) {write-host &#34;$unique.basicspeed=10737418240&#34;} if ($etherinfo.operSpeed -eq &#34;1G&#34;) {write-host &#34;$unique.basicspeed=1073741824&#34;} if ($etherinfo.operSpeed -eq &#34;100M&#34;) {write-host &#34;$unique.basicspeed=104857600&#34;} if ($etherinfo.operSt -ne &#34;up&#34;) {write-host &#34;$unique.operSt=1&#34;} if ($etherinfo.operSt -eq &#34;up&#34;) {write-host &#34;$unique.operSt=0&#34;} write-host &#34;$unique.operStQualCode=$($etherinfo.operStQualCode)&#34; if ($etherinfo.operSt -eq &#34;up&#34;) { $url = &#34;https://##system.hostname##/api/node/mo/$dn/dbgEtherStats.json&#34; $result3 = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $result3json = $result3.httpResponse | ConvertFrom-Json $etherstats = $result3json.imdata[0].rmonEtherStats.attributes if ($($data.l1PhysIf.attributes.adminSt) -ne &#34;up&#34;) { write-host &#34;$unique.adminSt=1&#34; } if ($($data.l1PhysIf.attributes.adminSt) -eq &#34;up&#34;) { write-host &#34;$unique.adminSt=0&#34; } write-host &#34;$unique.healthScore=$($data.l1PhysIf.children[0].healthInst.attributes.cur)&#34; write-host &#34;$unique.broadcastPkts=$($etherstats.broadcastPkts)&#34; write-host &#34;$unique.cRCAlignErrors=$($etherstats.cRCAlignErrors)&#34; write-host &#34;$unique.collisions=$($etherstats.collisions)&#34; write-host &#34;$unique.dropEvents=$($etherstats.dropEvents)&#34; write-host &#34;$unique.fragments=$($etherstats.fragments)&#34; write-host &#34;$unique.jabbers=$($etherstats.jabbers)&#34; write-host &#34;$unique.multicastPkts=$($etherstats.multicastPkts)&#34; write-host &#34;$unique.octets=$($etherstats.octets)&#34; write-host &#34;$unique.oversizePkts=$($etherstats.oversizePkts)&#34; write-host &#34;$unique.pkts=$($etherstats.pkts)&#34; write-host &#34;$unique.pkts1024to1518Octets=$($etherstats.pkts1024to1518Octets)&#34; write-host &#34;$unique.pkts128to255Octets=$($etherstats.pkts128to255Octets)&#34; write-host &#34;$unique.pkts256to511Octets=$($etherstats.pkts256to511Octets)&#34; write-host &#34;$unique.pkts64Octets=$($etherstats.pkts64Octets)&#34; write-host &#34;$unique.pkts65to127Octets=$($etherstats.pkts65to127Octets)&#34; write-host &#34;$unique.rXNoErrors=$($etherstats.rXNoErrors)&#34; write-host &#34;$unique.rxOversizePkts=$($etherstats.rxOversizePkts)&#34; write-host &#34;$unique.tXNoErrors=$($etherstats.tXNoErrors)&#34; write-host &#34;$unique.txOversizePkts=$($etherstats.txOversizePkts)&#34; write-host &#34;$unique.undersizePkts=$($etherstats.undersizePkts)&#34; $url = &#34;https://##system.hostname##/api/node/mo/$dn/dbgIfIn.json&#34; $result4 = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $result4json = $result4.httpResponse | ConvertFrom-Json $etherinstats = $result4json.imdata[0].rmonIfIn.attributes write-host &#34;$unique.inbroadcastPkts=$($etherinstats.broadcastPkts)&#34; write-host &#34;$unique.indiscards=$($etherinstats.discards)&#34; write-host &#34;$unique.inerrors=$($etherinstats.errors)&#34; write-host &#34;$unique.inmulticastPkts=$($etherinstats.multicastPkts)&#34; write-host &#34;$unique.innUcastPkts=$($etherinstats.nUcastPkts)&#34; write-host &#34;$unique.inoctets=$($etherinstats.octets)&#34; write-host &#34;$unique.inucastPkts=$($etherinstats.ucastPkts)&#34; $url = &#34;https://##system.hostname##/api/node/mo/$dn/dbgIfOut.json&#34; $result5 = ACI-API-Call &#34;GET&#34; &#34;application/json&#34; $url &#34;&#34; $result5json = $result5.httpResponse | ConvertFrom-Json $etheroutstats = $result5json.imdata[0].rmonIfOut.attributes write-host &#34;$unique.outbroadcastPkts=$($etheroutstats.broadcastPkts)&#34; write-host &#34;$unique.outdiscards=$($etheroutstats.discards)&#34; write-host &#34;$unique.outerrors=$($etheroutstats.errors)&#34; write-host &#34;$unique.outmulticastPkts=$($etheroutstats.multicastPkts)&#34; write-host &#34;$unique.outnUcastPkts=$($etheroutstats.nUcastPkts)&#34; write-host &#34;$unique.outoctets=$($etheroutstats.octets)&#34; write-host &#34;$unique.outucastPkts=$($etheroutstats.ucastPkts)&#34; } } }</value> <comment></comment> </attribute> <attribute> <name>windowsscript</name> <value></value> <comment></comment> </attribute> <attribute> <name>linuxscript</name> <value></value> <comment></comment> </attribute> <attribute> <name>windowscmdline</name> <value></value> <comment></comment> </attribute> <attribute> <name>linuxcmdline</name> <value></value> <comment></comment> </attribute> <attribute> <name>__filter_0</name> <value>auto.portoperSt NotEqual down</value> <comment></comment> </attribute> </attributes> <datapoints> <datapoint> <name>adminSt</name> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.adminSt</postprocessorparam> <usevalue>output</usevalue> <alertexpr>!= 0</alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue>1</maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>InOctets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.inoctets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>OutOctets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.outoctets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>pkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.pkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>broadcastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.broadcastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>collisions</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.collisions</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>cRCAlignErrors</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.cRCAlignErrors</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>dropEvents</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.dropEvents</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>fragments</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.fragments</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>inbroadcastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.inbroadcastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>indiscards</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.indiscards</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>inerrors</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.inerrors</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>inmulticastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.inmulticastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>innUcastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.innUcastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>inucastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.inucastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>jabbers</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.jabbers</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>multicastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.multicastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>octets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.octets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>outbroadcastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.outbroadcastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>outdiscards</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.outdiscards</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>outerrors</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.outerrors</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>outmulticastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.outmulticastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>outnUcastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.outnUcastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>outucastPkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.outucastPkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>oversizePkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.oversizePkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>pkts1024to1518Octets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.pkts1024to1518Octets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>pkts128to255Octets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.pkts128to255Octets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>pkts256to511Octets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.pkts256to511Octets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>pkts64Octets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.pkts64Octets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>pkts65to127Octets</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.pkts65to127Octets</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>rXNoErrors</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.rXNoErrors</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>rxOversizePkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.rxOversizePkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>tXNoErrors</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.tXNoErrors</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>txOversizePkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.txOversizePkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>undersizePkts</name> <dataType>7</dataType> <type>3</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.undersizePkts</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>basicspeed</name> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.basicspeed</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>operSt</name> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.operSt</postprocessorparam> <usevalue>output</usevalue> <alertexpr>!= 0</alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue>1</maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>2</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>operStQualCode</name> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.operStQualCode</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>healthScore</name> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>##WILDVALUE##.healthScore</postprocessorparam> <usevalue>output</usevalue> <alertexpr>!= 100</alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <description></description> <maxvalue>100</maxvalue> <minvalue>0</minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>2</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> </datapoints> <graphs> <graph> <name>Drops/Errors</name> <title>Drops/Errors for ##INSTANCE## ##DESCRIPTION##</title> <verticallabel>Packets/sec</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>3</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>indiscards</name> <datapointname>indiscards</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>inerrors</name> <datapointname>inerrors</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>outdiscards</name> <datapointname>outdiscards</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>outerrors</name> <datapointname>outerrors</datapointname> <cf>2</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>1</type> <legend>In Discards</legend> <color>orange</color> <datapointname>indiscards</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>In Errors</legend> <color>red</color> <datapointname>inerrors</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>Out Discards</legend> <color>purple</color> <datapointname>outdiscards</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>Out Errors</legend> <color>gray</color> <datapointname>outerrors</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> </graphdatas> </graph> <graph> <name>Health Score</name> <title>Health Score</title> <verticallabel>%</verticallabel> <rigid>false</rigid> <maxvalue>100.0</maxvalue> <minvalue>0.0</minvalue> <displayprio>1</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>healthScore</name> <datapointname>healthScore</datapointname> <cf>2</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>1</type> <legend>Health Score</legend> <color>silver</color> <datapointname>healthScore</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> </graphdatas> </graph> <graph> <name>Packets</name> <title>Packets for ##INSTANCE## ##DESCRIPTION##</title> <verticallabel>Packets/sec</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>2</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>inbroadcastPkts</name> <datapointname>inbroadcastPkts</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>inmulticastPkts</name> <datapointname>inmulticastPkts</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>innUcastPkts</name> <datapointname>inucastPkts</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>outbroadcastPkts</name> <datapointname>outbroadcastPkts</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>outmulticastPkts</name> <datapointname>outmulticastPkts</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>outnUcastPkts</name> <datapointname>outucastPkts</datapointname> <cf>2</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> <graphvirtualdatapoint> <name>InNonUni</name> <rpn>inmulticastPkts+inbroadcastPkts</rpn> </graphvirtualdatapoint> <graphvirtualdatapoint> <name>OutNonUni</name> <rpn>outmulticastPkts+outbroadcastPkts</rpn> </graphvirtualdatapoint> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>1</type> <legend>In Unicast</legend> <color>blue</color> <datapointname>innUcastPkts</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>Out Unicast</legend> <color>green</color> <datapointname>outnUcastPkts</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>In (b/m)cast</legend> <color>purple</color> <datapointname>InNonUni</datapointname> <isvirtualdatapoint>true</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>Out (b/m)cast</legend> <color>maroon</color> <datapointname>OutNonUni</datapointname> <isvirtualdatapoint>true</isvirtualdatapoint> </graphdata> </graphdatas> </graph> <graph> <name>Status</name> <title>Status for ##INSTANCE## ##DESCRIPTION##</title> <verticallabel>status</verticallabel> <rigid>false</rigid> <maxvalue>2.0</maxvalue> <minvalue>-1.0</minvalue> <displayprio>1</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>adminSt</name> <datapointname>adminSt</datapointname> <cf>2</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>1</type> <legend>Admin State</legend> <color>silver</color> <datapointname>adminSt</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> </graphdatas> </graph> <graph> <name>Throughput</name> <title>Throughput for ##INSTANCE## ##DESCRIPTION##</title> <verticallabel>bit/sec</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>2</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>InMax</name> <datapointname>InOctets</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>OutMax</name> <datapointname>OutOctets</datapointname> <cf>2</cf> </graphdatapoint> <graphdatapoint> <name>TotalMax</name> <datapointname>octets</datapointname> <cf>2</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> <graphvirtualdatapoint> <name>InMaxBits</name> <rpn>InMax*8</rpn> </graphvirtualdatapoint> <graphvirtualdatapoint> <name>OutMaxBits</name> <rpn>OutMax*8</rpn> </graphvirtualdatapoint> <graphvirtualdatapoint> <name>TotalMaxBits</name> <rpn>TotalMax*8</rpn> </graphvirtualdatapoint> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>1</type> <legend>In (max)</legend> <color>blue</color> <datapointname>InMaxBits</datapointname> <isvirtualdatapoint>true</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>Out (max)</legend> <color>green</color> <datapointname>OutMaxBits</datapointname> <isvirtualdatapoint>true</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>Total (max)</legend> <color>silver</color> <datapointname>TotalMaxBits</datapointname> <isvirtualdatapoint>true</isvirtualdatapoint> </graphdata> </graphdatas> </graph> </graphs> <overviewgraphs> <overviewgraph> <name>Top_10 interfaces by total bandwidth</name> <title>Top 10 interfaces by total bandwidth</title> <verticallabel>bps</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>1</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <aggregated>false</aggregated> <datapoints> <overviewgraphdatapoint> <name>InOctets</name> <datapointname>InOctets</datapointname> <cf>1</cf> <aggregateMethod>sum</aggregateMethod> </overviewgraphdatapoint> <overviewgraphdatapoint> <name>OutOctets</name> <datapointname>OutOctets</datapointname> <cf>1</cf> <aggregateMethod>sum</aggregateMethod> </overviewgraphdatapoint> </datapoints> <virtualdatapoints> <overviewgraphvirtualdatapoint> <name>bps</name> <rpn>(InOctets+OutOctets)*8</rpn> </overviewgraphvirtualdatapoint> </virtualdatapoints> <lines> <overviewgraphline> <type>1</type> <legend>##INSTANCE##</legend> <datapointname>bps</datapointname> <isvirtualdatapoint>true</isvirtualdatapoint> <color>silver</color> </overviewgraphline> </lines> </overviewgraph> <overviewgraph> <name>Top_10 interfaces by total drops</name> <title>Top 10 interfaces by total drops</title> <verticallabel>packets</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>1</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <aggregated>false</aggregated> <datapoints> <overviewgraphdatapoint> <name>indiscards</name> <datapointname>indiscards</datapointname> <cf>2</cf> <aggregateMethod>sum</aggregateMethod> </overviewgraphdatapoint> <overviewgraphdatapoint> <name>inerrors</name> <datapointname>inerrors</datapointname> <cf>2</cf> <aggregateMethod>sum</aggregateMethod> </overviewgraphdatapoint> <overviewgraphdatapoint> <name>outdiscards</name> <datapointname>outdiscards</datapointname> <cf>2</cf> <aggregateMethod>sum</aggregateMethod> </overviewgraphdatapoint> <overviewgraphdatapoint> <name>outerrors</name> <datapointname>outerrors</datapointname> <cf>2</cf> <aggregateMethod>sum</aggregateMethod> </overviewgraphdatapoint> </datapoints> <virtualdatapoints> <overviewgraphvirtualdatapoint> <name>drops</name> <rpn>inerrors+indiscards+outerrors+outdiscards</rpn> </overviewgraphvirtualdatapoint> </virtualdatapoints> <lines> <overviewgraphline> <type>1</type> <legend>##INSTANCE##</legend> <datapointname>drops</datapointname> <isvirtualdatapoint>true</isvirtualdatapoint> <color>silver</color> </overviewgraphline> </lines> </overviewgraph> </overviewgraphs> <scripts> </scripts> </entry> </feed>
  10. Cisco CallManager (CUCM) Datasources

    @Joe Williams the easiest way is to use postman or something like that to test API access using some of the rest endpoints. I've also noticed, if you're not using your FQDN as your name (not display name, don't use the IP Address) it doesn't work because it needs the actual node name of the cucm server. Are you able to connect to the API via Postman?
  11. NOC Widgets

    NOC is an acronym for Network Operation Center. Heads up monitors are typically called NOC monitors, so you can see where the widget being called a NOC widget is useful for those types of dashboards.
  12. HTTP Authentication Required?

    @Joe Williams you shouldn't need the blank $data variable. the $requestVars should just have the $data removed when you're doing a GET. There's two different script samples, one is for a GET and one is for a POST. The issue it looks like what you have above is your $queryParams, this needs to be the way it is in your second example. The auth fails because you're including them in the resourcePath information and that's breaking the authentication hash. In the code you posted second, it should look like this. Hope this helps! <# request details #> $httpVerb = 'GET' $resourcePath = '/setting/collectors' $queryParams = '?fields=id,description,hostname' <# Construct URL #> $url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath + $queryVars <# Get current time in milliseconds #> $epoch = [Math]::Round((New-TimeSpan -start (Get-Date -Date "1/1/1970") -end (Get-Date).ToUniversalTime()).TotalMilliseconds) <# Concatenate Request Details #> $requestVars = $httpVerb + $epoch + $resourcePath <# Construct Signature #> $hmac = New-Object System.Security.Cryptography.HMACSHA256 $hmac.Key = [Text.Encoding]::UTF8.GetBytes($accessKey) $signatureBytes = $hmac.ComputeHash([Text.Encoding]::UTF8.GetBytes($requestVars)) $signatureHex = [System.BitConverter]::ToString($signatureBytes) -replace '-' $signature = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($signatureHex.ToLower())) <# Construct Headers #> $auth = 'LMv1 ' + $accessId + ':' + $signature + ':' + $epoch $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Authorization", $auth) $headers.Add("Content-Type", 'application/json') <# Make Request #> $response = Invoke-RestMethod -Uri $url -Method $httpVerb -Header $headers <# Print status and body of response #> $status = $response.status $body = $response.data
  13. Windows Basics PropertySource

    What would be awesome too to add would be a vcenter lookup to see what vcenter is hosting a vm. Haven't found a good way to do that yet.
  14. REST API - Get Data - Aggregation?

    @Sarah Terry We (Patrick and I) were using the aggregate options on the RPC to pull period min,max,average,change for our ticketing integration. To do some of this information now, it would require a few iterations through the get-data REST functions to get ... say, a 7 day change percentage, or average. We use this to enhance the messages that we create in Autotask on certain alerts that are triggered.
  15. Peloton

    Anyone use a Peloton? I'm almost done doing a new datasource and was curious if anyone's interested in any stats to pull in for your riding I mayyyyyyy be too big of a nerd.