# rrds/httpdlog - This looks at a standard web-server log-file, rather sloppily.
# CVS $Id: httpdlog,v 1.7 2003/03/20 18:09:45 remstats Exp $
# from remstats version @@VERSION@@
# Copyright 2003 by Thomas Erskine <@@AUTHOR@@>

source	log
step	300

data	requests	DERIVE:600:0:U	count (GET|POST)
data	success		DERIVE:600:0:U	count \sHTTP/\d\.\d"\s+2\d\d
data	bytes		DERIVE:600:0:U	sum \sHTTP/\d\.\d"\s+2\d\d\s+(\d+)

archives day-avg week-avg month-avg 3month-avg year-avg
times	day yesterday week month 3month year

graph	httpreq desc="This is collected by the log-collector.  It works by connecting to the log-server running on the host and requesting it to get information about new records on the log-files that it has been told to serve.  In this case, it reads from a standard web-server log-file and counts the number of requests and successful requests, as determined by the HTTP response code.  I.E. if it begins with a 2, it is considered to be successful"
	--title '##HOST## - HTTP Requests (##GRAPHTIME##)'
	--lower-limit 0
	--vertical-label req
	DEF:requests=##DB##:requests:AVERAGE
	DEF:success=##DB##:success:AVERAGE
	CDEF:missing=requests,UN,INF,UNKN,IF
	'LINE1:requests###COLOR1##:requests'
	'LINE1:success###COLOR2##:successful requests'
	'GPRINT:requests:MAX:max=%.0lf%s'
	'AREA:missing###MISSING##:missing'

graph	httpbytes desc="This is collected by the log-collector.  It works by connecting to the log-server running on the host and requesting it to get information about new records on the log-files that it has been told to serve.  In this case, it reads from a standard web-server log-file and totals up the bytes transferred."
	--title '##HOST## - HTTP Bytes Transferred (##GRAPHTIME##)'
	--lower-limit 0
	--vertical-label bytes
	DEF:bytes=##DB##:bytes:AVERAGE
	CDEF:missing=bytes,UN,INF,UNKN,IF
	'LINE2:bytes###COLOR1##:bytes transferres'
	'GPRINT:bytes:MAX:max=%.0lf%s'
	'AREA:missing###MISSING##:missing'

