You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the recent change (#2740) to send the exact list of counters, there is the possibility that a template with a large number of counters could hit ONTAP's request URI limit.
When that happens, the Harvest REST collector should revert to the fields=* logic.
Here's a Python script that makes a request that is the maximum request URI length - 1, followed by a request that is too large. This script will cause the following error to be printed.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>414 Request-URI Too Long</title>
</head><body>
<h1>Request-URI Too Long</h1>
<p>The requested URL's length exceeds the capacity
limit for this server.<br />
</p>
</body></html>
importbase64importhttp.clienthost="10.193.48.154"user="admin"password="password"apache_max=8*1024# 8,192conn=http.client.HTTPConnection(host)
# Create basic auth tokenauth=user+":"+passwordauth=auth.encode("utf-8")
auth=base64.b64encode(auth).decode("utf-8")
headers= {
"Authorization": f"Basic {auth}",
}
big="a"*apache_maxurl="/api/cluster?fields="+big# The host + url can be at most apache_max characterstoo_big=apache_max-len(host)
just_right=apache_max-len(host) -1# Send the just_right request.# This will return a 400 since it is a bogus request, but that's OKconn.request("GET", url[:just_right], headers=headers)
response=conn.getresponse()
data=response.read()
print("Status:", response.status)
print("Reason:", response.reason)
print("Data:", data.decode("utf-8"))
# Send the too_big request.# This will fail with a 414conn.request("GET", url[:too_big], headers=headers)
response=conn.getresponse()
data=response.read()
print("Status:", response.status)
print("Reason:", response.reason)
print("Data:", data.decode("utf-8"))
conn.close()
The text was updated successfully, but these errors were encountered:
With the recent change (#2740) to send the exact list of counters, there is the possibility that a template with a large number of counters could hit ONTAP's request URI limit.
When that happens, the Harvest REST collector should revert to the
fields=*
logic.Here's a Python script that makes a request that is the maximum request URI length - 1, followed by a request that is too large. This script will cause the following error to be printed.
The text was updated successfully, but these errors were encountered: