########################################################################
# Configuration for NTP Analyzer Web Front                             #
########################################################################

# Connection parameters to MySQL database instance.
Database {
	Host localhost
	Name ntpa
	User ntpau
	Pass xxx
}

# OPTIONAL
Log {
	Severity notice
	File /var/log/ntpa.1.log
}

# Multiple server configurations are available
Server {
	# Primary key in table 'host'
	HostID 1
	
	# Domain name of hosting NTP server
	HostAddress ntp1.domain.org
	
	# NTP configuration file with IDs from support.ntp.org
	ConfigFile /usr/local/www/ntpconf/ntp.conf.dist
	
	# Base path for generated files
	FilePath /usr/local/www/
	
	# Base URL for generated files
	WebPath /
	
	########## Webpages ##########
	
	# Main page for a host
	HostPage ntp1 {
		# Indicate if generation should happen immidiatly after startup
		InitialRun 1
		
		# Minutes between generation of page
		Frequency 5

		PageTitle ntp1.domain.org
		
		# Use either 'default' or 'bootstrap'
		Template default

		# Link to peer web pages
		PeerPages ntp1-peers
		PoolMember 1

		# Links to graphs
		Images {
			# Index in graph destination array
			LinkIndex 1
			
			# Link to graphs in config file
			Graph offset24
			Graph offset72
			Graph offset1
			Graph offset3
			Graph offset15
			Graph offset30
			Graph offset60
		}
		
		# Link to summery pages
		Summeries {
			PeerSummeryPage ntp1-offset
			PeerSummeryPage ntp1-delay
		}
		
		# Name and path to generated file.
		# Multiple files are an option.
		Destinations {
			File ntp1.domain.org/index.html
		}
	}

	# Web pages for peers
	# Same usage as host configuration options
	PeerPages ntp1-peers {
		InitialRun 1
		Frequency 240

		PageTitle ntp1.domain.org
		Template default

		Images {
			LinkIndex 1
			Graph offset24
			Graph offset72
			Graph offset1
			Graph offset3
			Graph offset15
			Graph offset15f
			Graph delay
			Graph delayf
			Graph balance
			Graph balancef
		}
		
		# Path to use for generated files.
		Destinations {
			Directory ntp1.domain.org/peers/
		}
		
		# Base URL to generated files.
		Link peers/	
	}
	
	# Web page for summery graphs
	# Same usage as host configuration options
	PeerSummeryPage ntp1-offset {
		InitialRun 1
		Frequency 1080
		
		# Links to other configuration sections
		PageTitle jitter/offset
		PeerPages ntp1-peers
		Template default
		
		Images {
			LinkIndex 1
			Graph offset15
			Graph offset15f
		}
		
		Destinations {
			File ntp1.domain.org/peers/graphs.html
		}
		
		Link peers/graphs.html
	}
	
	PeerSummeryPage ntp1-delay {
		InitialRun 1
		Frequency 1080
		
		PageTitle jitter/offset/delay
		PeerPages ntp1-peers
		Template default
				
		Images {
			LinkIndex 1
			Graph delay
			Graph delayf
		}
		
		Destinations {
			File ntp1.domain.org/peers/delaygraphs.html
		}
		
		Link peers/delaygraphs.html
	}
	
	############### Bootstrap menu ##############
	
	#Options for boot strap menu
	Menu {
		Item title {
			Type Name
			Caption domain.org
			Link http://domain.org
		}
		
		Item main {
			Caption NTP1
			Page innolan1
		}
	
		Item {
			Caption Offsets
			Page innolan1-offset
		}
	
		Item {
			Caption Delays
			Page innolan1-delay
		}
		
		Item {
			Dropdown Peers
			
			Content {
				Item {
					Caption NTP2
					Link ntp2/
				}
			
				Item {
					Caption NTP3
					Link ntp3/
				}

				Item {
					Type Spacer
				}
			
				Item {
					Type Header
					Caption Site info
				}
			
				Item {
					Caption About
					Page about1
				}
			
				Item {
					Caption Contact
					Link mailto:cs@innolan.dk
				}
			}
		}
	}
	
	########## Webpages with bootstrap theme ##########	
	
	AboutPage about1 {
		InitialRun 1
		Frequency 0
	
		PageTitle domain.org
		Template bootstrap	
		ServerID 900
		
		ContentTitle ntp1.domain.org
		Content {
			<p>NTP1 is a stratum two NTP time server. It supports time synchronization
			for peering Innolan servers and for users of pool.ntp.org. The server is
			an open time server and its service is available free of charge.</p>
			<p>Webpages showing information about NTP1 are build with NTP Analyzer
			which is a tool dedicated to analyzing the operation of time servers.
			NTP Analyzer is build around Mono and mostly complies with Microsoft.NET
			4.0. Source code is available under the MIT license.</p>
			<p>Styles are provided by Twitter Bootstrap which is available under the
			Apache 2.0 license. Graphs are build using NPlot which is available under
			the Modified BSD License. NPlot uses an X11 GDI+ library which together
			with Mono is licensed under a mixture of LGPL/GPL/X11 MIT licenses. 
			Specific license details can be found in source files.</p>
			<p>The server itself runs FreeBSD which is available under the Simplified BSD License.</p>
		}
		
		Destinations {
			File domain.org/ntp1/about.html
		}
		
		Link ntp1/about.html
	}
	
	HostPage innolan1 {
		InitialRun 1
		Frequency 5
		
		PageTitle ntp1.domain.org
		PeerPages innolan1-peers
		Template bootstrap
		PoolMember 1

		Images {
			Title Recent offset graphs
			LinkIndex 2
			
			Graph offset24
			Graph offset72
		}
		
		Images {
			Title Jitter/offset graphs
			LinkIndex 2
			
			Graph offset1
			Graph offset3
			Graph offset15
		}
		
		Images {
			Title Filtered graphs
			LinkIndex 2
			
			Graph offset1
			Graph offset1f
			Graph offset3
			Graph offset3f
			Graph offset15
			Graph offset15f
		}
		
		Images {
			Title Long term graphs
			LinkIndex 2
			
			Graph offset30
			Graph offset60
		}
		
		Summeries {
			PeerSummeryPage innolan1-offset
			PeerSummeryPage innolan1-delay
		}
		
		Destinations {
			File domain.org/ntp1/index.html
			File domain.org/ntp1.html
		}
		
		Link ntp1/
	}
	
	PeerPages innolan1-peers {
		InitialRun 1
		Frequency 240

		PageTitle ntp1.domain.org
		Template bootstrap

		Images {
			LinkIndex 2
			Title Recent offsets
			
			Graph offset24
			Graph offset72
		}
		
		Images {
			LinkIndex 2
			Title Jitter/offset
			
			Graph offset1
			Graph offset3
			Graph offset15
			Graph offset15f
		}
		
		Images {
			LinkIndex 2
			Title Peer balance/delay

			Graph delay
			Graph delayf
			Graph balance
			Graph balancef
		}
		
		Images {
			LinkIndex 2
			Title Long term graphs

			Graph offsetp30
			Graph delayp30
			Graph offsetp60
			Graph delayp60
		}
		
		Destinations {
			Directory domain.org/ntp1/peers/
		}
		
		Link ntp1/peers/		
	}
	
	PeerSummeryPage innolan1-offset {
		InitialRun 1
		Frequency 0
		
		PageTitle jitter/offset
		PeerPages innolan1-peers
		Template bootstrap
		
		Images {
			Title Raw offsets
			LinkIndex 2
			Graph offset15
		}
		
		Images {
			Title Filtered offset
			LinkIndex 2
			Graph offset15f
		}
		
		Images {
			Title Balanced offsets
			LinkIndex 2
			Graph balancef
		}
		
		Images {
			Title Long term offsets
			LinkIndex 2
			Graph offsetp30
			Graph offsetp60			
		}
		
		Destinations {
			File domain.org/ntp1/peers/graphs.html
		}
		
		Link ntp1/peers/graphs.html
	}
	
	PeerSummeryPage innolan1-delay {
		InitialRun 1
		Frequency 0
		
		PageTitle jitter/offset/delay
		PeerPages innolan1-peers
		Template bootstrap
		
		Images {
			Title Raw delays
			LinkIndex 2
			Graph delay
		}
		
		Images {
			Title Filtered delays
			LinkIndex 2
			Graph delayf
		}
		
		Images {
			Title Long term delays
			LinkIndex 2
			Graph delayp30
			Graph delayp60			
		}
		
		Destinations {
			File domain.org/ntp1/peers/delaygraphs.html
		}
		
		Link ntp1/peers/delaygraphs.html
	}
	
	HostGraphPage i1graphs {
		InitialRun 1
		Frequency 0
		
		GraphPage innolan1
		LinkIndex 2
		
		Destinations {
			Directory domain.org/ntp1/hgraphs/
		}
		
		Link ntp1/hgraphs/
	}
	
	PeerGraphPage i1pgraphs {
		InitialRun 1
		Frequency 0
		
		GraphPage innolan1-peers
		LinkIndex 2
		
		Destinations {
			Directory domain.org/ntp1/pgraphs/
		}
		
		Link ntp1/pgraphs/
	}
	
	########## Host graphs ##########
	
	HostGraph offset24 {
		InitialRun 1
		Frequency 10
		Timespan 1
		
		Title ntp1.domain.org 24 hours offset
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 0
		Jitter 0
		Offset 1000
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-h24-offset.png
			File domain.org/graphs/ntp1/ntp1-h24-offset.png
		}
		
		Links {
			Link ntpgraphs/ntp1-h24-offset.png
			Link graphs/ntp1/ntp1-h24-offset.png
		}
	}

	HostGraph offset72 {
		InitialRun 1
		Frequency 30
		Timespan 3
		
		Title ntp1.domain.org 72 hours offset
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 0
		Jitter 0
		Offset 1000
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-h72-offset.png
			File domain.org/graphs/ntp1/ntp1-h72-offset.png
		}
	
		Links {
			Link ntpgraphs/ntp1-h72-offset.png
			Link graphs/ntp1/ntp1-h72-offset.png
		}
	}

	HostGraph offset1 {
		InitialRun 1
		Frequency 15
		Timespan 1
		
		Title ntp1.domain.org (1 day)
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-1.png
			File domain.org/graphs/ntp1/ntp1-1.png
		}

		Links {
			Link ntpgraphs/ntp1-1.png
			Link graphs/ntp1/ntp1-1.png
		}
	}

	HostGraph offset3 {
		InitialRun 1
		Frequency 30
		Timespan 3
		
		Title ntp1.domain.org (3 days)
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-3.png
			File domain.org/graphs/ntp1/ntp1-3.png
		}
	
		Links {
			Link ntpgraphs/ntp1-3.png
			Link graphs/ntp1/ntp1-3.png
		}
	}

	HostGraph offset15 {
		InitialRun 1
		Frequency 45
		Timespan 15
		
		Title ntp1.domain.org (15 days)
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-15.png
			File domain.org/graphs/ntp1/ntp1-15.png
		}

		Links {
			Link ntpgraphs/ntp1-15.png
			Link graphs/ntp1/ntp1-15.png
		}
	}

	
	HostGraph offset1f {
		InitialRun 1
		Frequency 15
		Timespan 1
		
		Title ntp1.domain.org (1 day), avg < x4
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		FilterFactor 4
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-1f.png
			File domain.org/graphs/ntp1/ntp1-1f.png
		}

		Links {
			Link ntpgraphs/ntp1-1f.png
			Link graphs/ntp1/ntp1-1f.png
		}
	}

	HostGraph offset3f {
		InitialRun 1
		Frequency 30
		Timespan 3
		
		Title ntp1.domain.org (3 days), avg < x4
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		FilterFactor 4
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-3f.png
			File domain.org/graphs/ntp1/ntp1-3f.png
		}
	
		Links {
			Link ntpgraphs/ntp1-3f.png
			Link graphs/ntp1/ntp1-3f.png
		}
	}

	HostGraph offset15f {
		InitialRun 1
		Frequency 45
		Timespan 15
		
		Title ntp1.domain.org (15 days), avg < x4
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		FilterFactor 4
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-15f.png
			File domain.org/graphs/ntp1/ntp1-15f.png
		}

		Links {
			Link ntpgraphs/ntp1-15f.png
			Link graphs/ntp1/ntp1-15f.png
		}
	}
	
	HostGraph offset30 {
		InitialRun 0
		Frequency -1
		Timespan 30
		
		Title ntp1.domain.org (30 days)
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-30.png
			File domain.org/graphs/ntp1/ntp1-30.png
		}
		
		Links {
			Link ntpgraphs/ntp1-30.png
			Link graphs/ntp1/ntp1-30.png
		}
	}
	
	HostGraph offset60 {
		InitialRun 0
		Frequency -1
		Timespan 60
		
		Title ntp1.domain.org (60 days)
		Width 1024
		Height 550
		
		Stability 0
		GFrequency 1
		Jitter 1000
		Offset 1000
		
		Destinations {
			File ntp1.domain.org/ntpgraphs/ntp1-60.png
			File domain.org/graphs/ntp1/ntp1-60.png
		}
		
		Links {
			Link ntpgraphs/ntp1-60.png
			Link graphs/ntp1/ntp1-60.png
		}
	}
	
	########## Peer graphs ##########
	
	PeerGraphs offset24 {
		InitialRun 1
		Frequency 15
		Timespan 1

		Title 24 hours offset
		Width 1024
		Height 550
		Jitter 0
		Offset 1
		
		Destinations {
			Prefix offseth24-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offseth24-
			Link graphs/peer1/offseth24-
		}
	}

	PeerGraphs offset72 {
		InitialRun 1
		Frequency 15
		Timespan 3

		Title 72 hours offset
		Width 1024
		Height 550
		Jitter 0
		Offset 1
		
		Destinations {
			Prefix offset72-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offset72-
			Link graphs/peer1/offset72-
		}
	}
	
	PeerGraphs offset15 {
		InitialRun 1
		Frequency 180
		Timespan 15

		Title 15 days
		Width 1024
		Height 550
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix offset15-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offset15-
			Link graphs/peer1/offset15-
		}
	}
	
	PeerGraphs offset15f {
		InitialRun 1
		Frequency 180
		Timespan 15

		Title 15 days, x10 < avg
		Width 1024
		Height 550
		Jitter 1
		Offset 1
		FilterFactor 10

		Destinations {
			Prefix offset15f-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offset15f-
			Link graphs/peer1/offset15f-
		}
	}
	
	PeerGraphs offset1 {
		InitialRun 1
		Frequency 20
		Timespan 1

		Title 1 day
		Width 1024
		Height 550
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix offset1-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offset1-
			Link graphs/peer1/offset1-
		}
	}
	
	PeerGraphs offset3 {
		InitialRun 1
		Frequency 20		
		Timespan 3

		Title 3 days
		Width 1024
		Height 550
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix offset3-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offset3-
			Link graphs/peer1/offset3-
		}
	}
	
	PeerGraphs delay {
		InitialRun 1
		Frequency 180		
		Timespan 15

		Title 15 days delay
		Width 1024
		Height 550
		Delay 1
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix delay-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/delay-
			Link graphs/peer1/delay-
		}
	}
	
	PeerGraphs delayf {
		InitialRun 1
		Frequency 180		
		Timespan 15

		Title 15 days delay, x10 < avg
		Width 1024
		Height 550
		Delay 1
		Jitter 1
		Offset 1
		FilterFactor 10

		Destinations {
			Prefix delayf-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/delayf-
			Link graphs/peer1/delayf-
		}
	}
	
	PeerGraphs balance {
		InitialRun 1
		Frequency 180
		Timespan 15
		
		Title balanced offset 15 days
		Width 1024
		Height 550
		Balance 1
		Jitter 0
		Offset 1
		
		Destinations {
			Prefix balance-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/balance-
			Link graphs/peer1/balance-
		}
	}
	
	PeerGraphs balancef {
		InitialRun 1
		Frequency 180
		Timespan 15
		
		Title balanced offset 15 days, x10 < avg 
		Width 1024
		Height 550
		Balance 1
		Jitter 0
		Offset 1
		FilterFactor 10
		
		Destinations {
			Prefix balancef-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/balancef-
			Link graphs/peer1/balancef-
		}
	}
	
	PeerGraphs offsetp30 {
		InitialRun 0
		Frequency -1
		Timespan 30

		Title 30 days offset
		Width 1024
		Height 550
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix offset30-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offset30-
			Link graphs/peer1/offset30-
		}
	}
	
	PeerGraphs offsetp60 {
		InitialRun 0
		Frequency -1
		Timespan 60

		Title 60 days offset
		Width 1024
		Height 550
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix offset60-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/offset60-
			Link graphs/peer1/offset60-
		}
	}
	
	PeerGraphs delayp30 {
		InitialRun 0
		Frequency -1		
		Timespan 30

		Title 30 days delay
		Width 1024
		Height 550
		Delay 1
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix delay30-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/delay30-
			Link graphs/peer1/delay30-
		}
	}
	
	PeerGraphs delayp60 {
		InitialRun 0
		Frequency -1		
		Timespan 60

		Title 60 days delay
		Width 1024
		Height 550
		Delay 1
		Jitter 1
		Offset 1
		
		Destinations {
			Prefix delay60-
			Directory ntp1.domain.org/peergraphs/
			Directory domain.org/graphs/peer1/
		}
		
		Links {
			Link peergraphs/delay60-
			Link graphs/peer1/delay60-
		}
	}
}
