mirror of
https://bitbucket.org/anguist/ntpa
synced 2025-10-06 02:51:23 +00:00
Updated documentation
This commit is contained in:
69
INSTALL
69
INSTALL
@ -1,25 +1,68 @@
|
||||
FreeBSD 10.x
|
||||
------------
|
||||
Install Dependencies
|
||||
--------------------
|
||||
|
||||
To run data collection core:
|
||||
FreeBSD
|
||||
-------
|
||||
|
||||
Run as root:
|
||||
# pkg install mono
|
||||
# pkg install libgdiplus
|
||||
# pkg install mysql-server
|
||||
|
||||
Adjust create_date.sql with real values and run:
|
||||
# mysql < run create_tables.sql
|
||||
# mysql < run create_data.sql
|
||||
Ubuntu
|
||||
------
|
||||
|
||||
Copy ntp.conf from NTP host to the machine running ntpa and add timeserver ID from support.ntp.org.
|
||||
Search using google.com with f.x.
|
||||
Run:
|
||||
# sudo apt-get install mono-runtime
|
||||
# sudo apt-get install libgdiplus
|
||||
# sudo apt-get install mysql-server
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
Download a copy of ntpq and ntpdc. Make sure .NET is installed and
|
||||
the required MySQL Server is accessible. Download and install MySQL
|
||||
if needed.
|
||||
|
||||
|
||||
Configure ntpa
|
||||
--------------
|
||||
|
||||
Copy ntpa.stat.conf from example to /etc/ntpa.conf
|
||||
In ntpa.conf Hostname must point to a name or IP reachable by ntpq.
|
||||
ConfigFile must must point to ntp.conf.
|
||||
Adjust the values of HostName and ConfigFile setting accordingly.
|
||||
|
||||
Validate ntpa.con file with ntpav using:
|
||||
# ntpav /etc/ntpa.conf
|
||||
|
||||
Copy ntp.conf from NTP host to the machine running ntpa and then add
|
||||
timeserver ID from support.ntp.org. Search using google.com with f.x.
|
||||
"ntp1.innolan.net" site:support.ntp.org
|
||||
For servers not registered on support.ntp.org just add 10000 and above.
|
||||
|
||||
copy ntpa.stat.conf.dist to /etc/ntpa.conf
|
||||
Adjust the value of HostName and ConfigFile setting. Hostname must point to a name or IP reachable
|
||||
by ntpq to get statistics. ConfigFile must match ntp.conf and ntp.conf must have timerserver IDs.
|
||||
See ntp.conf in example on how to add time server IDs.
|
||||
|
||||
validate ntpa.con file with ntpav using:
|
||||
# ntpav /etc/ntpa.conf
|
||||
Configure database
|
||||
------------------
|
||||
|
||||
Now adjust create_data.sql with real values. For host rows:
|
||||
name is name used to query with ntpdc. Must match name/ip in ntp.conf
|
||||
ip is IP address as shown in generated web pages
|
||||
orgId is ID from support.ntp.org. Use 10000 or above for non registered servers
|
||||
|
||||
For peer rows:
|
||||
name is name shown in generated web pages
|
||||
ip is IP address as received from ntpq -pn
|
||||
orgId is ID from support.ntp.org. Use 10000 or above for non registered servers
|
||||
|
||||
Run:
|
||||
# mysql < run create_tables.sql
|
||||
# mysql < run create_data.sql
|
||||
|
||||
|
||||
Start NTP Analyzer
|
||||
------------------
|
||||
|
||||
Now start ntpa and watch the data arriving in MySQL tables.
|
||||
# mono ntpa.exe
|
||||
|
@ -14,7 +14,7 @@ EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sql", "sql", "{F70A2719-A82B-49AE-9EDF-7DCEB231637D}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
sql\create_tables.sql = sql\create_tables.sql
|
||||
sql\create_tables.sql = sql\create_tables.sql
|
||||
sql\create_data.sql = sql\create_data.sql
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ntp.Analyzer.Cli", "Ntp.Analyzer.Cli\Ntp.Analyzer.Cli.csproj", "{6A635537-E5E9-493E-8B89-E0E5EBB64E72}"
|
||||
@ -25,15 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ntp.Monitor", "Ntp.Monitor\
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ntp.Monitor.Cli", "Ntp.Monitor.Cli\Ntp.Monitor.Cli.csproj", "{0349CF56-C07C-46B5-B9CD-2BCB2709EE0A}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dist", "dist", "{F8812D0A-C818-489A-8DDD-343AF1689F63}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
dist\makedist.sh = dist\makedist.sh
|
||||
dist\ntpa.1.conf.dist = dist\ntpa.1.conf.dist
|
||||
dist\README = dist\README
|
||||
dist\ntp.conf = dist\ntp.conf
|
||||
dist\ntpa.stat.conf = dist\ntpa.stat.conf
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ntp.Monitor.Server", "Ntp.Monitor.Server\Ntp.Monitor.Server.csproj", "{13FA10AB-D656-4D72-BC69-2525D484C9DE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ntp.Monitor.Client", "Ntp.Monitor.Client\Ntp.Monitor.Client.csproj", "{44D739DA-4CD4-4214-88EE-A9A293BB32B5}"
|
||||
@ -52,6 +43,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{79DFB57F-58F
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
config\ntpa.s1.conf = config\ntpa.s1.conf
|
||||
INSTALL = INSTALL
|
||||
example\ntp.conf = example\ntp.conf
|
||||
example\ntpa.stat.conf = example\ntpa.stat.conf
|
||||
example\ntpa.web.conf = example\ntpa.web.conf
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
|
@ -1,9 +0,0 @@
|
||||
################################################ support.ntp.ord ID ##############################
|
||||
peer ntp2.innolan.dk iburst maxpoll 10 # 0901 Denmark Copenhagen
|
||||
server 192.36.144.22 iburst minpoll 10 # 0250 Sweden Stockholm, Netnod IX
|
||||
...
|
||||
|
||||
driftfile /etc/ntp/drift
|
||||
|
||||
statsdir /etc/ntp/
|
||||
statistics clockstats
|
@ -1,63 +0,0 @@
|
||||
#########################################################
|
||||
# Configuration for NTP Analyzer statistical recordings #
|
||||
#########################################################
|
||||
|
||||
Database {
|
||||
DatabaseHost 192.168.0.1
|
||||
DatabaseName ntpa
|
||||
DatabaseUser ntpau
|
||||
DatabasePass xxx
|
||||
}
|
||||
|
||||
Log {
|
||||
Severity debug
|
||||
File /var/log/ntpa-stat.log
|
||||
}
|
||||
|
||||
# Use to syncronize timestamp for readings accross different NTP servers
|
||||
Reading {
|
||||
Name stat1
|
||||
|
||||
# Indicate if generation should happen immidiatly after startup
|
||||
InitialRun 0
|
||||
|
||||
# Minutes between reading values from NTP servers.
|
||||
Frequency 5
|
||||
}
|
||||
|
||||
Server {
|
||||
|
||||
# Primary key in table 'host'
|
||||
HostID 1
|
||||
|
||||
# Domain name of hosting NTP server
|
||||
HostName ntp1.domain.org
|
||||
|
||||
# NTP configuration file with IDs from support.ntp.org
|
||||
ConfigFile /usr/local/www/ntpconf/ntp.conf.dist
|
||||
|
||||
HostStats {
|
||||
# Use name defined in Reading section or number of minutes between readings.
|
||||
Frequency stat1
|
||||
}
|
||||
|
||||
PeerStats {
|
||||
Frequency stat1
|
||||
}
|
||||
}
|
||||
|
||||
# Support for multiple servers
|
||||
#Server {
|
||||
# HostID 2
|
||||
# HostName ntp2.domain.org
|
||||
# ConfigFile /usr/local/www/ntpconf/ntp.conf2.dist
|
||||
#
|
||||
# HostStats {
|
||||
# Frequency stat1
|
||||
# }
|
||||
#
|
||||
# PeerStats {
|
||||
# Frequency stat1
|
||||
# }
|
||||
#}
|
||||
#
|
26
dist/README
vendored
26
dist/README
vendored
@ -1,26 +0,0 @@
|
||||
NTP Analyzer 0.2
|
||||
|
||||
Author:
|
||||
Carsten Sonne Larsen <cs@innolan.dk>
|
||||
|
||||
Copyright (c) 2013 Carsten Sonne Larsen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
Released 11th October, 2013
|
55
dist/makedist.sh
vendored
55
dist/makedist.sh
vendored
@ -1,55 +0,0 @@
|
||||
|
||||
echo cleanup ...
|
||||
|
||||
rm -R ../NPlot/bin
|
||||
rm -R ../Ntp.Analyzer/bin
|
||||
rm -R ../Ntp.Analyzer.Data/bin
|
||||
rm -R ../Ntp.Analyzer.Log/bin
|
||||
rm -R ../Ntp.Analyzer.Objects/bin
|
||||
rm -R ../Ntp.Analyzer.Process/bin
|
||||
rm -R ../Ntp.Config/bin
|
||||
|
||||
rm -R ../NPlot/obj
|
||||
rm -R ../Ntp.Analyzer/obj
|
||||
rm -R ../Ntp.Analyzer.Data/obj
|
||||
rm -R ../Ntp.Analyzer.Log/obj
|
||||
rm -R ../Ntp.Analyzer.Objects/obj
|
||||
rm -R ../Ntp.Analyzer.Process/obj
|
||||
rm -R ../Ntp.Config/obj
|
||||
rm -R dist
|
||||
|
||||
echo copy source ...
|
||||
mkdir dist
|
||||
|
||||
cp -R ../NPlot dist
|
||||
cp -R ../Ntp.Analyzer dist
|
||||
cp -R ../Ntp.Analyzer.Cli dist
|
||||
cp -R ../Ntp.Analyzer.Data dist
|
||||
cp -R ../Ntp.Analyzer.Log dist
|
||||
cp -R ../Ntp.Analyzer.Objects dist
|
||||
cp -R ../Ntp.Analyzer.Process dist
|
||||
cp -R ../Ntp.Config dist
|
||||
|
||||
cp -R ../lib dist
|
||||
cp -R ../Ntp.Analyzer.dist.sln dist
|
||||
|
||||
echo copy database and webparts ...
|
||||
mkdir dist/html
|
||||
cp -R ../html/css dist/html
|
||||
cp -R ../html/fonts dist/html
|
||||
cp -R ../html/js dist/html
|
||||
|
||||
mkdir dist/sql
|
||||
cp ../sql/create_tables.sql dist/sql/
|
||||
cp ../sql/create_test_data.sql dist/sql/
|
||||
|
||||
mkdir dist/config
|
||||
|
||||
cp ntp.conf.dist dist/config/
|
||||
cp ntpa.stat.conf.dist dist/config/
|
||||
cp ntpa.1.conf.dist dist/config/
|
||||
|
||||
cp README dist/
|
||||
|
||||
echo packing ...
|
||||
tar -cvzf ntpa.0.11.tar.gz dist/*
|
1056
dist/ntpa.1.conf.dist
vendored
1056
dist/ntpa.1.conf.dist
vendored
File diff suppressed because it is too large
Load Diff
@ -3,15 +3,15 @@
|
||||
#########################################################
|
||||
|
||||
Database {
|
||||
Host 192.168.0.1
|
||||
Host 127.0.0.1
|
||||
Name ntpa
|
||||
User ntpau
|
||||
Pass xxxx
|
||||
}
|
||||
|
||||
Listener {
|
||||
IP 192.168.0.1
|
||||
Port 9030
|
||||
IP 127.0.0.1
|
||||
Port 9070
|
||||
}
|
||||
|
||||
Log {
|
||||
@ -37,11 +37,11 @@ Server {
|
||||
# Primary key in table 'host'
|
||||
HostID 1
|
||||
|
||||
# Domain name of hosting NTP server (used by for ntpq)
|
||||
# Domain name of hosting NTP server (used by ntpq and ntpdc)
|
||||
HostName ntp1.domain.org
|
||||
|
||||
# NTP configuration file with IDs from support.ntp.org
|
||||
ConfigFile /usr/local/www/ntpconf/ntp.conf.dist
|
||||
ConfigFile /usr/local/www/ntpconf/ntp.conf
|
||||
|
||||
HostStats {
|
||||
# Use name defined in Reading section or number of minutes between readings.
|
@ -1,3 +1,8 @@
|
||||
USE ntpa;
|
||||
|
||||
INSERT INTO host (ip, name, orgId) VALUES ('90.184.222.114', 'ntp1.innolan.net', 901);
|
||||
INSERT INTO host (ip, name, orgId) VALUES ('90.184.222.114', 'ntp1.innolan.net', 900);
|
||||
|
||||
INSERT INTO peer (ip, name, orgId) VALUES ('90.184.222.115', 'ntp2.innolan.net', 901);
|
||||
INSERT INTO peer (ip, name, orgId) VALUES ('192.36.144.22', 'ntp1.sth.netnod.se', 250);
|
||||
|
||||
COMMIT;
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- CREATE DATABASE ntpa; -- CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
CREATE DATABASE ntpa; -- CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
USE ntpa;
|
||||
|
||||
-- DROP USER 'ntpau'@'localhost';
|
||||
@ -14,16 +14,16 @@ FLUSH PRIVILEGES;
|
||||
|
||||
CREATE TABLE host (
|
||||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(30) NOT NULL,
|
||||
ip VARCHAR(15) NOT NULL,
|
||||
orgId INT
|
||||
name VARCHAR(30) NOT NULL, -- Name used to query with ntpdc. Must match name/ip in ntp.conf
|
||||
ip VARCHAR(15) NOT NULL, -- IP address as shown in generated web pages
|
||||
orgId INT -- ID from support.ntp.org. Use 10000 or above for non registered servers
|
||||
) ENGINE=INNODB;
|
||||
|
||||
CREATE TABLE peer (
|
||||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(30) NULL,
|
||||
ip VARCHAR(15) NULL,
|
||||
orgId INT
|
||||
name VARCHAR(30) NULL, -- Name shown in generated web pages
|
||||
ip VARCHAR(15) NULL, -- IP address as received from ntpq -pn
|
||||
orgId INT -- ID from support.ntp.org. Use 10000 or above for non registered servers
|
||||
) ENGINE=INNODB;
|
||||
|
||||
CREATE TABLE peerReading (
|
||||
@ -53,26 +53,6 @@ CREATE TABLE hostReading (
|
||||
FOREIGN KEY (peerId) REFERENCES peer(id)
|
||||
) ENGINE=INNODB;
|
||||
|
||||
-- /usr/sbin/ntpdc -c loopinfo -c sysinfo innolan.dk
|
||||
-- offset: 0.002156 s
|
||||
-- frequency: -3.236 ppm
|
||||
-- poll adjust: -21
|
||||
-- watchdog timer: 341 s
|
||||
-- system peer: ntp1.gbg.netnod.se
|
||||
-- system peer mode: client
|
||||
-- leap indicator: 00
|
||||
-- stratum: 2
|
||||
-- precision: -19
|
||||
-- root distance: 0.02443 s
|
||||
-- root dispersion: 0.02937 s
|
||||
-- reference ID: [192.36.133.17]
|
||||
-- reference time: d57ad9b4.ed0799db Sun, Jun 30 2013 18:22:12.925
|
||||
-- system flags: auth monitor ntp kernel stats
|
||||
-- jitter: 0.000290 s
|
||||
-- stability: 0.000 ppm
|
||||
-- broadcastdelay: 0.000000 s
|
||||
-- authdelay: 0.000050 s
|
||||
|
||||
CREATE TABLE timeServer (
|
||||
id INT NOT NULL PRIMARY KEY,
|
||||
stratum INT NOT NULL,
|
||||
@ -100,6 +80,8 @@ CREATE TABLE timeServer (
|
||||
providerUrl VARCHAR(255) NULL
|
||||
) ENGINE=INNODB;
|
||||
|
||||
|
||||
/* Only needed when doing IP package analysis
|
||||
CREATE TABLE ntpPacket (
|
||||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
time TIMESTAMP NOT NULL,
|
||||
@ -135,5 +117,6 @@ CREATE TABLE peerNtpPacket (
|
||||
FOREIGN KEY (hostId) REFERENCES host(id),
|
||||
FOREIGN KEY (sourcePeerId) REFERENCES sourcePeer(id)
|
||||
) ENGINE=INNODB;
|
||||
*/
|
||||
|
||||
COMMIT;
|
Reference in New Issue
Block a user