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

# Connection parameters to SQL database instance.
Database {
        # Select either MySQL or PostgreSQL
        Provider MySQL

        # Address of SQL server
        Host 127.0.0.1

        # Port of SQL server.
        #Port 2567

        # Name of database
        Name ntpa

        # Database username
        User ntpau

        # Password for the user
        Pass password
}

Log {
        # Levels: error, warn, notice, info, debug and trace
        Severity info
        File /var/log/ntpa/ntpa.web.log
}

Notify ntpstat-summary {
        # Indicate if a test mail should be sent immediately after start up
        InitialRun 1

        # Send a mail every 1440 minutes or 24 hours
        Frequency 1440

        # Send the mail to this address
        Mail webmaster@example.com

        # Subject of mail
        Subject NTP Analyzer stats daily run - web

        # Sender of mail
        Sender ntpa@example.com

        # Address of SMTP host
        SmtpHost 127.0.0.1

        # Port number on SMTP host. The default port number is 25.
        #SmtpPort 25
}

# Multiple server configurations are available
Server {
        # Primary key in table 'host'
        HostID 1
        
        # Address queried by ntpq and ntpdc
        HostAddress ntp1.example.net
        
        # The utility used to query ntpd. Use ntpdc for old hosts.  
        HostType ntpq
        
        # Base path for generated files
        FilePath /usr/local/www/ntpa
        
        # Base URL for generated files
        WebPath /
        
        ########## Webpages ##########
        
        # Main page for a host
        HostPage ntp1 {
                # Indicate if generation should happen immediately after start up
                InitialRun 1

                # Minutes between generation of page
                Frequency 5

                PageTitle ntp1.example.net

                # Use either 'default' or 'bootstrap'
                Template default

                # Link to peer web pages
                PeerPages ntp1-peers

                # Set to 1 if this page should show a link to pool.ntp.org
                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 summary pages
                Summaries {
                        PeerSummaryPage ntp1-offset
                        PeerSummaryPage ntp1-delay
                }

                # Name and path to generated file.
                # Multiple files is an option.
                Destinations {
                        File ntp1.example.net/index.html
                }
        }

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

                PageTitle ntp1.example.net
                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.example.net/peers/
                }
                
                # Base URL to generated files.
                Link peers/
        }
        
        # Web page for summary graphs
        # Same usage as host configuration options
        PeerSummaryPage ntp1-offset {
                InitialRun 1
                Frequency 1080
                
                PageTitle jitter/offset
                PeerPages ntp1-peers
                Template default
                
                # Links to other configuration sections
                Images {
                        LinkIndex 1
                        Graph offset15
                        Graph offset15f
                }
                
                Destinations {
                        File ntp1.example.net/peers/graphs.html
                }
                
                Link peers/graphs.html
        }
        
        PeerSummaryPage 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.example.net/peers/delaygraphs.html
                }
                
                Link peers/delaygraphs.html
        }
        
        ############### Bootstrap menu ##############
        
        #Options for boot strap menu
        Menu {
                Item title {
                        Type Name
                        Caption example.net
                        Link http://example.net
                }
                
                Item main {
                        Caption NTP1
                        Page example1
                }
        
                Item {
                        Caption Offsets
                        Page example1-offset
                }
        
                Item {
                        Caption Delays
                        Page example1-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@example.dk
                                }
                        }
                }
        }
        
        ########## Webpages with bootstrap theme ##########
        
        AboutPage about1 {
                InitialRun 1
                Frequency 0
                
                PageTitle example.net
                Template bootstrap
                ServerID 125
                
                ContentTitle ntp1.example.net
                Content {
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et risus vel leo interdum fringilla.
                    Vestibulum ex justo, euismod ac consequat nec, tempor a massa. Donec elementum malesuada congue.
                    Vestibulum eget lacus eu mauris eleifend finibus. Integer quis dolor et metus ultricies finibus.
                    Quisque porta, ipsum non consectetur luctus, nibh turpis imperdiet velit, sit amet ultricies orci
                    arcu sit amet enim. Suspendisse faucibus arcu ac porttitor mattis.</p>
                }
                
                Destinations {
                        File example.net/ntp1/about.html
                }
                
                Link ntp1/about.html
        }
        
        HostPage example1 {
                InitialRun 1
                Frequency 5
                
                PageTitle ntp1.example.net
                PeerPages example1-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
                }
                
                Summaries {
                        PeerSummaryPage example1-offset
                        PeerSummaryPage example1-delay
                }
                
                Destinations {
                        File example.net/ntp1/index.html
                        File example.net/ntp1.html
                }
                
                Link ntp1/
        }
        
        PeerPages example1-peers {
                InitialRun 1
                Frequency 240

                PageTitle ntp1.example.net
                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 example.net/ntp1/peers/
                }
                
                Link ntp1/peers/
        }
        
        PeerSummaryPage example1-offset {
                InitialRun 1
                Frequency 0
                
                PageTitle jitter/offset
                PeerPages example1-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 example.net/ntp1/peers/graphs.html
                }
                
                Link ntp1/peers/graphs.html
        }
        
        PeerSummaryPage example1-delay {
                InitialRun 1
                Frequency 0
                
                PageTitle jitter/offset/delay
                PeerPages example1-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 example.net/ntp1/peers/delaygraphs.html
                }
                
                Link ntp1/peers/delaygraphs.html
        }
        
        HostGraphPage i1graphs {
                InitialRun 1
                Frequency 0
                
                GraphPage example1
                LinkIndex 2
                
                Destinations {
                        Directory example.net/ntp1/hgraphs/
                }
                
                Link ntp1/hgraphs/
        }
        
        PeerGraphPage i1pgraphs {
                InitialRun 1
                Frequency 0
                
                GraphPage example1-peers
                LinkIndex 2
                
                Destinations {
                        Directory example.net/ntp1/pgraphs/
                }
                
                Link ntp1/pgraphs/
        }
        
        ########## Host graphs ##########
        
        HostGraph offset24 {
                InitialRun 1
                Frequency 10
                Timespan 1
                
                Title ntp1.example.net 24 hours offset
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 0
                Jitter 0
                Offset 1
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-h24-offset.png
                        File example.net/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.example.net 72 hours offset
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 0
                Jitter 0
                Offset 1
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-h72-offset.png
                        File example.net/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.example.net (1 day)
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-1.png
                        File example.net/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.example.net (3 days)
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-3.png
                        File example.net/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.example.net (15 days)
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-15.png
                        File example.net/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.example.net (1 day), avg < x4
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                FilterFactor 4
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-1f.png
                        File example.net/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.example.net (3 days), avg < x4
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                FilterFactor 4
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-3f.png
                        File example.net/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.example.net (15 days), avg < x4
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                FilterFactor 4
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-15f.png
                        File example.net/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.example.net (30 days)
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-30.png
                        File example.net/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.example.net (60 days)
                Width 1024
                Height 550
                
                Stability 0
                GFrequency 1
                Jitter 1
                Offset 1
                
                Destinations {
                        File ntp1.example.net/ntpgraphs/ntp1-60.png
                        File example.net/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 offset24-
                        Directory ntp1.example.net/peergraphs/
                        Directory example.net/graphs/peer1/
                }
                
                Links {
                        Link peergraphs/offset24-
                        Link graphs/peer1/offset24-
                }
        }

        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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/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.example.net/peergraphs/
                        Directory example.net/graphs/peer1/
                }
                
                Links {
                        Link peergraphs/delay60-
                        Link graphs/peer1/delay60-
                }
        }
}
