1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> 5<meta name="generator" content="HTML Tidy, see www.w3.org"> 6<title>Monitoring Options</title> 7<link href="scripts/style.css" type="text/css" rel="stylesheet"> 8</head> 9<body> 10<h3>Monitoring Commands and Options</h3> 11<img src="pic/pogo8.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html"></a> from <i>Pogo</i>, Walt Kelly</a> 12<p>Pig was hired to watch the logs.</p> 13<p>Last update: 14 <!-- #BeginDate format:En2m -->14-Feb-2016 09:38<!-- #EndDate --> 15 UTC</p> 16<br clear="left"> 17<h4>Related Links</h4> 18<script type="text/javascript" language="javascript" src="scripts/command.txt"></script> 19<script type="text/javascript" language="javascript" src="scripts/monopt.txt"></script> 20<h4>Table of Contents</h4> 21<ul> 22 <li class="inline"><a href="#intro">Naming Conventions</a></li> 23 <li class="inline"><a href="#cmd">Monitoring Commands and Options</a></li> 24 <li class="inline"><a href="#types">File Set Types</a></li> 25</ul> 26<hr> 27<h4 id="intro">Naming Conventions</h4> 28<p>The <tt>ntpd</tt> includes a comprehensive monitoring facility which collects 29 statistical data of various types and writes the data to files associated with 30 each type at defined events or intervals. The files associated with a particular 31 type are collectively called the generation file set for that type. The files 32 in the file set are the members of that set.</p> 33<p>File sets have names specific to the type and generation epoch. The names 34 are constructed from three concatenated elements <i><tt>prefix</tt></i>, <i><tt>filename</tt></i> and <i><tt>suffix</tt></i>:</p> 35<dl> 36 <dt><i><tt>prefix</tt></i></dt> 37 <dd>The directory path specified in the <tt>statsdir</tt> command.</dd> 38 <dt><i><tt>name</tt></i></dt> 39 <dd>The name specified by the <tt>file</tt> option of the <tt>filegen</tt> command.</dd> 40 <dt><i><tt>suffix</tt></i></dt> 41 <dd>A string of elements bdginning with . (dot) followed by a number of elements 42 depending on the file set type.</dd> 43</dl> 44<p>Statistics files can be managed using scripts, examples of which are in the <tt>./scripts</tt> directory. 45 Using these or similar scripts and Unix <tt>cron</tt> jobs, the files can be 46 automatically summarized and archived for retrospective analysis.</p> 47<h4 id="cmd">Monitoring Commands and Options</h4> 48<p>Unless noted otherwise, further information about these commands is on the <a href="decode.html">Event Messages and Status Codes</a> page.</p></a> page.</p><dl> 49 <dt id="filegen"><tt>filegen <i>name</i> [file <i>filename</i>] [type <i>type</i>] 50 [link | nolink] [enable | disable]</tt></dt> 51 <dd> 52 <dl> 53 <dt><i><tt>name</tt></i></dt> 54 <dd>Specifies the file set type from the list in the next section.</dd> 55 <dt><tt>file <i>filename</i></tt></dt> 56 <dd>Specifies the filename prefix. The default is the file set type, such as "loopstats".</dd> 57 <dt><tt>type <i>typename</i></tt></dt> 58 <dd>Specifies the file set interval. The following intervals are supported 59 with default <tt>day</tt>:</dd> 60 <dd> 61 <dl> 62 <dt><tt>none</tt></dt> 63 <dd>The file set is actually a single plain file.</dd> 64 <dt><tt>pid</tt></dt> 65 <dd>One file set member is created for every incarnation of <tt>ntpd</tt>. 66 The file name suffix is the string .<tt>n</tt>, where <tt>n</tt> is the 67 process ID of the <tt>ntpd</tt> server process.</dd> 68 <dt><tt>day</tt></dt> 69 <dd>One file set member is created per day. A day is defined as the period 70 between 00:00 and 23:59 UTC. The file name suffix is the string .<tt>yyyymmdd</tt>, 71 where <tt>yyyy</tt> is the year, <tt>mm</tt> the month of the year and <tt>dd</tt> the 72 day of the month. Thus, member created on 10 December 1992 would have suffix <tt>.19921210</tt>.</dd> 73 <dt><tt>week</tt></dt> 74 <dd>One file set member is created per week. The week is defined as the 75 day of year modulo 7. The file name suffix is the string .<tt>yyyyWww</tt>, 76 where <tt>yyyy</tt> is the year, <tt>W</tt> stands for itself and <tt>ww</tt> the 77 week number starting from 0. For example, The member created on 10 January 78 1992 would have suffix <tt>.1992W1</tt>.</dd> 79 <dt><tt>month</tt></dt> 80 <dd>One file set member is created per month. The file name suffix is the 81 string .<tt>yyyymm</tt>, where <tt>yyyy</tt> is the year and <tt>mm</tt> the 82 month of the year starting from 1. For example, The member created on 10 83 January 1992 would have suffix <tt>.199201</tt>.</dd> 84 <dt><tt>year</tt></dt> 85 <dd>One file set member is generated per year. The file name suffix is the 86 string .<tt>yyyy</tt>, where <tt>yyyy</tt> is the year. For example, The 87 member created on 1 January 1992 would have suffix <tt>.1992</tt>.</dd> 88 <dt><tt>age</tt></dt> 89 <dd>One file set member is generated every 24 hours of <tt>ntpd</tt> operation. 90 The filename suffix is the string <tt>.adddddddd</tt>, where <tt>a</tt> stands 91 for itself and <tt>dddddddd</tt> is the <tt>ntpd</tt> running time in seconds 92 at the start of the corresponding 24-hour period.</dd> 93 </dl> 94 </dd> 95 <dt><tt>link | nolink</tt></dt> 96 <dd>It is convenient to be able to access the current file set members by 97 file name, but without the suffix. This feature is enabled by <tt>link</tt> and 98 disabled by <tt>nolink</tt>. If enabled, which is the default, a hard link 99 from the current file set member to a file without suffix is created. When 100 there is already a file with this name and the number of links to this file 101 is one, it is renamed by appending a dot, the letter <tt>C</tt>, and the 102 pid of the <tt>ntpd</tt> server process. When the number of links is greater 103 than one, the file is unlinked. This allows the current file to be accessed 104 by a constant name.</dd> 105 <dt><tt>enable | disable</tt></dt> 106 <dd>Enable or disable the recording function, with default <tt>enable</tt>. 107 These options are intended for remote configuration commands.</dd> 108 </dl> 109 </dd> 110 <dt id="statistics"><tt>statistics <i>name</i>...</tt></dt> 111 <dd>Enables writing of statistics records. Currently, eight kinds of 112 statistics are supported: <i>name</i>s specify the file set type(s) from 113 the list in the next section.</dd> 114 <dt id="statsdir"><tt>statsdir <i>directory_path</i></tt></dt> 115 <dd>Specify the directory path prefix for statistics file names.</dd> 116</dl> 117<h4 id="types">File Set Types</h4> 118<dl> 119 <dt><tt>clockstats</tt></dt> 120 <dd>Record reference clock statistics. Each update received from a reference 121 clock driver appends one line to the <tt>clockstats</tt> file set:</dd> 122 <dd><tt>49213 525.624 127.127.4.1 93 226 00:08:29.606 D</tt></dd> 123 <dd> 124 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 125 <tr> 126 <td>Item</td> 127 <td>Units</td> 128 <td>Description</td> 129 </tr> 130 <tr> 131 <td><tt>49213</tt></td> 132 <td>MJD</td> 133 <td>date</td> 134 </tr> 135 <tr> 136 <td><tt>525.624</tt></td> 137 <td>s</td> 138 <td>time past midnight</td> 139 </tr> 140 <tr> 141 <td><tt>127.127.4.1</tt></td> 142 <td>IP</td> 143 <td>reference clock address</td> 144 </tr> 145 <tr> 146 <td><tt><i>message</i></tt></td> 147 <td>text</td> 148 <td>log message</td> 149 </tr> 150 </table> 151 </dd> 152 <dd>The <tt><i>message</i></tt> field includes the last timecode received in 153 decoded ASCII format, where meaningful. In some cases a good deal of additional 154 information is displayed. See information specific to each reference clock 155 for further details.</dd> 156 <dt><tt>cryptostats</tt></dt> 157 <dd>Record significant events in the Autokey protocol. This option requires 158 the OpenSSL cryptographic software library. Each event appends one line to 159 the <tt>cryptostats</tt> file set:</dd> 160 <dd><tt>49213 525.624 128.4.1.1 <i>message</i></tt></dd> 161 <dd> 162 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 163 <tr> 164 <td>Item</td> 165 <td>Units</td> 166 <td>Description</td> 167 </tr> 168 <tr> 169 <td><tt>49213</tt></td> 170 <td>MJD</td> 171 <td>date</td> 172 </tr> 173 <tr> 174 <td><tt>525.624</tt></td> 175 <td>s</td> 176 <td>time past midnight</td> 177 </tr> 178 <tr> 179 <td><tt>128.4.1.1</tt></td> 180 <td>IP</td> 181 <td>source address (<tt>0.0.0.0</tt> for system)</td> 182 </tr> 183 <tr> 184 <td><tt><i>message</i></tt></td> 185 <td>text</td> 186 <td>log message</td> 187 </tr> 188 </table> 189 </dd> 190 <dd>The <tt><i>message</i></tt> field includes the message type and certain 191 ancillary information. See the <a href="authopt.html">Authentication Options</a> page 192 for further information.</dd> 193 <dt><tt>loopstats</tt></dt> 194 <dd>Record clock discipline loop statistics. Each system clock update appends 195 one line to the <tt>loopstats</tt> file set:</dd> 196 <dd><tt>50935 75440.031 0.000006019 13.778 0.000351733 0.013380 6</tt></dd> 197 <dd> 198 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 199 <tr> 200 <td>Item</td> 201 <td>Units</td> 202 <td>Description</td> 203 </tr> 204 <tr> 205 <td><tt>50935</tt></td> 206 <td>MJD</td> 207 <td>date</td> 208 </tr> 209 <tr> 210 <td><tt>75440.031</tt></td> 211 <td>s</td> 212 <td>time past midnight</td> 213 </tr> 214 <tr> 215 <td><tt>0.000006019</tt></td> 216 <td>s</td> 217 <td>clock offset</td> 218 </tr> 219 <tr> 220 <td><tt>13.778</tt></td> 221 <td>PPM</td> 222 <td>frequency offset</td> 223 </tr> 224 <tr> 225 <td><tt>0.000351733</tt></td> 226 <td>s</td> 227 <td>RMS jitter</td> 228 </tr> 229 <tr> 230 <td><tt>0.013380</tt></td> 231 <td>PPM</td> 232 <td>RMS frequency jitter (aka wander)</td> 233 </tr> 234 <tr> 235 <td><tt>6 </tt></td> 236 <td>log<sub>2</sub> s</td> 237 <td>clock discipline loop time constant</td> 238 </tr> 239 </table> 240 </dd> 241 <dt><tt>peerstats</tt></dt> 242 <dd>Record peer statistics. Each NTP packet or reference clock update received 243 appends one line to the <tt>peerstats</tt> file set:</dd> 244 <dd><tt>48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877 245 0.000958674</tt></dd> 246 <dd> 247 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 248 <tr> 249 <td>Item</td> 250 <td>Units</td> 251 <td>Description</td> 252 </tr> 253 <tr> 254 <td><tt>48773</tt></td> 255 <td>MJD</td> 256 <td>date</td> 257 </tr> 258 <tr> 259 <td><tt>10847.650</tt></td> 260 <td>s</td> 261 <td>time past midnight</td> 262 </tr> 263 <tr> 264 <td><tt>127.127.4.1</tt></td> 265 <td>IP</td> 266 <td>source address</td> 267 </tr> 268 <tr> 269 <td><tt>9714</tt></td> 270 <td>hex</td> 271 <td>status word</td> 272 </tr> 273 <tr> 274 <td><tt>-0.001605376</tt></td> 275 <td>s</td> 276 <td>clock offset</td> 277 </tr> 278 <tr> 279 <td><tt>0.000000000 </tt></td> 280 <td>s</td> 281 <td>roundtrip delay</td> 282 </tr> 283 <tr> 284 <td><tt>0.001424877</tt></td> 285 <td>s</td> 286 <td>dispersion</td> 287 </tr> 288 <tr> 289 <td><tt>0.000958674</tt></td> 290 <td>s</td> 291 <td>RMS jitter</td> 292 </tr> 293 </table> 294 </dd> 295 <dd>The status field is encoded in hex format as described in Appendix B of 296 the NTP specification RFC 1305.</dd> 297 <dt><tt>protostats</tt></dt> 298 <dd>Record significant peer, system and protocol events. Each significant event 299 appends one line to the <tt>protostats</tt> file set:</dd> 300 <dd><tt>49213 525.624 128.4.1.1 963a 8a <i>message</i></tt></dd> 301 <dd> 302 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 303 <tr> 304 <td>Item</td> 305 <td>Units</td> 306 <td>Description</td> 307 </tr> 308 <tr> 309 <td><tt>49213</tt></td> 310 <td>MJD</td> 311 <td>date</td> 312 </tr> 313 <tr> 314 <td><tt>525.624</tt></td> 315 <td>s</td> 316 <td>time past midnight</td> 317 </tr> 318 <tr> 319 <td><tt>128.4.1.1</tt></td> 320 <td>IP</td> 321 <td>source address (<tt>0.0.0.0</tt> for system)</td> 322 </tr> 323 <tr> 324 <td><tt>963a</tt></td> 325 <td>code</td> 326 <td>status word</td> 327 </tr> 328 <tr> 329 <td><tt>8a</tt></td> 330 <td>code</td> 331 <td>event message code</td> 332 </tr> 333 <tr> 334 <td><tt><i>message</i></tt></td> 335 <td>text</td> 336 <td>event message</td> 337 </tr> 338 </table> 339 </dd> 340 <dd>The event message code and <tt><i>message</i></tt> field are described on 341 the <a href="decode.html">Event Messages and Status Words</a> page.</dd> 342 <dt><tt>rawstats</tt></dt> 343 <dd>Record timestamp statistics. Each NTP packet received appends one line to 344 the <tt>rawstats</tt> file set:</dd> 345 <dd><tt>56285 54575.160 128.4.1.1 192.168.1.5 3565350574.400229473 3565350574.442385200 3565350574.442436000 3565350575.154505763 0 4 4 1 8 -21 0.000000 0.000320 .PPS.</tt></dd> 346 <dd> 347 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 348 <tr> 349 <td>Item</td> 350 <td>Units</td> 351 <td>Description</td> 352 </tr> 353 <tr> 354 <td><tt>56285</tt></td> 355 <td>MJD</td> 356 <td>date</td> 357 </tr> 358 <tr> 359 <td><tt>54575.160</tt></td> 360 <td>s</td> 361 <td>time past midnight</td> 362 </tr> 363 <tr> 364 <td><tt>128.4.1.1</tt></td> 365 <td>IP</td> 366 <td>source address</td> 367 </tr> 368 <tr> 369 <td><tt>192.168.1.5</tt></td> 370 <td>IP</td> 371 <td>destination address</td> 372 </tr> 373 <tr> 374 <td><tt>3565350574.400229473</tt></td> 375 <td>NTP s</td> 376 <td>origin timestamp</td> 377 </tr> 378 <tr> 379 <td><tt>3565350574.442385200</tt></td> 380 <td>NTP s</td> 381 <td>receive timestamp</td> 382 </tr> 383 <tr> 384 <td><tt>3565350574.442436000</tt></td> 385 <td>NTP s</td> 386 <td>transmit timestamp</td> 387 </tr> 388 <tr> 389 <td><tt>3565350575.154505763</tt></td> 390 <td>NTP s</td> 391 <td>destination timestamp</td> 392 </tr> 393 <tr> 394 <td><tt>0</tt></td> 395 <td>0: OK, 1: insert pending,<br>2: delete pending, 3: not synced</td> 396 <td>leap warning indicator</td> 397 </tr> 398 <tr> 399 <td><tt>4</tt></td> 400 <td>4 was current in 2012</td> 401 <td>NTP version</td> 402 </tr> 403 <tr> 404 <td><tt>4</tt></td> 405 <td>3: client, 4: server, 5: broadcast</td> 406 <td>mode</td> 407 </tr> 408 <tr> 409 <td><tt>1</tt></td> 410 <td>1-15, 16: not synced</td> 411 <td>stratum</td> 412 </tr> 413 <tr> 414 <td><tt>8</tt></td> 415 <td>log<sub>2</sub> seconds</td> 416 <td>poll</td> 417 </tr> 418 <tr> 419 <td><tt>-21</tt></td> 420 <td>log<sub>2</sub> seconds</td> 421 <td>precision</td> 422 </tr> 423 <tr> 424 <td><tt>0.000000</tt></td> 425 <td>seconds</td> 426 <td>total roundtrip delay to the primary reference clock</td> 427 </tr> 428 <tr> 429 <td><tt>0.000320</tt></td> 430 <td>seconds</td> 431 <td>total dispersion to the primary reference clock</td> 432 </tr> 433 <tr> 434 <td><tt>PPS.</tt></td> 435 <td>IP or text</td> 436 <td>refid, association ID</td> 437 </tr> 438 </table> 439 </dd> 440 <dt><tt>sysstats</tt></dt> 441 <dd>Record system statistics. Each hour one line is appended to the <tt>sysstats</tt> file 442 set in the following format:</dd> 443 <dd><tt>50928 2132.543 3600 81965 0 9546 56 512 540 10 4 147 1</tt></dd> 444 <dd> 445 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 446 <tr> 447 <td>Item</td> 448 <td>Units</td> 449 <td>Description</td> 450 </tr> 451 <tr> 452 <td><tt>50928</tt></td> 453 <td>MJD</td> 454 <td>date</td> 455 </tr> 456 <tr> 457 <td><tt>2132.543</tt></td> 458 <td>s</td> 459 <td>time past midnight</td> 460 </tr> 461 <tr> 462 <td><tt>3600</tt></td> 463 <td>s</td> 464 <td>time since reset</td> 465 </tr> 466 <tr> 467 <td><tt>81965</tt></td> 468 <td>#</td> 469 <td>packets received</td> 470 </tr> 471 <tr> 472 <td><tt>0</tt></td> 473 <td>#</td> 474 <td>packets for this host</td> 475 </tr> 476 <tr> 477 <td><tt>9546</tt></td> 478 <td>#</td> 479 <td>current versions</td> 480 </tr> 481 <tr> 482 <td><tt>56</tt></td> 483 <td>#</td> 484 <td>old version</td> 485 </tr> 486 <tr> 487 <td><tt>512</tt></td> 488 <td>#</td> 489 <td>access denied</td> 490 </tr> 491 <tr> 492 <td><tt>540</tt></td> 493 <td>#</td> 494 <td>bad length or format</td> 495 </tr> 496 <tr> 497 <td><tt>10</tt></td> 498 <td>#</td> 499 <td>bad authentication</td> 500 </tr> 501 <tr> 502 <td><tt>4</tt></td> 503 <td>#</td> 504 <td>declined</td> 505 </tr> 506 <tr> 507 <td><tt>147</tt></td> 508 <td>#</td> 509 <td>rate exceeded</td> 510 </tr> 511 <tr> 512 <td><tt>1</tt></td> 513 <td>#</td> 514 <td>kiss-o'-death packets sent</td> 515 </tr> 516 </table> 517 </dd> 518 <dt><tt>timingstats</tt></dt> 519 <dd>(Only available when the deamon is compiled with process time debugging 520 support (--enable-debug-timing - costs performance). Record processing time 521 statistics for various selected code paths.</dd> 522 <dd><tt>53876 36.920 10.0.3.5 1 0.000014592 input processing delay</tt></dd> 523 <dd> 524 <table width="100%" border="1" cellspacing="2" cellpadding="2"> 525 <tr> 526 <td>Item</td> 527 <td>Units</td> 528 <td>Description</td> 529 </tr> 530 <tr> 531 <td><tt>53876</tt></td> 532 <td>MJD</td> 533 <td>date</td> 534 </tr> 535 <tr> 536 <td><tt>36.920</tt></td> 537 <td>s</td> 538 <td>time past midnight</td> 539 </tr> 540 <tr> 541 <td><tt>10.0.3.5</tt></td> 542 <td>IP</td> 543 <td>server address</td> 544 </tr> 545 <tr> 546 <td><tt>1</tt></td> 547 <td>#</td> 548 <td>event count</td> 549 </tr> 550 <tr> 551 <td><tt>0.000014592</tt></td> 552 <td>s</td> 553 <td>total time</td> 554 </tr> 555 <tr> 556 <td><tt><i>message</i></tt></td> 557 <td>text</td> 558 <td>code path description (see source)</td> 559 </tr> 560 </table> 561 </dd> 562</dl> 563<hr> 564<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> 565</body> 566</html> 567