#########################################################
# Configuration for NTP Analyzer statistical recordings #
#########################################################

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

        # Set to 1 to automatically create all tables and data
        Create 1

        # NOTICE: This feature is not yet implemented
        # Set to 1 to monitor the database link
        #Monitor 1
}

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

Log {
        Type Syslog
        Severity Info
}

Log {
        Type Console
        Severity Debug
}

Daemon {
        # Heartbeat rate in minutes
        Heartbeat 120
}

# Synchronize timestamps for readings across different NTP servers/peers
Reading {
        Name stat1

        # Indicate if generation should happen immediately after start up
        InitialRun 0

        # Minutes between reading values from NTP servers.
        Frequency 5

        # Indicate if readings should happen at rounded intervals.
        FixedRun 1

        # Stamp readings with either UTC or Local time
        # Use UTC if your servers are located in different time zones
        TimeStamp UTC
}

Server {
        # Primary key in database 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

        HostStats {
                # Use name defined in Reading section or number of minutes between readings.
                Frequency stat1

                # Stamp readings with either UTC or Local time
                TimeStamp UTC
        }

        HostIOStats {
                Frequency stat1
        }

        PeerStats {
                Frequency stat1
        }
}

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 root@example.net

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

        # Sender of mail
        Sender sender@example.net

        # Address of SMTP host
        SmtpHost smtp.example.net

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

        # Username for SMTP server. Should be used with SSL turned on or in local networks.
        SmtpUser username

        # Password for SMTP server. Should be used with SSL turned on or in local networks.
        SmtpPass password

        # Set to 1 when using RFC 3207 SMTP. Default is disabled.
        EnableSsl 1
}