Improved error handling

This commit is contained in:
2016-03-14 21:38:34 +01:00
parent 182e69786e
commit 8994b34603
26 changed files with 787 additions and 85 deletions
+2 -1
View File
@@ -17,6 +17,7 @@ Run:
# sudo apt-get install mono-runtime # sudo apt-get install mono-runtime
# sudo apt-get install libgdiplus # sudo apt-get install libgdiplus
# sudo apt-get install mysql-server # sudo apt-get install mysql-server
# sudo apt-get install ntp
Windows Windows
------- -------
@@ -81,7 +82,7 @@ Now start ntpa and watch the data arriving in MySQL tables.
Also watch the logfile for errors and other debugging activities. Also watch the logfile for errors and other debugging activities.
Now start ntpa in daemon mode with: Now start ntpa in daemon mode with:
# &ntpa.exe # mono ntpa.exe &
To stop ntpa use kill. Find ntpa pid in log file. To stop ntpa use kill. Find ntpa pid in log file.
# kill 77342 # kill 77342
+17 -1
View File
@@ -74,7 +74,17 @@ namespace Ntp.Analyzer.Cli
/// <param name="args">The command-line arguments.</param> /// <param name="args">The command-line arguments.</param>
public static void Main (string[] args) public static void Main (string[] args)
{ {
string name = (args.Length > 1) ? args [1] : "NTPA_DEFAULT"; if (args.Length > 2) {
ShowUsage ();
return;
}
if (args.Length >= 1 && args[0] == "help") {
ShowUsage ();
return;
}
string name = (args.Length > 1) ? args [1] : "NTPA_DEF";
if (args.Length >= 1 && args [0] == "stop") { if (args.Length >= 1 && args [0] == "stop") {
string message = InterLock.Release (name); string message = InterLock.Release (name);
@@ -90,5 +100,11 @@ namespace Ntp.Analyzer.Cli
Main main = new Main (configFile, pid, name); Main main = new Main (configFile, pid, name);
main.Start (); main.Start ();
} }
private static void ShowUsage()
{
Console.WriteLine("NTP Analyzer Daemon.");
Console.WriteLine("Usage: ntpa [configuration file | stop] [instance name]");
}
} }
} }
+12 -5
View File
@@ -39,15 +39,22 @@ namespace Ntp.Analyzer.Data.Import
public string ImportServer(int orgId) public string ImportServer(int orgId)
{ {
string html = GetOrgHtml(orgId); string html = GetOrgHtml (orgId);
if (html == null) {
return null;
}
int serverTagPos = html.IndexOf(ServerTagStart, StringComparison.Ordinal); try {
int tableStartPos = html.IndexOf("<table", serverTagPos, StringComparison.Ordinal); int serverTagPos = html.IndexOf (ServerTagStart, StringComparison.Ordinal);
int tableEndPos = html.IndexOf(ServerTagEnd, serverTagPos, StringComparison.Ordinal); int tableStartPos = html.IndexOf ("<table", serverTagPos, StringComparison.Ordinal);
int tableEndPos = html.IndexOf (ServerTagEnd, serverTagPos, StringComparison.Ordinal);
string table = html.Substring(tableStartPos, tableEndPos - tableStartPos); string table = html.Substring (tableStartPos, tableEndPos - tableStartPos);
return table; return table;
} catch {
return null;
}
} }
private string GetOrgHtml(int orgId) private string GetOrgHtml(int orgId)
@@ -192,12 +192,20 @@ namespace Ntp.Analyzer.Data.Static
{ {
TimeServerLoader loader = new TimeServerLoader (); TimeServerLoader loader = new TimeServerLoader ();
TimeServerImporter importer = new TimeServerImporter (); TimeServerImporter importer = new TimeServerImporter ();
TimeServer server;
try {
string table = loader.ImportServer (id); string table = loader.ImportServer (id);
TimeServer server = importer.ParseTable (table, id); if (table == null) {
return null;
}
server = importer.ParseTable (table, id);
Insert (server); Insert (server);
AddItem (server); AddItem (server);
} catch (Exception e) {
throw new ApplicationException ("Failed to fetch time server data.", e);
}
return server; return server;
} }
+12
View File
@@ -42,6 +42,9 @@ namespace Ntp.Analyzer.Log
{ {
string severityText; string severityText;
if (severity == Severity.Trace)
return;
switch (severity) { switch (severity) {
case Severity.Error: case Severity.Error:
severityText = "E"; severityText = "E";
@@ -83,6 +86,15 @@ namespace Ntp.Analyzer.Log
WriteLine (exception.StackTrace, Severity.Debug); WriteLine (exception.StackTrace, Severity.Debug);
} }
public override void WriteLine (Exception exception, Severity severity)
{
if (severity == Severity.Trace)
return;
WriteLine (exception.Message, severity);
WriteLine (exception.StackTrace, severity);
}
public IEnumerator<string> GetEnumerator () public IEnumerator<string> GetEnumerator ()
{ {
return activity.GetEnumerator (); return activity.GetEnumerator ();
+2
View File
@@ -32,6 +32,8 @@ namespace Ntp.Analyzer.Log
{ {
public abstract void WriteLine(string text, Severity severity); public abstract void WriteLine(string text, Severity severity);
public abstract void WriteLine(Exception exception, Severity severity);
public abstract void WriteLine(Exception exception); public abstract void WriteLine(Exception exception);
} }
} }
+4
View File
@@ -95,6 +95,8 @@ namespace Ntp.Analyzer.Log
return Severity.Info; return Severity.Info;
case "debug": case "debug":
return Severity.Debug; return Severity.Debug;
case "trace":
return Severity.Trace;
default: default:
throw new ArgumentException ("Unknown severity type: " + text); throw new ArgumentException ("Unknown severity type: " + text);
} }
@@ -113,6 +115,8 @@ namespace Ntp.Analyzer.Log
return "info"; return "info";
case Severity.Debug: case Severity.Debug:
return "debug"; return "debug";
case Severity.Trace:
return "trace";
default: default:
throw new ArgumentException ("Unknown severity type: " + severity); throw new ArgumentException ("Unknown severity type: " + severity);
} }
+6
View File
@@ -50,6 +50,12 @@ namespace Ntp.Analyzer.Log
log.WriteLine(exception); log.WriteLine(exception);
} }
public override void WriteLine(Exception exception, Severity severity)
{
foreach (LogBase log in logs)
log.WriteLine(exception, severity);
}
public void Add(LogBase log) public void Add(LogBase log)
{ {
logs.Add(log); logs.Add(log);
+1
View File
@@ -28,6 +28,7 @@ namespace Ntp.Analyzer.Log
{ {
public enum Severity public enum Severity
{ {
Trace,
Debug, Debug,
Info, Info,
Notice, Notice,
+14 -3
View File
@@ -68,8 +68,7 @@ namespace Ntp.Analyzer.Log
string severityText; string severityText;
switch (severity) switch (severity) {
{
case Severity.Error: case Severity.Error:
severityText = "ERROR"; severityText = "ERROR";
break; break;
@@ -85,8 +84,11 @@ namespace Ntp.Analyzer.Log
case Severity.Debug: case Severity.Debug:
severityText = "DEBUG"; severityText = "DEBUG";
break; break;
case Severity.Trace:
severityText = "TRACE";
break;
default: default:
throw new ApplicationException("Unknown severity level."); throw new ApplicationException ("Unknown severity level.");
} }
DateTime now = DateTime.Now; DateTime now = DateTime.Now;
@@ -109,6 +111,15 @@ namespace Ntp.Analyzer.Log
WriteLine(exception.StackTrace, Severity.Debug); WriteLine(exception.StackTrace, Severity.Debug);
} }
public override void WriteLine(Exception exception, Severity severity)
{
if (severity < treshold)
return;
WriteLine(exception.Message, severity);
WriteLine(exception.StackTrace, severity);
}
public void Close() public void Close()
{ {
writer.Close(); writer.Close();
@@ -67,9 +67,10 @@ namespace Ntp.Analyzer.Process.Description
{ {
host = DataFace.Instance.Hosts.Single(h => h.Name == config.ServerName); host = DataFace.Instance.Hosts.Single(h => h.Name == config.ServerName);
} }
catch (Exception) catch (Exception e)
{ {
Log.WriteLine("Hostname not found in database: " + config.ServerName, Severity.Warn); Log.WriteLine("Hostname not found in database: " + config.ServerName, Severity.Warn);
Log.WriteLine (e, Severity.Trace);
return; return;
} }
@@ -68,9 +68,16 @@ namespace Ntp.Analyzer.Process.Description
return; return;
} }
NtpdcImporter imp;
try {
// Import from NTP daemon // Import from NTP daemon
NtpdcImporter imp = new NtpdcImporter (host, ReadingBulk.Current); imp = new NtpdcImporter (host, ReadingBulk.Current);
imp.Import (); imp.Import ();
} catch (Exception e) {
Log.WriteLine ("Could not get data from NTP daemon: " + e.Message, Severity.Warn);
Log.WriteLine (e, Severity.Trace);
return;
}
// Save to database // Save to database
foreach (HostReading reading in imp.Entries) { foreach (HostReading reading in imp.Entries) {
@@ -65,11 +65,14 @@ namespace Ntp.Analyzer.Process.Description
protected override void InternalExecute () protected override void InternalExecute ()
{ {
try {
Initalize (); Initalize ();
Import (); Import ();
SaveResult (); SaveResult ();
} catch (Exception e) {
Log.WriteLine ("Could not import peer data: " + e.Message, Severity.Warn);
Log.WriteLine (e, Severity.Trace);
}
} }
/// <summary> /// <summary>
@@ -83,8 +86,9 @@ namespace Ntp.Analyzer.Process.Description
// Find host in database. // Find host in database.
try { try {
host = DataFace.Instance.Hosts.Single (h => h.Name == config.ServerName); host = DataFace.Instance.Hosts.Single (h => h.Name == config.ServerName);
} catch (Exception) { } catch (Exception e) {
Log.WriteLine ("Hostname not found in database: " + config.ServerName, Severity.Warn); Log.WriteLine ("Hostname not found in database: " + config.ServerName, Severity.Warn);
Log.WriteLine (e, Severity.Trace);
return; return;
} }
@@ -66,9 +66,10 @@ namespace Ntp.Analyzer.Process.Description
{ {
host = DataFace.Instance.Hosts.Single(h => h.Name == config.ServerName); host = DataFace.Instance.Hosts.Single(h => h.Name == config.ServerName);
} }
catch (Exception) catch (Exception e)
{ {
Log.WriteLine("Hostname not found in database: " + config.ServerName, Severity.Warn); Log.WriteLine("Hostname not found in database: " + config.ServerName, Severity.Warn);
Log.WriteLine (e, Severity.Trace);
return; return;
} }
+1
View File
@@ -220,6 +220,7 @@ namespace Ntp.Analyzer.Process
} catch (Exception e) { } catch (Exception e) {
log.WriteLine ("Error during initialization of cluster node.", Severity.Error); log.WriteLine ("Error during initialization of cluster node.", Severity.Error);
log.WriteLine (e.ToString (), Severity.Error); log.WriteLine (e.ToString (), Severity.Error);
log.WriteLine (e, Severity.Trace);
} }
} }
@@ -21,7 +21,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
<Commandlineparameters>/home/hawk/code/ntp/rel/conf/ntpa.1.conf</Commandlineparameters> <Commandlineparameters>~/code/ntpa/example/ntpa.graph.conf</Commandlineparameters>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType> <DebugType>full</DebugType>
+5 -7
View File
@@ -41,22 +41,20 @@ namespace Ntp.Analyzer.Validate.Cli
public static void Main (string[] args) public static void Main (string[] args)
{ {
if (args.Length != 1) { if (args.Length != 1) {
Console.WriteLine("NTP Analyzer validator tool."); Console.WriteLine ("NTP Analyzer validator tool.");
Console.WriteLine ("Usage: ntpav configuration"); Console.WriteLine ("Usage: ntpav configuration");
return; return;
} }
string configFile = args [0]; string configFile = args [0];
if (!File.Exists (configFile)) {
Console.WriteLine("File does not exists: " + configFile);
return;
}
// Neutralize. // Neutralize.
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Configuration config = LoadConfig (configFile); Configuration config = LoadConfig (configFile);
if (config == null) {
return;
}
Console.WriteLine ("Parsed config ..."); Console.WriteLine ("Parsed config ...");
Console.WriteLine (config); Console.WriteLine (config);
@@ -112,7 +110,7 @@ namespace Ntp.Analyzer.Validate.Cli
} else if (item is StreamDestination) { } else if (item is StreamDestination) {
StreamDestination destination = item as StreamDestination; StreamDestination destination = item as StreamDestination;
destination.Test (); destination.Test ();
Console.Write ("Tested " + destination.AbsoluteLocation); Console.WriteLine ("Tested " + destination.AbsoluteLocation);
} }
} }
} catch (Exception ex) { } catch (Exception ex) {
+2 -1
View File
@@ -46,6 +46,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{79DFB57F-58F
example\ntp.conf = example\ntp.conf example\ntp.conf = example\ntp.conf
example\ntpa.stat.conf = example\ntpa.stat.conf example\ntpa.stat.conf = example\ntpa.stat.conf
example\ntpa.web.conf = example\ntpa.web.conf example\ntpa.web.conf = example\ntpa.web.conf
example\ntpa.graph.conf = example\ntpa.graph.conf
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
@@ -122,7 +123,7 @@ Global
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
EndGlobalSection EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Ntp.Analyzer.Cli\Ntp.Analyzer.Cli.csproj StartupItem = Ntp.Analyzer.Validate.Cli\Ntp.Analyzer.Validate.Cli.csproj
Policies = $0 Policies = $0
$0.DotNetNamingPolicy = $1 $0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = PrefixedHierarchical $1.DirectoryNamespaceAssociation = PrefixedHierarchical
@@ -61,8 +61,11 @@ namespace Ntp.Analyzer.Config.Page
link) link)
{ {
this.page = page; this.page = page;
if (page != null) {
page.AttachGraphPages (this); page.AttachGraphPages (this);
} }
}
private static readonly String[] Params = new[] { private static readonly String[] Params = new[] {
"HostGraphPage", "HostGraphPage",
@@ -62,8 +62,11 @@ namespace Ntp.Analyzer.Config.Page
link) link)
{ {
this.page = page; this.page = page;
if (page != null) {
page.AttachGraphPages (this); page.AttachGraphPages (this);
} }
}
private static readonly String[] Params = new[] { private static readonly String[] Params = new[] {
"PeerGraphPage", "PeerGraphPage",
+5
View File
@@ -34,6 +34,11 @@ namespace Ntp.Monitor.Cli
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
if (args.Length >= 1 && args[0] == "help") {
ShowUsage ();
return;
}
if (args.Length != 3) { if (args.Length != 3) {
ShowUsage(); ShowUsage();
return; return;
+4
View File
@@ -69,6 +69,7 @@ namespace Ntp.Monitor.Server
} catch (Exception ex) { } catch (Exception ex) {
log.WriteLine ("Error while initializing listener " + this.ToString (), Severity.Error); log.WriteLine ("Error while initializing listener " + this.ToString (), Severity.Error);
log.WriteLine (ex.Message, Severity.Debug); log.WriteLine (ex.Message, Severity.Debug);
log.WriteLine (ex, Severity.Trace);
} }
} }
@@ -104,6 +105,7 @@ namespace Ntp.Monitor.Server
} catch (Exception ex) { } catch (Exception ex) {
log.WriteLine ("Unexpected error in listener " + this.ToString (), Severity.Error); log.WriteLine ("Unexpected error in listener " + this.ToString (), Severity.Error);
log.WriteLine (ex.Message, Severity.Debug); log.WriteLine (ex.Message, Severity.Debug);
log.WriteLine (ex, Severity.Trace);
} }
} }
@@ -147,6 +149,7 @@ namespace Ntp.Monitor.Server
} catch (Exception ex) { } catch (Exception ex) {
log.WriteLine ("Unexpected error in listener " + this.ToString (), Severity.Error); log.WriteLine ("Unexpected error in listener " + this.ToString (), Severity.Error);
log.WriteLine (ex.Message, Severity.Debug); log.WriteLine (ex.Message, Severity.Debug);
log.WriteLine (ex, Severity.Trace);
} }
} }
@@ -172,6 +175,7 @@ namespace Ntp.Monitor.Server
} catch (Exception ex) { } catch (Exception ex) {
log.WriteLine ("Unexpected error in listener " + this.ToString (), Severity.Error); log.WriteLine ("Unexpected error in listener " + this.ToString (), Severity.Error);
log.WriteLine (ex.Message, Severity.Debug); log.WriteLine (ex.Message, Severity.Debug);
log.WriteLine (ex, Severity.Trace);
} }
} }
+6 -3
View File
@@ -25,11 +25,11 @@
// THE SOFTWARE. // THE SOFTWARE.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Ntp.Analyzer.Log;
using System.IO; using System.IO;
using System.Threading;
using System.Security.AccessControl; using System.Security.AccessControl;
using System.Security.Principal; using System.Security.Principal;
using System.Threading;
using Ntp.Analyzer.Log;
namespace Ntp.Process namespace Ntp.Process
{ {
@@ -86,8 +86,9 @@ namespace Ntp.Process
if (answer != null && answer == "active") { if (answer != null && answer == "active") {
otherActive = true; otherActive = true;
} }
} catch (Exception) { } catch (Exception e) {
log.WriteLine ("Error while contacting cluster node " + request, Severity.Warn); log.WriteLine ("Error while contacting cluster node " + request, Severity.Warn);
log.WriteLine (e, Severity.Trace);
} }
} }
@@ -99,6 +100,7 @@ namespace Ntp.Process
} catch (Exception e) { } catch (Exception e) {
log.WriteLine ("Error in scheduler module. Arborting.", Severity.Error); log.WriteLine ("Error in scheduler module. Arborting.", Severity.Error);
log.WriteLine (e.ToString (), Severity.Error); log.WriteLine (e.ToString (), Severity.Error);
log.WriteLine (e, Severity.Trace);
return; return;
} }
} else { } else {
@@ -125,6 +127,7 @@ namespace Ntp.Process
} catch (Exception e) { } catch (Exception e) {
log.WriteLine ("Error in mutux. Arborting.", Severity.Error); log.WriteLine ("Error in mutux. Arborting.", Severity.Error);
log.WriteLine (e.ToString (), Severity.Error); log.WriteLine (e.ToString (), Severity.Error);
log.WriteLine (e, Severity.Trace);
} }
log.WriteLine ("Closing down.", Severity.Notice); log.WriteLine ("Closing down.", Severity.Notice);
+8 -6
View File
@@ -38,28 +38,27 @@ namespace Ntp.Process
{ {
public static string Release (string name) public static string Release (string name)
{ {
using (Socket socket = new Socket (AddressFamily.Unix, SocketType.Stream, ProtocolType.IP)) {
try { try {
UnixEndPoint endPoint = new UnixEndPoint (name); socket.Connect (new UnixEndPoint (name));
Socket socket = new Socket (AddressFamily.Unix, SocketType.Stream, ProtocolType.IP);
socket.Connect (endPoint);
byte[] bytes = Encoding.UTF8.GetBytes ("RELEASE"); byte[] bytes = Encoding.UTF8.GetBytes ("RELEASE");
socket.Send (bytes); socket.Send (bytes);
socket.Close (); socket.Close ();
} catch (Exception e) { } catch (Exception e) {
return e.Message; return e.Message;
} }
}
return null; return null;
} }
public static string Wait (string name) public static string Wait (string name)
{ {
UnixEndPoint endPoint = new UnixEndPoint (name);
Socket socket = new Socket (AddressFamily.Unix, SocketType.Stream, ProtocolType.IP);
byte[] buf = new byte[64]; byte[] buf = new byte[64];
using (Socket socket = new Socket (AddressFamily.Unix, SocketType.Stream, ProtocolType.IP)) {
try { try {
socket.Bind (endPoint); socket.Bind (new UnixEndPoint (name));
socket.Listen (5); socket.Listen (5);
Socket sock = socket.Accept (); Socket sock = socket.Accept ();
sock.Receive (buf); sock.Receive (buf);
@@ -67,8 +66,11 @@ namespace Ntp.Process
} catch (Exception e) { } catch (Exception e) {
return e.Message; return e.Message;
} finally { } finally {
if (socket != null && socket.IsBound) {
socket.Close (); socket.Close ();
} }
}
}
return null; return null;
} }
+601
View File
@@ -0,0 +1,601 @@
########################################################################
# Configuration for NTP Analyzer Web Front #
########################################################################
# Connection parameters to MySQL database instance.
Database {
Host 127.0.0.1
Name ntpa
User ntpau
Pass xxxx
}
Listener {
IP 127.0.0.1
Port 9070
}
Log {
Severity notice
File /var/log/ntpa.graph.log
}
Server {
# Primary key in table 'host'
HostID 1
# Domain name of hosting NTP server
HostName 192.168.222.114
# NTP configuration file with IDs from support.ntp.org
ConfigFile /opt/ntpa/config/ntp.conf
# Base path for generated files
FilePath graphs/
# Base URL for generated files
WebPath /
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-
}
}
}
+2 -2
View File
@@ -15,8 +15,8 @@ Listener {
} }
Log { Log {
Severity debug Severity trace
File /var/log/ntpa-stat.log File /var/log/ntpa.stat.log
} }
# Use to syncronize timestamp for readings accross different NTP servers # Use to syncronize timestamp for readings accross different NTP servers