# -----------------------------------------------------------------------------
# high level response code alarms
+template: 1m_requests
+ on: web_log.response_codes
+families: *
+ lookup: sum -1m unaligned
+ calc: ($this == 0)?(1):($this)
+ units: requests
+ every: 10s
+ info: the sum of all HTTP requests over the last minute
+
template: 1m_2xx
on: web_log.response_codes
families: *
every: 10s
info: the sum of successful HTTP requests over the last minute
-template: 1m_redirects
+template: 1m_successful
on: web_log.response_codes
families: *
- lookup: sum -1m unaligned of 3xx
- calc: $this * 100 / ( $1m_2xx + $this )
+ calc: $1m_2xx * 100 / $1m_requests
units: %
every: 10s
- warn: $this > (($status >= $WARNING) ? ( 1 ) : ( 2 ))
- crit: $this > (($status == $CRITICAL) ? ( 2 ) : ( 5 ))
+ warn: ($1m_requests > 30) ? ($this < (($status >= $WARNING ) ? ( 98 ) : ( 95 )) ) : ( 0 )
+ crit: ($1m_requests > 30) ? ($this < (($status == $CRITICAL) ? ( 95 ) : ( 90 )) ) : ( 0 )
delay: down 15m multiplier 1.5 max 1h
info: the ratio of HTTP redirects (3xx) vs the successful requests, \
over the last minute
to: webmaster
+template: 1m_redirects
+ on: web_log.detailed_response_codes
+families: *
+ lookup: sum -1m unaligned of 301,303,307,308
+ calc: $this * 100 / ( $1m_2xx + $this )
+ units: %
+ every: 10s
+ warn: ($1m_requests > 30) ? ($this > (($status >= $WARNING ) ? ( 1 ) : ( 2 )) ) : ( 0 )
+ crit: ($1m_requests > 30) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
+ delay: down 15m multiplier 1.5 max 1h
+ info: the ratio of HTTP redirects (301, 303, 307, 308) vs the successful requests, \
+ over the last minute
+ to: webmaster
+
template: 1m_bad_requests
on: web_log.response_codes
families: *
calc: $this * 100 / ( $1m_2xx + $this )
units: %
every: 10s
- warn: $this > (($status >= $WARNING) ? ( 1 ) : ( 5 ))
- crit: $this > (($status == $CRITICAL) ? ( 5 ) : ( 10 ))
+ warn: ($1m_requests > 30) ? ($this > (($status >= $WARNING) ? ( 1 ) : ( 5 )) ) : ( 0 )
+ crit: ($1m_requests > 30) ? ($this > (($status == $CRITICAL) ? ( 5 ) : ( 10 )) ) : ( 0 )
delay: down 15m multiplier 1.5 max 1h
info: the ratio of HTTP bad requests (4xx) vs the successful requests, \
over the last minute
calc: $this * 100 / ( $1m_2xx + $this )
units: %
every: 10s
- warn: $this > (($status >= $WARNING) ? ( 1 ) : ( 2 ))
- crit: $this > (($status == $CRITICAL) ? ( 2 ) : ( 5 ))
+ warn: ($1m_requests > 30) ? ($this > (($status >= $WARNING) ? ( 1 ) : ( 2 )) ) : ( 0 )
+ crit: ($1m_requests > 30) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
delay: down 15m multiplier 1.5 max 1h
info: the ratio of HTTP internal server errors (5xx) vs the successful \
requests, over the last minute
every: 30s
info: the average time to respond to HTTP requests, over the last 10 minutes
-
template: web_slow
on: web_log.response_time
families: *
every: 10s
green: 500
red: 1000
- warn: $this > $green && $this > ($10m_response_time * 2)
- crit: $this > $red && $this > ($10m_response_time * 4)
+ warn: ($1m_requests > 30) ? ($this > $green && $this > ($10m_response_time * 2) ) : ( 0 )
+ crit: ($1m_requests > 30) ? ($this > $red && $this > ($10m_response_time * 4) ) : ( 0 )
delay: down 15m multiplier 1.5 max 1h
info: the average time to respond to HTTP requests, over the last 1 minute
to: webmaster
calc: ($5m_2xx_last > 0)?($5m_2xx_now * 100 / $5m_2xx_last):(100)
units: %
every: 30s
- warn: ($5m_2xx_last > 30)?($this > 200 OR $this < 50):(0)
- crit: ($5m_2xx_last > 30)?($this > 400 OR $this < 25):(0)
+ warn: ($1m_requests > 30) ? (($5m_2xx_last > 30) ? ($this > 200 OR $this < 50) : (0) ) : ( 0 )
+ crit: ($1m_requests > 30) ? (($5m_2xx_last > 30) ? ($this > 400 OR $this < 25) : (0) ) : ( 0 )
delay: down 15m multiplier 1.5 max 1h
options: no-clear-notification
info: the percentage of web requests over the last 5 minutes, \
['0529b679d3c0e7e6332753c7f6484731']='health.d/net.conf'
['057d12aaff0467e64529e839a258806b']='health.d/entropy.conf'
['059d98d0c562e1c81653d1e64673deab']='python.d/web_log.conf'
+ ['05a8f39f134850c1e8d6267dbe706273']='health.d/web_log.conf'
['061c45b0e34170d357e47883166ecf40']='python.d/nginx.conf'
['074df527cc70b5f38c0714f08f20e57c']='health.d/apache.conf'
['08042325ab27256b938575deafee8ecf']='python.d/nginx.conf'
['61b7ed36f35e7bd930f5f7f91694a112']='charts.d/postfix.conf'
['621f10b257a11add5ff5aff41e9662e3']='health.d/memcached.conf'
['623771eecb3c277fc728b5304793f93b']='health.d/cpu.conf'
+ ['632c28d714c87a4969d11cf36a5edaa8']='health.d/web_log.conf'
['636d032928ea0f4741eab264fb49c099']='apps_groups.conf'
['6398ef37a15cb6a0bc921f58948d2b39']='health.d/softnet.conf'
['64070d856ab1b47a18ec871e49bbc13b']='python.d/squid.conf'
['707a63f53f4b32e01d134ae90ba94aad']='health_alarm_notify.conf'
['707a63f53f4b32e01d134ae90ba94aad']='health_email_recipients.conf'
['70d82dabecb09a1da4684f293abef0c9']='health_alarm_notify.conf'
+ ['729b3e24a72f7d566fd429617d51a21b']='health.d/web_log.conf'
['73125ae64d5c6e9361944cd9bd14844e']='python.d/exim.conf'
['731a1fcfe9b2da1b9d685056a59541b8']='python.d/hddtemp.conf'
['73a8e10dfe4183aca751e9e2a80dabe3']='node.d.conf'
['df7e8044902b5e155fad8430c2ddcfa8']='health.d/fping.conf'
['dfd5431b11cf2f3852a40d390c1d5a92']='python.d/varnish.conf'
['e0242003fd2e3f9ac1b9314e802ada79']='python.d/hddtemp.conf'
+ ['e0ba3bc216ffc9933b4741dbb6b1f8c8']='health.d/web_log.conf'
['e0e96cc47ed61d6492416be5236cd4d3']='python.d/apache_cache.conf'
['e2f3388c06726154c10ec22bad5bc7ec']='fping.conf'
['e3023092e3b2bbb5351e0fe6682f4fe9']='health_alarm_notify.conf'
'response_time': {
'options': [None, 'Processing Time', 'milliseconds', 'timings', 'web_log.response_time', 'area'],
'lines': [
- ['resp_time_min', 'min', 'absolute', 1, 1],
- ['resp_time_max', 'max', 'absolute', 1, 1],
- ['resp_time_avg', 'avg', 'absolute', 1, 1]
+ ['resp_time_min', 'min', 'absolute', 1, 1000],
+ ['resp_time_max', 'max', 'absolute', 1, 1000],
+ ['resp_time_avg', 'avg', 'absolute', 1, 1000]
]},
'clients': {
'options': [None, 'Current Poll Unique Client IPs', 'unique ips', 'clients', 'web_log.clients', 'stacked'],
r' ([\d.]+) ')
regex_function = zip([access_apache_ext, access_nginx_ext, access_default],
- [lambda x: x, lambda x: x * 1000, lambda x: x],
+ [lambda x: x, lambda x: x * 1000000, lambda x: x],
['access_apache_ext', 'access_nginx_ext', 'access_default'])
regex_name = None
for regex, function, name in regex_function:
job_name = find_job_name(self.override_name, self.name)
self.detailed_chart = 'CHART %s.detailed_response_codes ""' \
- ' "Response Codes" requests/s responses' \
+ ' "Detailed Response Codes" requests/s responses' \
' web_log.detailed_response_codes stacked 1 %s\n' % (job_name, self.update_every)
self.http_method_chart = 'CHART %s.http_method' \
- ' "" "Requests Per HTTP Method" requests/s requests' \
+ ' "" "Requests Per HTTP Method" requests/s "http methods"' \
' web_log.http_method stacked 2 %s\n' % (job_name, self.update_every)
- if regex_name == 'access_apache_ext':
- self.definitions['response_time']['lines'][0][4] = 1000
- self.definitions['response_time']['lines'][1][4] = 1000
- self.definitions['response_time']['lines'][2][4] = 1000
-
# Remove 'request_time' chart from ORDER if request_time not in logs
if regex_name == 'access_default':
self.order.remove('response_time')
# timings
if request_time:
to_netdata['resp_time_min'] = request_time[0]
- to_netdata['resp_time_avg'] = float(request_counter['sum']) / request_counter['count']
+ to_netdata['resp_time_avg'] = round(float(request_counter['sum']) / request_counter['count'])
to_netdata['resp_time_max'] = request_time[-1]
to_netdata.update(self.storage)
]
},
+ 'web_log.response_time': {
+ mainheads: [
+ function(os, id) {
+ void(os);
+ return '<div data-netdata="' + id + '"'
+ + ' data-dimensions="avg"'
+ + ' data-chart-library="gauge"'
+ + ' data-title="Average Response"'
+ + ' data-units="milliseconds"'
+ + ' data-gauge-adjust="width"'
+ + ' data-width="12%"'
+ + ' data-before="0"'
+ + ' data-after="-CHART_DURATION"'
+ + ' data-points="CHART_DURATION"'
+ + ' data-colors="' + NETDATA.colors[4] + '"'
+ + ' role="application"></div>';
+ }
+ ]
+ },
+
'web_log.detailed_response_codes': {
info: 'Number of responses for each response code.'
},
});
NETDATA.requiredJs.push({
- url: NETDATA.serverDefault + 'dashboard_info.js?v20170211-18',
+ url: NETDATA.serverDefault + 'dashboard_info.js?v20170211-19',
async: false,
isAlreadyLoaded: function() { return false; }
});