1
0
mirror of https://bitbucket.org/anguist/ntpa synced 2025-10-05 18:41:13 +00:00

Updated configuration

This commit is contained in:
2016-03-11 23:22:40 +01:00
parent 54e0b49ccc
commit 3a970744be
8 changed files with 413 additions and 13 deletions

246
.gitignore vendored Normal file
View File

@ -0,0 +1,246 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml

33
INSTALL Normal file
View File

@ -0,0 +1,33 @@
FreeBSD 10.x
------------
To run data collection core:
# pkg install mono
# pkg install libgdiplus
Adjust create_date.sql with real values and run:
# mysql < run create_tables.sql
# mysql < run create_data.sql
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.
"ntp1.innolan.net" site:support.ntp.org
For servers not registret 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 timersver IDs.
validate ntpa.con file with ntpav using:
# ntpav /etc/ntpa.conf
Now start ntpa and watch the data arriving in MySQL tables.
# mono ntpa.exe
Also watch the logfile for errors and other debugging activities.
Now start ntpa in deamon mode with:
# &mono ntpa.exe
To stop ntpa use kill. Find ntpa pid in log file.
# kill 77342

View File

@ -35,7 +35,7 @@ namespace Ntp.Analyzer.Cli
/// </summary> /// </summary>
public static class MainClass public static class MainClass
{ {
[DllImport("libc.so")] [DllImport("libc")]
private static extern int getpid (); private static extern int getpid ();
[DllImport ("libc")] // Linux [DllImport ("libc")] // Linux

View File

@ -48,6 +48,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ntp.Process", "Ntp.Process\
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NPlot", "NPlot\NPlot.csproj", "{C2DEBED1-FE91-4929-B686-8E920731E88C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NPlot", "NPlot\NPlot.csproj", "{C2DEBED1-FE91-4929-B686-8E920731E88C}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{79DFB57F-58FD-4F34-A722-60E3B598EBE8}"
ProjectSection(SolutionItems) = preProject
config\ntpa.s1.conf = config\ntpa.s1.conf
INSTALL = INSTALL
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU

113
config/ntpa.s1.conf Normal file
View File

@ -0,0 +1,113 @@
#####################################################################
# Configuration for NTP Analyzer - Statistic configuration - S1 #
# - This file is used as configuration in a production environment. #
#####################################################################
Database {
Host 172.20.83.1
Name ntpa
User ntpau
Pass xx
}
Listener {
IP 172.20.87.1
Port 9091
}
Cluster {
Node stat2 {
IP 172.20.87.2
Port 9091
}
Node stat3 {
IP 172.20.87.3
Port 9091
}
}
Log {
Severity info
File /app/log/ntpa.s1.log
}
########################## application jobs #########################
Notify ntpstat-summery {
InitialRun 1
Frequency 1440
Mail ntpa-op@innolan.dk
Subject NTP Analyzer stats daily run - stat 1
Sender ntpa@innolan.dk
Smtp 172.20.87.1
Port 25
}
Reading stat-bulk-1 {
Name stat1
InitialRun 0
FixedRun 1
Frequency 3
}
########################## ntp1.innolan.net ##########################
Server {
HostID 1
HostName ntp1.innolan.net
ConfigFile /app/conf/ntp.conf.ntp1
HostStats ntp1-host-stat {
Frequency stat1
}
HostIOStats ntp1-host-iostat {
Frequency stat1
}
PeerStats ntp1-peer-stat {
Frequency stat1
}
}
########################## ntp2.innolan.net ##########################
Server {
HostID 2
HostName ntp2.innolan.net
ConfigFile /app/conf/ntp.conf.ntp2
HostStats ntp2-host-stat {
Frequency stat1
}
HostIOStats ntp2-host-iostat {
Frequency stat1
}
PeerStats ntp2-peer-stat {
Frequency stat1
}
}
########################## ntp3.innolan.net ##########################
Server {
HostID 3
HostName ntp3.innolan.net
ConfigFile /app/conf/ntp.conf.ntp3
HostStats ntp3-host-stat {
Frequency stat1
}
HostIOStats ntp3-host-iostat {
Frequency stat1
}
PeerStats ntp3-peer-stat {
Frequency stat1
}
}

View File

@ -3,10 +3,10 @@
######################################################### #########################################################
Database { Database {
DatabaseHost 192.168.0.1 Host 192.168.0.1
DatabaseName ntpa Name ntpa
DatabaseUser ntpau User ntpau
DatabasePass xxx Pass xxxx
} }
Log { Log {
@ -23,14 +23,16 @@ Reading {
# Minutes between reading values from NTP servers. # Minutes between reading values from NTP servers.
Frequency 5 Frequency 5
# Indicate if readings should happen at rounded intervals.
FixedRun 1
} }
Server { Server {
# Primary key in table 'host' # Primary key in table 'host'
HostID 1 HostID 1
# Domain name of hosting NTP server # Domain name of hosting NTP server (used by for ntpq)
HostName ntp1.domain.org HostName ntp1.domain.org
# NTP configuration file with IDs from support.ntp.org # NTP configuration file with IDs from support.ntp.org

View File

@ -1,16 +1,16 @@
-- CREATE DATABASE ntpa; -- CHARACTER SET utf8 COLLATE utf8_bin; -- CREATE DATABASE ntpa; -- CHARACTER SET utf8 COLLATE utf8_bin;
USE ntpa; USE ntpa;
DROP USER 'ntpau'@'localhost'; -- DROP USER 'ntpau'@'localhost';
CREATE USER 'ntpau'@'localhost' IDENTIFIED BY 'xxxx'; CREATE USER 'ntpau'@'localhost' IDENTIFIED BY 'xxxx';
GRANT ALL PRIVILEGES ON ntpa.* TO 'ntpau'@'localhost'; GRANT ALL PRIVILEGES ON ntpa.* TO 'ntpau'@'localhost';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
DROP TABLE hostReading; -- DROP TABLE hostReading;
DROP TABLE peerReading; -- DROP TABLE peerReading;
DROP TABLE host; -- DROP TABLE host;
DROP TABLE peer; -- DROP TABLE peer;
CREATE TABLE host ( CREATE TABLE host (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

View File

@ -1,3 +1,3 @@
USE ntpa; USE ntpa;
INSERT INTO host (ip, name, orgId) VALUES ('0.0.1.1', 'ntp1.innolan.dk', 23); INSERT INTO host (ip, name, orgId) VALUES ('90.184.222.114', 'ntp1.innolan.net', 901);