File: book.tex

package info (click to toggle)
remstats 1.00a4-8woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,576 kB
  • ctags: 1,020
  • sloc: perl: 11,706; ansic: 2,776; makefile: 944; sh: 869
file content (5729 lines) | stat: -rw-r--r-- 216,247 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
\documentclass{book}
\usepackage{index}
\makeindex
\begin{document}
\newcommand{\unknowncharacter}[1]{}
\author{Thomas Erskine}
\title{Remstats 1.00a4}
\date{Mon Sep 10 15:18:31 EDT 2001}
\maketitle
\tableofcontents
%------------------------------------ index.pod ---

\chapter{About Remstats}
\index{About Remstats}

Remstats is a system of programs to:

\begin{itemize}


\item  gather data from servers and routers,

\item  store and maintain the data for long periods,

\item  produce graphs and web-pages tieing them together, and

\item  monitor the data for anomalous behavious and issue alerts

\end{itemize}
It's built on
RRDtool (see \textbf{http://ee-staff.ethz.ch/\~{}oetiker/webtools/rrdtool/}).
There is a proto-FAQ (see the proto-FAQ section) ; feel free to contribute.  There's
also a to-do list (see the to-do list section)  to give some idea what might be coming.

\subsection{Where to get it}%
\index{Where to get it}

The best available version is 0.13.1.  You can get it at 
http://remstats.sourceforge.net/release/src/remstats-0.13.1.tar.gz (see \textbf{http://remstats.sourceforge.net/release/src/remstats-0.13.1.tar.gz}).
The current version is 1.00a4.  (This version may not be
available yet, as I will push out new documentation before the
new release, to make additions/corrections available as soon 
as possible.)  You can get other versions of remstats from the 
source archive (see \textbf{http://remstats.sourceforge.net/release/src}).  Since almost all of it is 
written in perl (see \textbf{http://www.perl.org/}) scripts, there is no binary version.  

\subsection{How to get started}%
\index{How to get started}

First, you should make sure that you have all the requirements (see the requirements section) .
Then read the installation docs (see the installation docs section) .  Then read the 
server installation docs (see the server installation docs section) .  

Then check out run-remstats (see the run-remstats section)  which runs almost everything else and documents
how all the pieces work together.

Thank-you (see the Thank-you section) .
%------------------------------------ releasenotes.pod ---

\chapter{Release Notes}
\index{Release Notes}

\section{Release Notes for Remstats version 1.0a3}%
\index{Release Notes for Remstats version 1.0a3}

It's always a good idea to run check-config (see the check-config section)  after changing any of the
config-files, but it's also a good idea to run it after doing an upgrade,
especially when, as in this version, there are changes to the config-files.

Mostly small new features and bug-fixes, except:

\begin{itemize}


\item  \textbf{Incompatible:} re-written alert-sending mechanism.  Permits
easily written new methods of sending alerts, by separating the alert-text generation
(see alerter (see the alerter section) ) from the alert-sending (see alert-email (see the alert-email section)  and alert-winpopup (see the alert-winpopup section) ).
The new alert-destination-map (see the alert-destination-map section)  config-file permits
mapping an alert-destination to different addresses depending on the time-of-day, 
day-of-week, ... and its alias facility permits sending to a list of addresses
which may use different methods of sending the alert.

\item  \textbf{Incompatible:} The unix-status-server (see the unix-status-server section) 's do\_df now returns 
\textbf{bytes} not \textbf{K-bytes}.  This avoids silliness in the graphs saying that 
you've got 20k kbytes free.  It may have been correct, but it wasn't
intuitive.  You can multiply all the old numbers by 1000 to convert RRDs.

\item  \textbf{Warning:} new-config (see the new-config section)  now copies the configuration files which 
you are likely to change, so that your changes won't be overwritten by an 
update to remstats.  Unfortunately, as all updates (including this one) 
will overwrite config-base, so people upgrading from a previous version 
of remstats should convert the following files from symlinks to config-base
into copies of those files:
\begin{itemize}


\item alerts alert-destination-map general html links tools

\end{itemize}
You can do this by running the supplied convert-config-links (see the convert-config-links section)  script
\textbf{BEFORE INSTALLING THIS VERSION}


\end{itemize}
\subsection{New Features}%
\index{New Features}

\begin{itemize}


\item  the new datapage-status (see the datapage-status section)  script generates datapages for each host, which will
show the current values of all rrd variables.  There is a new tool in the default 
tools config-file (see the tools config-file section) 
which will show this page, and it's been added to the defaults generated by the 
new-xxx-hosts (see the new-xxx-hosts section)  programs.

\item  Host templates (see the Host templates section) .  So that you can configure
similar hosts like:
\begin{verbatim}%
	desc	whatever
	template their-template\end{verbatim}

Can also be used to make changing some things for many hosts easier.  E.G., you
could have a template, say \texttt{default-nt-status-server} which contained:

\begin{verbatim}%
	nt-status-server some-host\end{verbatim}

and configure all hosts which use c$<$some-host$>$ like:

\begin{verbatim}%
	template default-nt-status-server\end{verbatim}


\item  New availability-report (see the availability-report section)  and 
availability-report.cgi (see the availability-report.cgi section)  and config-file
availability (see the availability section)  for reporting on "availability".

\item  New nt-status-server (see the nt-status-server section)  and nt-status-collector (see the nt-status-collector section)  and RRDs for them 
(ntactivity, ntmemory, ntpaging, ntnetwork and ntlogicaldisk-*).

\item  New cleanup (see the cleanup section)  program to remove stale files.

\item  New new-snmp-hosts (see the new-snmp-hosts section)  now adds other rrds than snmpif-*

\item  New new-unix-hosts (see the new-unix-hosts section)  program to add hosts which are running the
unix-status-server (see the unix-status-server section)  with the apropriate rrds.

\item  ought to work with perl 5.6 now.  I'm not using perl 5.6 on the main 
collector yet, but it seems to install correctly on a test system.

\item  run-remstats (see the run-remstats section)  now checks all configuration sub-directories to figure
out if anything has changed, so you ought to be able to just edit files and
the changes will get caught on the next run.

\item  remstats internal instrumentation allows monitoring remstats collectors,
for now.  More later.  Look at the pseudo-host \_remstats\_.

\item  removed old Overall Index, since I never looked at it, and wrote a new
RRD Index, which I was always wanting.

\item  new nt-discover (see the nt-discover section)  program to discover and add NT systems
\textbf{Note}: this adds the new discovery config-file (see the discovery config-file section)  which
must be locally configured.  I won't even attempt to guess at values here.


\item  The old \texttt{alertflag} entry in the html config-file (see the html config-file section)  has
been replaced by three new entries: \texttt{alertflagcritical}, \texttt{alertflagerror} and 
\texttt{alertflagwarn}, allowing e.g. different colors for the different levels of alert.

\item  datapage.cgi (see the datapage.cgi section)  now does variable substitution properly 
for HTML macros.  See the example datapage upss.page under /home/remstats/etc/config/datapages.

\item  datapage.cgi (see the datapage.cgi section)  and dataimage.cgi (see the dataimage.cgi section)  have two
new commands: \texttt{alertstatus} and \texttt{alertvalue} to fetch alert statuses and values.
To be used on forthcoming status pages.

\end{itemize}
\chapter{Release Notes}
\index{Release Notes}

\section{Release Notes for Remstats version 0.13.1}%
\index{Release Notes for Remstats version 0.13.1}

I fixed a minor buglet in 0.13.0 which was noticed shortly after release.
I was annoyed enough with it that I made 0.13.1.

\chapter{Release Notes}
\index{Release Notes}

\section{Release Notes for Remstats version 0.13.0 (AKA 0.12.2)}%
\index{Release Notes for Remstats version 0.13.0 (AKA 0.12.2)}

There are lots of little improvements, which are detailed in the
Change History (see the Change History section) , which I'm not going into here.  The main
incompatible changes are:

\begin{itemize}


\item  The configuration structure (\$main::config) now has the graphs stored
under \$main::config\{RRD\}\{\$wildrrd\}\{GRAPH\} instead of \$main::config\{GRAPH\},
so there won't be problems with having the same graph-name defined under two
different rrds.  This will only affect you if you've been writing your own
code for remstats, like a new page-maker.  I thought that the bug was
annoying enough and difficult to figure out when it was triggered that
the incompatibility was worth the change.

\item  After typing \$main::config\{CUSTOMGRAPH\} instead of \$main::config\{CUSTOM\}
one too many times, I renamed \$main::config\{CUSTOM\} to \$main::config\{CUSTOMGRAPH\}
which is what it should have been all along.  Again, this should only affect
you if you've been writing your own remstats code, like a new page-maker.

\item  Changed default location for datapages to /home/remstats/etc/config/datapages, so that
all the configuration, including the datapages are together.

\item  Removed the general config-file directive \texttt{pagesas} since all the
generated pages are CGIs now.  Check-config will abort if you still have it.
Just delete that line in the general config-file.

\item  \texttt{use strict} in all the scripts (unless I missed some) in preparation
for perl 5.6, which doesn't like \texttt{use vars}.  Shouldn't bother you unless
you've been writing remstats code, in which case, you probably know what to
do.

\item  To deal with alert templates (see below), you'll need to manually fix
your config-dirs.  For each one, you need to:
\begin{verbatim}%
	su remstats
	cd your-config-dir
	cp /home/remstats/etc/config-base/alert-template-map .
	mkdir alert-templates
	cp /home/remstats/etc/config-base/alert-templates/* alert-templates\end{verbatim}


\item  remoteping-collector has been modified to return the server-name
instead of a number to differentiate the data from different servers.
There's also a new remoteping-* wildcard RRD to make it more usefull.

\end{itemize}
\subsection{Customgraphs on host-index pages}%
\index{Customgraphs on host-index pages}

The new \texttt{customgraph graphname} directive for host config-files
permits you to add a customgraph to a host-index page. (Thanks Marek.)

\subsection{graph.cgi - remstats graphs anywhere}%
\index{graph.cgi - remstats graphs anywhere}

Like it says, using the new graph.cgi (see the graph.cgi section) , you can put
remstats graphs on any page you want.

\subsection{Views }%
\index{Views }

You can now define your own pages with page-layout of your choice
using views (see the views section) . (Thanks to Marek and Thorsten and Matt and
anyone else I've forgotten.)  Don't forget to add view-writer (see the view-writer section)  to the
list of pagemakers if you've changed the default.

\subsection{ping-* rrd}%
\index{ping-* rrd}

You can now ping different interfaces on a host separately (Thanks Steve)

\subsection{fileage section for unix-status-server}%
\index{fileage section for unix-status-server}

This allows you to fetch the last-modification-time for specified files.  It
was written to allow remstats to monitor lock-files to check for stale locks.
There is no included rrd using it as lock-files are all over the place.

\subsection{port-collector can collect data from results}%
\index{port-collector can collect data from results}

The port-collector (see the port-collector section)  has always been able to send a string to remote services
to that it could tell if they were working correctly.  Now it can pull values
for RRDs and status-files from the results as well.  I've included a sample
rrd (weathernetwork) and script (weathernetwork) to collect current weather data
for Ottawa.  Look at the updated docs for 
scripts config-files (see the scripts config-files section) .

\subsection{new script - snmpif-description-updater}%
\index{new script - snmpif-description-updater}

The snmpif-description-updater (see the snmpif-description-updater section)  will keep the descriptions on snmpif-*
RRDs up-to-date with whatever you've set as ifAlias for that interface.
(Thanks Steve Francis.)

\subsection{Alert Templates}%
\index{Alert Templates}

This feature allows you to customize the alert messages by addressee
or by RRD.  Look at the docs in 
alert-template-map (see the alert-template-map section)  and
alert-templates (see the alert-templates section) .

\subsection{Autoconf-like configure}%
\index{Autoconf-like configure}

You can now do:

\begin{verbatim}%
	./configure
	make
	make install\end{verbatim}

for the beginning of of the install (see the install section) .

\chapter{Release Notes}
\index{Release Notes}

\section{Release Notes for Remstats version 0.12.1}%
\index{Release Notes for Remstats version 0.12.1}

Ideally, this document will only have to tell you about the
great new features of remstats in this version.

Not this time.

In addition, due to various stuff (read the Change History (see the Change History section) ),
this covers changes since version 0.11.1.

\subsection{Configuration File Replaced by Configuration Directory}%
\index{Configuration File Replaced by Configuration Directory}

The old "one huge configuration file" has been replaced by a directory
of files and sub-directories.  (See the new configuration docs (see the new configuration docs section) 
for details.)  This means that most programs don't need to read and parse
everything, including stuff that they're not going to use.  It also
makes it easier to find things, as you can go directly to the file that
has what you want, e.g. details on a particular host.  It also made
possible the newly revamped replacements for \texttt{make-ping-hosts},
\texttt{make-port-hosts} and \texttt{make-snmp-hosts}, which will insert their
additions directly into the appropriate configuration files.

There is a new script, split-config (see the split-config section) , which will take your old
config-file and a new name and generate a new config-dir from it.

On a related note, I broke the groups (see the groups section)  line 
out of the \texttt{general} config-file
into its own file.  It's easier to see what you've got.  \texttt{split-config}
will do this for you.  Also the (undocumented) [html] section will
absorb large portions of the [general] section which really belong to
wep-page generation.

If you've made your own collector, you'd better look at the new
skeleton-collector for the required changes.  Just change \texttt{read\_config}
to \texttt{read\_config\_dir}, with extra args.  There's also documentation
on how to write your own collector (see the collector section) .

\subsection{do-remstats replaced by run-remstats}%
\index{do-remstats replaced by run-remstats}

The old \texttt{do-remstats} shell-script and all the kludgy shell-scripts
that went with it and the \texttt{watchdog} and \texttt{lockfile} scripts have
all gone away.  The replacement run-remstats (see the run-remstats section)  does everything they
did and does it correctly.  It's also configurable, so you don't need
to modify the scripts to change which collectors you want to run, e.g.

A new feature of \texttt{run-remstats} configurability is that you can have
it run the \texttt{ping-collector} before everything else and not bother
trying hosts that didn't answer it.  You can also choose which
collectors (see the collectors section) , monitors (see the monitors section)  and pagemakers (see the pagemakers section)  to run.

\subsection{CGI scripts and non-default config-dirs}%
\index{CGI scripts and non-default config-dirs}

At the moment, the supplied CGI scripts don't deal with non-default
config-dirs.  I do consider this to be a problem, but I need to get this
release out to deal with other serious installation problems.

You can work-around this by editing the installed CGI scripts and 
putting in the correct definition for \$config\_dir, near the top.

\subsection{plugin-collector is gone}%
\index{plugin-collector is gone}

It was an inefficient, difficult-to-configure,  kludge and isn't 
needed anymore with the new run-remstats.

\subsection{pre-release testing automated}%
\index{pre-release testing automated}

You won't see it, but I hope you'll all notice the improvement
in release quality.
%------------------------------------ bugs.pod ---

\section{Known Bugs for version 1.00a}%
\index{Known Bugs for version 1.00a}

\begin{itemize}


\item Alerts in general - The alerts shown by the alerts.cgi (see the alerts.cgi section)  page never get expired.
If a hub is down, then you'll get alerts for everything behind it.  Ought to only get 
the alert for the hub.

\end{itemize}
\section{Known Bugs for version 0.12.2}%
\index{Known Bugs for version 0.12.2}

\begin{itemize}


\item Neither new-snmp-hosts, nor snmp-collector use get\_ifname, with the consequence
that neither copes well with "oddly" named interfaces, say with spaces in them.  Fixed
in 0.12.3.

\end{itemize}
\section{Known Bugs for version 0.12.1}%
\index{Known Bugs for version 0.12.1}

\begin{itemize}


\item CGI scripts don't work with non-default config-dirs.  I consider
this a bug, but I need to get this release out now to deal with
serious installation problems with previous releases.  For now, do the
following for each config-dir:
\begin{verbatim}%
	\% make install-cgis CONFIGDIR=/wherever/you/put/it\end{verbatim}


\item run-remstats only checks the config-dir for change, not the 
subdirectories.  For now, just \texttt{touch config-dir} whenever you make a change.

\item customgraphs are completely broken.  Urgh.  Upgrade.
[FIXED in 0.12.2]

\item You can't have two graphs of the same name, even in different rrd 
definitions.  This is just flat-out wrong and will be fixed.  Unfortunately, 
the fix will mean even longer file-names, so I hope nobody has some old system
with the 14-character limit. [FIXED in 0.12.2]

\item graphs with descriptions can't have quotes in the description.  
[FIXED in 0.12.2]

\end{itemize}%------------------------------------ todo.pod ---

\section{To-Do List for Remstats}%
\index{To-Do List for Remstats}

\section{High Priority}%
\index{High Priority}

\textbf{134 20010829 [LOW]} - make header\_bar (in htmlstuff) do the link making, if available
and fix whatever uses it not to.

\textbf{133 20010829 [LOW]} - add an option to make nt-discover update old hosts with a standard set of RRDs, 
even if the hosts are already known

\textbf{132 20010824 [HIGH]} - BUG: get rid of the spikes in uptime from the unix-status-server

\textbf{131 20010824 [MED]} - make status pages for each host, group and for all hosts using
the new alertstatus and possibly alertvalue.

\textbf{130 20010823 [HIGH]} - add an $<$RRD::EXEC ...$>$ tag to rrgcgi.  To by used in host index
pages (see 129).

\textbf{128 20010629 [MED,HOLD]} - custom, configuration-supplied info per rrd which is simply available
wherever it makes sense, e.g. in alerts.

- first make sure someone has a use for it.

\textbf{127 20010622 [MED]} - graph data together with historical data.  This
will probably mean either populating another rrd with historical averages, 
temporarily or permanently, or modifying rrdtool.  The former is certainly
simpler to do, given my knowledge of the internals of rrdtool.  However,
it needs to have another rrd for each period?  Need to keep the same data
over some longer period, a multiple of the period of interest, as well as
the averages, from period to period.

\textbf{122 20010330 [HIGH]} - rrd prog-* which tells if a particular named process is running, using
the ps section of the unix-status-collector.

\textbf{121 20010202 [MED,HOLD]} - how about an discovery program, to find and identify hosts and
then run the appropriate new-xxx-hosts scripts to add them?

DONE 20010608 - nt-discover to find and add NT boxen

\textbf{115) 20001229 [HIGH]} - need docs on errors.  Specifically, when 
run-remstats kills a collector for taking too long.  And where to find 
the output of the killed collector.

\textbf{112) 20001212 [LOW,HOLD]} - web-based remstats configurator.  Needs
to consider security, at least from the point of view that you don't 
want to lose your configuration.  The most important part is hosts.
A lot of the rest doesn't have to be changed, or only once.

\textbf{111) 20001212 [LOW,HOLD]} consider grafting on (at least links to) 
some kind of system configuration interface. For configuring the
mmonitored entities, not remstats.

\textbf{110) 20001212 [LOW,HOLD]} consider problem-fixing interface.  It'd be nice to
try to fix things if there is a known way to do so.  A simple kludge
would be to add another method to the alert-destination-map which
deals with problems that it knows about, possibly invoking plugins for
specific alerts.

\textbf{109) 20001212 [MED]} nt-log-collector, with modules for event-logs
and ntmail logs.

\textbf{70) 20000407 [HIGH]} CGI scripts need to have a way to deal with
alternate config-files, and graph-writer needs to tell them if they
can't work it out themselves.  Otherwise, people need to be told to
do multiple installs of the CGI scripts, which might be the best way.

\begin{verbatim}%
	make install-cgis CONFIGDIR=config-xxx\end{verbatim}

Not that painfull, but wastefull and makes upgrade messier.

- I don't like the multiple-install method, but any other method needs 
a way of getting configuration information into the CGI scripts.  Any
method which passes info in via the URL or form fields is out: too unsafe.
The only other method I can think of is to read a configuration file in the
same directory as the CGI script.  This ought to be safe from modification,
or your web-site is waiting to be mutilated.  The other part to consider is
whether any part of the info in the CGI config-file is sensitive.  I.E. do
we have to protect it in some way.

- Configuration file in the same directory won't work either, you'd still
have to install the cgi's multiple times.  I'm starting to think that
multiple installations may be the only safe thing to do.

\textbf{99) 20000619 [HIGH]} make unix-status-collector send the directories
that we want df for and make unix-status-server do "df /dir1 /dir2"
to get them, and pull them off one line at at time.  This is to deal with
things like disconnected NFS-mounted directories hanging df when we do
just a bare "df".

\textbf{86) 20000419 [HIGH]} trends analysis

\textbf{87) 20000419 [HIGH]} alerts based on trends analysis and historical
data, like one-week average and standard-deviation, ... (for Steve)

\textbf{106) 20000922 [MEDIUM]} make a file-collector.  Similar to the
log-collector, only for small, local files.  Slurp the file into 
memory, match patterns and pull out values.  The data line in an
rrd definition would be like:

\begin{verbatim}%
	source file
	data VARNAME	GAUGE:600:0:U FUNCTION PATTERN(WITH)PARENS\end{verbatim}

in fact, this would share so much code with the log-collector that it
might be worth combining the two.  This allows collection from things
like Linux's /proc.

\textbf{98) 20000619 [MEDIUM]} add group index files and store hosts under
group directories.  For easier application of access-controls. (for Florian)

\textbf{2) ???????? [MEDIUM-INPROGRESS]} make rrd munger, like copyrrd was supposed to be
use dump/restore and process the xml form (rrddump-munger)
what functions do we need?  Make one script for each function.

\begin{itemize}


\item add a DS (less important, as we can just make a new rrd)

\item remove a DS (less important, as we can ignore it)

\item add an archive

\item extend an archive

\item change CF of an archive

\item remove an archive

\item filter data within an archive 
\begin{itemize}


\item change NaN to number/max/min

\item change $>$\# to NaN/max/min

\item change $<$\# to NaN/max/min

\end{itemize}

\end{itemize}
\section{Lower Priority}%
\index{Lower Priority}

\textbf{102) 20000912 [LOW]} add see-also to host config, which will
materialize links in the host header.  Config line like:

\begin{verbatim}%
	seealso	host:xyzzy http://www.somewhere ftp://ftphost\end{verbatim}

the special "host:" pseudo-URL gets changed to a link to the
remstats page for that host.

\textbf{103) 20000915 [MEDIUM]} make-path doesn't work with non fqdn hosts
Make it read the configuration, so it can look up the IP number in
the host config and use that if it's defined.  Otherwise, default to
gethostbyaddr.

\textbf{107) 20000922 [MEDIUM]} extra status header lines for hosts, from
specified STATUS files creaded by the various collectors.  Add
lines to host definition like:

\begin{verbatim}%
	extrastatus "STATUS DESCRIPTION" STATUS-FILE-NAME\end{verbatim}

\textbf{60) 20000328 [MEDIUM]} replace route-collector with something which
scales.  SNMPwalking bgp4PathAttrBest doesn't scale to large Internet
routers with 400 peers, taking over an hour to complete. (see also 61)

- look at a script to follow the output of zebra.  That's a lot of
overhead though.  Easy if zebra is solid.

- How difficult can it be to make a native BGP listener?  I'm not clear on
the protocol, but it doesn't look too bad.

\textbf{45) 20000121 [MEDIUM]} make snmp-collector send only one packet per host

- test and make sure that we do get back whatever succeeded.  I vaguely
remember that it didn't work.  [Later: at least under UCD snmp under linux,
if an item isn't implemented in the MIB, you get back NOTHING.  Specifically,
look for the non-unicast packet counters as well as something else; you get 
nothing back.  This isn't good.]

- have to re-write snmp-collector completely, which isn't that bad an idea.
This means a two-pass structure.  On pass one, we construct the complete query
and then send it.  On pass two, we examine all the results and format them.

\textbf{9) ???????? [MEDIUM-TESTING]} make alerts take connectivity dependence into account

- add "via" line to host section to deal with hubs and switches [DONE]

- I think it's done.  See what happens next outage.

\textbf{42) 20000114 [MEDIUM]} snmp-collector mod to allow summary data collected 
from a walk and then filtered as a single data-point.  E.G. specify a rrd "oid"
like:

\begin{verbatim}%
	walk    count ifOperStatus = 1\end{verbatim}

would produce a count of the number of interfaces on that device that
were active (i.e. had a live device plugged into them).  Or a similar one
would let you count BGP routes, or arp addresses, ...  

- Unfortunately, from experience with the snmp-route-collector, this is
going to be slow for anything with a large number of items.

\textbf{43) 20000114 [MEDIUM]} parallelizing the collectors, at least on a 
group basis, preferably host or group.

- collectors must accept \texttt{-G} and \texttt{-H} flags to request processing of
the specified group or host, respectively.  Run-remstats needs to fork 
extra processes according to a config-file line, "parallel group" or 
"parallel host".

- 20010831 TEE - implemented -H flags for all collectors except for the
remoteping-collector, which I'm not using anyway right now.

\textbf{51) 20000216 [LOW]} need a way to specify URL for port-http. The root page 
doesn't always exist.

\textbf{37) 19991216 [LOW]} traceroute sometimes shows incorrect routing, which 
confuses the topology-monitor, causing false positives

\textbf{50) 20000215 [LOW]} make inventory script.  Runs uname 
(for hardware and software), \texttt{ifconfig -a}, \texttt{netstat -nr}, \texttt{hostname}
and any others I can think of to collect configuration info.  
Then figures out the versions of important software, e.g. run \texttt{perl -v},
\texttt{gcc -v ...}  Make a subdir to put it in and make a tool definition to get it
onto the host pages.

- looks like the beginning of a discovery script.

\textbf{62) 20000329 [LOW]} make different markers for different levels
of alert on quick-index.

\textbf{69) 20000406 [LOW]} is there any use for write\_environment in 
check-config?

\textbf{97) 20000616 [LOW]} make port-collector or check-config complain about
having a script with ok/warn/error/critical patterns but no send string.
The port-collector will ignore patterns unless there is a send string.

\section{On Hold}%
\index{On Hold}

Usually waiting for next major release, or trapped by something else.
(in priority order)

\textbf{40) 20000104 [MEDIUM-HOLD]} consider some form of access-control for servers

- hash-based "password"

- ssl tunneling ought to work for everything except SNMP

- what does this buy?  With the various servers run under tcp\_wrappers
an attacker must either gain access to the remstats collector 
machine or spoof a tcp session from them.  If you've been "owned" 
you've got bigger problems.  If the attacker spoofs a session with 
a remstats server, tcp-wrappers will insist that it must come from 
one of the allowed hosts, so that's where the stolen output will go.  
This is only usefull to the attacker if they have access to the 
remstats collector machine or if they can sniff the traffic between 
the collector and the server.  The only data loss possible is with
the log-server which keeps state.  (Ignoring DOS attacks which are
always a problem.)

- unless someone needs this, it's on hold

\textbf{6) ???????? [LOW-NEEDS:2-HOLD]} increase CA3 resolution

- need rrd munger (2)

\textbf{10) ???????? [LOW-INPROGRESS-HOLD]} make graph of connectivity 

\textbf{13) ???????? [LOW-INPROGRESS-HOLD]} snmp trap listener to update status files

- needs filter to be usefull [DONE]

- I haven't seen any useful traps so this is on hold.

\textbf{14) ???????? [LOW-NEEDS:2-HOLD]} make rrd structural changes in config file 
get applied to the rrds.

- some taken care of with snmpif-setspeed, but need a more general solution

- look at new XML output of rrddump

\textbf{39) ???????? [LOW-HOLD]} make RRD dumper, to put data out in a form that can 
be loaded into a database

- I don't need it, per se, but it might be easier than writing the 
availability report generator.

\textbf{52) 20000215 [LOW]} make a makegraph.cgi, or whatever, that will let you 
make a somewhat custom graph on the fly.  makegraph.cgi by itself will list 
all the hosts and let you choose one.  makegraph.cgi?host=xxx will list 
all the RRDs for this host and let you choose ?one?.  
makegraph.cgi?host=xxx\&rrd=yyy will list the various DSs for this RRD and 
let you choose the ones you want.  Then you get to define any CDEFs needed 
and then LINEn/AREA/STACK for each DEF or CDEF desired.  And size, title, 
legends...

- On hold since graph.cgi (see the graph.cgi section)  will let you get at any existing graph you want.
If I find a use or need for this, I'll re-activate it.

\textbf{92) 20000518 [HIGH]} collect traffic info from cflowd (artsportms).
Make it flexible enough that it can let you choose which ports you
want (one per rrd?).  Make a loader to load historical data.

- [DONE 20000524] artsportms-loader done

- I no longer have access to devices with this feature

I've also kept the stuff that used to be here, but has already been
done (see the done section) .
%------------------------------------ faq.pod ---

\chapter{FAQ}
\index{FAQ}

\section{FAQ for remstats}%
\index{FAQ for remstats}

This is only a proto-FAQ, with stuff I couldn't figure out where to 
document.

\begin{enumerate}


\item  \textbf{snmp-collector complains that I don't have SNMP\_Session installed, but
I don't want SNMP.  Do I have to collect and install it?}
No you don't.  Modify the \texttt{collectors} line in the general (see the general section) 
config-file to exclude snmp.


\item  \textbf{I modified the RRD definition, adding a new RRA, but 
remstats is ignoring it.  How do I do this?}
Sorry.  At the moment, remstats won't propagate any changes to the
RRD structure after creation.  Some changes, like extending RRAs
and changing min/max for DSs can be done manually with rrdtool.
If you do use rrdtool manually, I recommend that you modify the
rrd definition as well, to keep them in sync.  At some point in the
future, I'd like to try to do this kind of update, and it's more
likely to succeed if remstats' rrd definition matches what's in
the actual RRD.


\end{enumerate}%------------------------------------ conventions.pod ---

\section{Documentation Conventions}%
\index{Documentation Conventions}

The only documentation conventions the reader has to know about are:

\begin{itemize}


\item things inside [square brackets] are optional

\item parenthesized lists with the items separated by vertical bars,
(like | this | one) require that you choose one and only one of the 
alternatives.

\end{itemize}
Everything else ought to be explicit.  If it isn't, or if you don't 
understand it, please bring it to the author's attention, stating
which part you don't understand.  There's not a lot of point in my
writing documentation which no-one else can understand.  I'd rather
do it right.
%------------------------------------ required.pod ---

\chapter{Prerequisites}
\index{Prerequisites}

\section{What you need to install remstats}%
\index{What you need to install remstats}

\begin{enumerate}


\item  You'll need perl (see \textbf{http://www.perl.org/}), at least version 5.005\_03.  
If you don't already have it you can get it from 
CPAN (see \textbf{ftp://ftp.crc.ca/pub/packages/lang/perl/CPAN/src/stable.tar.gz})
(the Comprehensive Perl Archive Network).

\item  You'll need a \texttt{C} compiler that works. :-)  gcc or 
egcs (see \textbf{ftp://ftp.crc.ca/pub/packages/egcs/}) will do fine and 
you can find them easily in many different places.

\item  Make sure you have the following perl modules installed 
(most of which you can find at CPAN (see \textbf{http://www.cpan.org/modules/by-module})).
The versions are the versions I'm using, but more recent versions should work 
too, unless there have been radical changes.  They should be installed in 
the listed order to avoid dependency problems:
\begin{itemize}


\item RRDs 1.0.16 (see \textbf{http:src/rrdtool-1.0.29.tar.gz})
- the key piece.  It comes with RRDtool and does the database and graphs.
Originally from 
http://ee-staff.ethz.ch/\~{}oetiker/webtools/rrdtool (see \textbf{http://ee-staff.ethz.ch/\~{}oetiker/webtools/rrdtool}).

\item Socket - should be standard if you've got the required perl

\item IO::Socket - should also be standard in the requires version of perl

\item Time::HiRes 01.19 (see \textbf{http:src/Time-HiRes-01.20.tar.gz})
- used by the port-collector to determine response time.  You
can comment out the \texttt{"use Time::HiRes"} line and the program
will still work, but the response-time resolution will be one second instead
of one milli-second.  Originally from 
CPAN (see \textbf{ftp://ftp.crc.ca/pub/packages/lang/perl/CPAN/modules/by-module/Time}).

\item SNMP\_Session 0.69 (see \textbf{http:src/SNMP\_Session-0.77.tar.gz})
- used by the snmp-collector.  If you don't need SNMP, you
can leave it out, but you'll have to change the config file.  (Modify the 
\texttt{collectors} line to leave out \texttt{snmp}.)  Originally from 
ftp://ftp.switch.ch/software/sources/network/snmp/perl/ (see \textbf{ftp://ftp.switch.ch/software/sources/network/snmp/perl/}).

\item GD (see \textbf{http:src/GD-1.30.pm.tar.gz}) - used only by dataimage.cgi (see the dataimage.cgi section)  to create images on the fly.
Originally from http://stein.cshl.org/WWW/software/GD/GD.html (see \textbf{http://stein.cshl.org/WWW/software/GD/GD.html}).

\end{itemize}

\item  You'll also need the following programs for the \texttt{unix-status-server}.
(You can change the locations at the top of it.)  You almost certainly
have most of these and can ignore any that you don't tell the 
\texttt{unix-status-collector} to query.  For details, look in the
unix-status-server (see the unix-status-server section)  docs:
\begin{verbatim}%
	uname, vmstat, df, uptime, netstat, ps, ftpcount, qmail-qstat and
	qmail-qread.\end{verbatim}


\end{itemize}

\end{enumerate}%------------------------------------ install.pod ---

\chapter{Installation}
\index{Installation}

\section{How to install remstats}%
\index{How to install remstats}

READ THE RELEASE NOTES (see the RELEASE NOTES section)  FIRST.  This page is generic and does
\textbf{NOT} include version-specific instructions.

I know that this is not simple.  I do plan to make it simpler, but it'll \textbf{never}
be "\texttt{./configure; make; make install}" because I don't know what you want
to monitor.  
The two C programs (multiping (see the multiping section)  and traceroute (see the traceroute section) ) now use autoconf, and the
main configure script works (from the outside) simlarly to an autoconf-generated 
configure.  I haven't seen a need to convert it to autoconf yet.
It's mostly perl scripts and
if you have the right version of perl properly installed, it shouldn't need
anything special.  The \texttt{unix-status-server} is a slight exception to this,
but the only configuration needed so far is done dynamically and is only the 
location of the various required utilities.

\begin{enumerate}


\item  Unpack the distribution tarball:
\begin{verbatim}%
	gunzip -dc remstats.tar.gz | tar xf -\end{verbatim}


\item  create the remstats user and group, if you haven't already,
(by default \texttt{remstats} and \texttt{remstats} respectively.)  (See also 
the remstats user (see the the remstats user section) .)

\item  Build and install the software.  If you're upgrading, you
might want to take a copy of fixup.config from the old version:
\begin{verbatim}%
	sh configure\end{verbatim}

If you want to override the defaults, then run 

\begin{verbatim}%
	sh configure --help\end{verbatim}

for a list of what can be overridden.  

[Check fixup.config to make sure it is properly setup.]

\begin{verbatim}%
	make all
	make install
	su -c 'make install-suid'\end{verbatim}

\textbf{Note:} this step also customizes the programs and documentation 
with your choice of directories, owner, ...  so this documentation
should refer to your setup after you've done the install.

The \texttt{make install-suid} simply makes traceroute and multiping suid root.
They won't work most places unles run as root, one way or another.  Since I
don't like to run all of remstats as root, this was the best compromise I
could come up with.


\item  fix the config-base for site-specific things.  Edit the following
files in /home/remstats/etc/config-base, looking the the string "FIXME", without the "quotes".
\begin{verbatim}%
	alerts general html scripts/http-proxy\end{verbatim}

I'll try to keep this list up to date, but you can make sure by doing:

\begin{verbatim}%
	grep -l FIXME /home/remstats/etc/config-base/* /home/remstats/etc/config-base/*/*\end{verbatim}


\item  Make a config-dir (see the config-dir section)  to describe what you 
want to monitor.  You can do this by hand, or using the configuration 
building tools.  To use the tools, you'll have to make a few files 
listing various kinds of hosts:
\begin{verbatim}%
	cd /home/remstats/etc
	/home/remstats/bin/new-config config
	/home/remstats/bin/new-ping-hosts groupname1 group1-hosts-file
	/home/remstats/bin/new-ping-hosts groupname2 group2-hosts-file
	...
	/home/remstats/bin/new-port-hosts groupname3 port-hosts-file
	/home/remstats/bin/new-snmp-hosts groupname4 SNMP-community-string snmp-hosts-file\end{verbatim}

After you've installed the unix-status-server (see the unix-status-server section)  on some hosts, you can also
use:

\begin{verbatim}%
	/home/remstats/bin/new-unix-hosts groupname5 unix-hosts-file\end{verbatim}

If you have any Windows NT hosts that you want to monitor, after you
have installed the nt-status-server (see the nt-status-server section) , you can run nt-discover (see the nt-discover section)  to
find and add the NT hosts for a given NT domain.

If you're going to use the log-collector, you'll have to build the 
rrd entries for each by hand.  There doesn't seem to be much standard 
in where log-files go, let alone what's in them.


\item  Arrange for cron to run run-remstats (see the run-remstats section)  at an appropriate interval.  
For a five-minute interval, something like the following will do:
\begin{verbatim}%
	0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/remstats/bin/run-remstats\end{verbatim}

This checks the configuration, collects the new data, updates the rrds, 
runs the monitors to compute statuses and updates the web-pages.  Note:  it
does \textbf{not} re-write the web-pages for every iteration; it only does so when
configuration files have changed, as the web-pages will show new data by
themselves.


\item  [optional] Arrange for cron to run \texttt{do-traceroutes} at an appropriate
interval.  You could run it in the wee hours of each morning like:
\begin{verbatim}%
	5 3 * * * /home/remstats/bin/do-traceroutes\end{verbatim}

This information isn't currently used, but I'm planning to make use of it.


\item  [optional] Arrange for cron to run snmpif-description-updater (see the snmpif-description-updater section) 
periodically, if you have any  snmpif-* RRDs, which you're likely to change
the descriptions on.  Say every day, like:
\begin{verbatim}%
	0 3 * * * /home/remstats/bin/snmpif-description-updater\end{verbatim}


\item  Arrange for cron to run cleanup (see the cleanup section)  every now and then to remove old
un-needed files, like:
\begin{verbatim}%
	0 3 * * * /home/remstats/bin/cleanup\end{verbatim}

This removes no-longer-needed files, like old host graphs, traceroute results,
log-files, ...


\item  You'll need to set up your web-server (see the web-server section)  to allow 
CGI scripts in the remstats html tree and make sure that you're not 
allowing everyone in.

\item  Make a symlink in the html directory from whichever index 
you prefer to index.cgi.

\item  You'll want to look at the server installation docs (see the server installation docs section) 
if you're going to be running any of the remote servers (
log-server (see the log-server section) , nt-status-server (see the nt-status-server section) , remoteping-server (see the remoteping-server section) , and 
unix-status-server (see the unix-status-server section) ).

\end{enumerate}
Enjoy your pretty pictures and I hope that you find them usefull.
%------------------------------------ install-user.pod ---

\section{The remstats user}%
\index{The remstats user}

You \textbf{must} choose a userid to run the remstats processes under.
By default, it will be the user \texttt{remstats}, but you'll have to
create it manually, as I'm not going to risk damaging someone's
/etc/passwd file.  Many operating-systems have a script called
\texttt{useradd} or \texttt{adduser} or some variant on that.

\textbf{NOTE:} Don't run the remstats programs except as the remstats users.
Many of the programs write extra files you won't know about unless
you read the source, and when you do run them as the remstats user,
it won't be able to modify the files that were created by the other
user.  This will probably cause the program to die, with a meaningful
error message I hope, and you'll have to modify the owner by hand, as
root.  If you need to do this, go back to the source directory and 
do:

\begin{verbatim}%
	\% su -c 'make install-owner'\end{verbatim}

The remstats user must be able to write files within the remstats
directory trees rooted at /home/remstats, /home/remstats/data and /home/remstats/html.
The collection/update processes will also create files under 
/home/remstats/tmp and /home/remstats/data.  The pagemakers write files under
/home/remstats/html.  It's simplest to have all the remstats files and 
directories(except multiping (see the multiping section)  and traceroute (see the traceroute section) ) owned by 
the remstats user.

You must also ensure that the CGI scripts (and almost every web-page
remstats creates is a CGI script) get run by the remstats user.  The
CGI scripts read files under /home/remstats/data and /home/remstats/datapage.
(See also the web-server installation (see the the web-server installation section) .
%------------------------------------ cookies.pod ---

\section{Magic Cookies}%
\index{Magic Cookies}

There are various places in the configuration file where you can have 
text substituted for you.  It's a (very-limited) macro facility.  Currently,
it only works in graphs, scripts and tools.  The cookies are always UPPERCASE and
the name is surrounded by "\#\#", so that a request for "color1" would look like
"\#\#COLOR1\#\#", without the quotes.

Here they are:

\subsection{Colours: }%
\index{Colours: }

You're not required to use these, but you'll really regret not doing so
when you decide to change colors later.

\begin{itemize}


\item COLOR1, COLOR2, ... COLOR6 and also COLOR1a, ...
- generic colours for graphs

\item PROBLEMCOLOR - an alarming colour

\item TOTALCOLOR - the full amount of something

\item USEDCOLOR - how much is used of something

\end{itemize}
\subsection{Other stuff:}%
\index{Other stuff:}

\begin{itemize}


\item DB - the full path and file-name of the current rrd

\item DATADIR - where the data files live

\item GRAPH - the name of the current graph

\item GRAPHTIME - the name of the current time-span

\item HOST - the name of this host

\item IP - the IP number of the host

\item IPORHOST - the IP number of the host, if it's defined in the host's
config-file, or else its name.

\item HTMLURL - where the html and graphs live in web-space

\item RRD - the name of the current rrd, without the .rrd extension or
file-name fixing

\item SHORTHOST - the name of the host before the first dot, 
unless it is a generic name like www or ftp or mail

\item THUMBHEIGHT, THUMBWIDTH - how large to ask for the thumbnail 
to be.  Not how large the resulting gif is.

\item WEBMASTER - who is responsible for this web presense

\item WILDPART - the instance part of a wild rrd.  If if-* 
is being used by if-le0, then WILDPART will be le0.

\end{itemize}%------------------------------------ private.pod ---

\section{private.pl - configuration-supplied functions}%
\index{private.pl - configuration-supplied functions}

There are several places where you can have functions you choose invoked
by remstats:

\begin{itemize}


\item  updater (see the updater section)  permits functions to be applied to incoming data via the
rrd definition (see the rrd definition section) .

\item  datapage.cgi (see the datapage.cgi section)  and 
dataimage.cgi (see the dataimage.cgi section) permit functions to be applied on
any \texttt{eval} line.

\end{itemize}
Rather than me continually adding functions or you having to hand-modify
your copy of remstats whenever I make new releases, I've supplied an
almost empty perl file called \texttt{private.pl} which will be installed in the
/home/remstats/lib if you don't have one, but will never be modified by me after
that.
%------------------------------------ install-servers.pod ---

\section{Server Installation}%
\index{Server Installation}

One of the interesting things about remstats (I think), is 
the remote servers (see the remote servers section) .  To install them, you'll need to do a few
things on each host which will run the servers:

\begin{itemize}


\item Add entries for the servers in \texttt{/etc/services}, like
this:
\begin{verbatim}%
	unix-status	1957/tcp	\# remstats unix-status server
	log-server	1958/tcp	\# remstats log server\end{verbatim}

You can run them on different ports, but these are the 
defaults and you'd have to change run-remstats (see the run-remstats section) 
to add the appropriate switches.


\item [Optional] Unless you're going to run the servers as 
root (unnecessary), you'll need to create the user that 
the servers will run as.  
The only reasons I can think of for running the servers as 
root are if you need to run them on a low-numbered port
($<$=1024), or if you need to read a log-file which isn't 
readable by the remstats user, or if you want to run
multiping non-suid.  On Linux and Solaris, you can do:
\begin{verbatim}%
	groupadd remstats
	useradd -g remstats -d /home/remstats remstats\end{verbatim}


\item Modify \texttt{/etc/inetd.conf} to get the servers invoked,
like this:
\begin{verbatim}%
	unix-status	stream tcp nowait remstats /home/remstats/unix-status-server unix-status-server
	log-server	stream tcp nowait remstats /home/remstats/log-server log-server logfile1 logfile2\end{verbatim}

Or if you're using 
tcp\_wrappers (see \textbf{ftp://ftp.porcupine.org/pub/security/tcp\_wrappers\_7.6.BLURB}), 
which you should be:

\begin{verbatim}%
	unix-status	stream tcp nowait remstats /path/to/tcpd /home/remstats/unix-status-server
	log-server	stream tcp nowait remstats /path/to/tcpd /home/remstats/log-server logfile1 logfile2\end{verbatim}

And remember to update \texttt{/etc/hosts.allow} to allow your remstats host access.


\item Tell inetd to re-read it's config-file:
\begin{verbatim}%
	kill -HUP pid-of-inetd\end{verbatim}


\item copy the remstats servers to the machines which will run them
\begin{verbatim}%
	rcp unix-status-server log-server remoteping-server multiping host:/home/remstats\end{verbatim}


\end{itemize}
\section{The nt-status-server}%
\index{The nt-status-server}

This one is a bit different to install.  I've only done it under the
ActiveState Perl (see \textbf{http://www.activestate.com/Products/ActivePerl/index.html}) under
Windows NT 4.0.  Installing the ActiveState Perl is straightforward; if you got here,
you'll have no trouble with that.  Installing it as a service is not as simple as I
intended.  You'll have to get the SRVANY and INSTSRV programs from the NT Resource Kit,
and follow their instructions.  The program that SRVANY will be running is, of course,
perl (usually \texttt{C:$\backslash$Perl$\backslash$bin$\backslash$perl.exe}), and the argument string something like:

\begin{verbatim}%
	c:$\backslash$wherever$\backslash$you$\backslash$put$\backslash$nt-status-server -s -t10.111.12.13\end{verbatim}

You'll have to replace \texttt{c:$\backslash$wherever$\backslash$you$\backslash$put} with the path to nt-status-server (see the nt-status-server section) ,
and \texttt{10.111.12.13} with the IP number of the host running the nt-status-collector (see the nt-status-collector section) .
%------------------------------------ install-webserver.pod ---

\section{Getting your web-server ready for remstats}%
\index{Getting your web-server ready for remstats}

\subsection{Choosing userid for remstats}%
\index{Choosing userid for remstats}

Almost all the remstats web-pages are generated by some kind of CGI
script.  Many of them will read additional files not available under the
html directory tree.  In order to provide access to these files, you need
to make sure that the scripts get run as the remstats user.  The simplest
way to do this is to run a separate instance of the web-server software
as the remstats user.  You may have other methods of accomplishing this,
depending on the web-server you're using.  (See also 
remstats user (see the remstats user section) .)

\subsection{Running CGI scripts under the remstats tree}%
\index{Running CGI scripts under the remstats tree}

You also may need to tell your web-server that \texttt{xxx.cgi} means that this
file is a CGI script and needs to be run, instead of just displayed.  With
the apache (see \textbf{http://httpd.apache.org}) web-server, you could add the following
lines to the \texttt{httpd.conf} file:

\begin{verbatim}%
	$<$Directory /home/remstats/html$>$
	Options FollowSymlinks ExecCGI
	AddHandler cgi-script .cgi
	$<$/Directory$>$\end{verbatim}

\subsection{Restricting access to CGI scripts}%
\index{Restricting access to CGI scripts}

There are a few things you should do before telling others about remstats.
Remstats comes with a few CGI scripts which you probably don't want to make
publicly available and two that you certainly don't.  \texttt{ping.cgi}, 
\texttt{traceroute.cgi} and \texttt{whois.cgi} should probably be restricted to your 
own organization, unless you don't mind letting anyone on the Internet run 
pings, traceroutes and whois queries from your domain.  Rectricted to your 
domain, you only have to worry about your own people.

However, \texttt{alert.cgi} and \texttt{log-event.cgi} are a different kettle of fish.  
They will permit anyone who can run it to quench alerts and log comments 
about them.  You will probably want to be a bit more restrictive about 
who you let run this.

Using the apache (see \textbf{http://httpd.apache.org/}) web-server, you can restrict 
the use of these CGIs using a \texttt{.htaccess} file something like this:

\begin{verbatim}%
	\# Note that this example uses the private network 192.168.0.0.
	\# Stuff to make Apache expire the files to get them refreshed
	ExpiresActive on
	\# images every 5 minutes, when the data gets updated
	ExpiresByType image/gif M300
	ExpiresByType image/png M300
	\# html every day
	ExpiresByType text/html M300\end{verbatim}

\begin{verbatim}%
	\# What to allow
	Options ExecCGI FollowSymlinks Indexes\end{verbatim}

\begin{verbatim}%
	$<$Files "\^(whois.cgi|traceroute.cgi|ping.cgi)\$"$>$
	order deny,allow
	deny from all
	allow from 192.168. 127.0.0.1
	$<$/Files$>$\end{verbatim}

\begin{verbatim}%
	$<$Files "\^(alert.cgi|log-event.cgi)\$"$>$
	order deny,allow
	deny from all
	allow from 192.168.20.1 192.168.23.3
	$<$/Files$>$\end{verbatim}

\begin{verbatim}%
	\# How they're allowed in
	order deny,allow
	allow from all\end{verbatim}

I won't claim the IP\#-based access-control is completely safe, but it's 
easy and keeps out casual browsers.  If you \textbf{really} need to keep
this information safe, use a secure web-server, say apache with mod\_ssl.
If that's not good enough, you ought to consider whether this stuff 
really belongs on a network at all.
%------------------------------------ configuration.pod ---

\chapter{The Configuration Directory}
\index{The Configuration Directory}

The run-time configuration of remstats is done through a directory-tree of files.
The current tree structure is:

\begin{verbatim}%
    configdir
        +--- alerts (see the alerts section) 
        +--- alert-destination-map (see the alert-destination-map section) 
        +--- alert-template-map (see the alert-template-map section) 
        +--- alert-templates (see the alert-templates section) 
        |       +--- template1
        |       +--- template2
        |       ...
        +--- archives (see the archives section) 
        +--- availability (see the availability section) 
        +--- colors (see the colors section) 
        +--- customgraphs (see the customgraphs section) 
        |       +--- graph1
        |       +--- graph2
        |       ...
        +--- datapages (see the datapages section) 
        |       +--- datapage1.page
        |       +--- datapage2.page
        |       ...
        +--- general (see the general section) 
        +--- groups (see the groups section) 
        +--- hosts (see the hosts section) 
        |       +--- host1
        |       +--- host2
        |       ...
        +--- host-templates (see the host-templates section) 
        |       +--- host-template1
        |       +--- host-template2
        |       ...
        +--- html (see the html section) 
        +--- links (see the links section) 
        +--- oids (see the oids section) 
        +--- remotepings (see the remotepings section) 
        +--- rrds (see the rrds section) 
        |       +--- rrd1
        |       +--- rrd2
        |       ...
        +--- scripts (see the scripts section) 
        |       +--- script1
        |       +--- script2
        |       ...
        +--- times (see the times section) 
        +--- tools (see the tools section) 
        +--- views (see the views section) 
        |       +--- view1
        |       +--- view1
        |       ...
        +--- view-templates (see the view-templates section) 
                +--- template1
                +--- template2
                ...\end{verbatim}

(You can look at the base configuration directory if 
you want, but you should also read through this so you know the 
significance of what you see.

Almost all the configuration files allow both blank lines and comment-lines.
A comment-line \textbf{begins} with a \textbf{\#} and the whole line is ignored by 
remstats.  Inline comments are \textbf{not} permitted as the '\textbf{\#}' is used 
in some places for other purposes.  The only files which don't permit comments
are the \texttt{view-templates}, which are html, and the last part of \texttt{datapages},
which are also html.

\texttt{alert-templates}, \texttt{customgraphs}, \texttt{datapages}, \texttt{scripts}, \texttt{rrds}, \texttt{hosts}, 
\texttt{host-templates}, \texttt{views} and 
\texttt{view-templates} are sub-directories with the files within describing one 
of that kind of entity.  E.G. a file in the \texttt{hosts} sub-directory is 
named for the host and contains that host's configuration.

\textbf{NOTE}: within the sub-directories, files with names beginning with 'IGNORE-' 
or ending with '\~{}', will be ignored.

There are also a few tools (see the tools section)  to help
you make and update your config-file, although not all parts of it.
%------------------------------------ configfile-alerts.pod ---

\section{Configuration - Alerts}%
\index{Configuration - Alerts}

The alerts config-file is used by the alert-monitor (see the alert-monitor section)  to decide who to 
send alerts for problems.  The rrds (see the rrds section)  and hosts (see the hosts section) 
config-files decide \texttt{when} an alert needs to be raised, and these lines tell \texttt{who}
gets the alert.

Each line is in seven parts, most of which are patterns, e.g.:

\begin{verbatim}%
	warn	* MISC UPTIME 0 0 uptime-alerts
	error   silverlock.dgim.crc.ca  * * 600 900 test-alerts
	error   news.crc.ca * * 600 900 news-alerts
	critical * * * 600 900 critical-alerts\end{verbatim}

The first "word" is the status, as decided by the alert-monitor (see the alert-monitor section) .
The second word is a regex to match against the hostname.  The third is
a regex to match against the rrdname.  The fourth is a regex for the 
variablename.  The fifth is the minimum time for the alert condition
to be present before an alert can be triggered.  The sixth is the interval
after sending an alert before another will be sent.  The seventh is
an \texttt{alert-destination} as specified in the 
alert-destination-map (see the alert-destination-map section) .

Note: The seventh used to be an alert program and there was an eighth which was
an address, of a form appropriate to the alert program.  This has been
rolled into the \texttt{alert-destination-map} to make it more flexible.

If the current condition matches the status, host, rrd, and variable,
then alert-monitor has to look at the times.  If this is a new 
condition (i.e. it was in OK status previously), then an alert won't
be triggered until after the minimum time has passed.  This avoids transient
problems being reported.  If you want these to be reported, then set it to zero.
If this is an old alert, then an alert won't be
triggered until the interval time has passed since the previous alert.
If the interval is 0 (zero) then there will only be one alert at the
start-time.
%------------------------------------ configfile-alert-destination-map.pod ---

\section{Configuration - alert-destination-map}%
\index{Configuration - alert-destination-map}

This config-file specifies the mapping from an abstract alert destination,
specified in the alerts config-file (see the alerts config-file section) , and the address(es) to
send it to.  The alerter (see the alerter section)  attempts to match the abstract alert destination
against each of the \texttt{map} lines and sends alerts to any which match.

There are three kinds of lines in this config-file: \texttt{map}, \texttt{alias}, and \texttt{method}.
\texttt{Map} lines map from an abstract alert destination, listed in the alerts
config-file, to a less abstract alias, listed here.  The \texttt{alias} lines allow a
crude list capability and also permit the use of different methods to deliver the
alert.  \texttt{Method} lines tell what program to run with what arguments in order to
deliver to that type of address.

\subsection{Map Lines }%
\index{Map Lines }

A map line looks like:

\begin{verbatim}%
	map DEST TIME DOW DOM MON ALIAS\end{verbatim}

Where:

\begin{itemize}


\item DEST is an abstract alert destination, listed in the alerts config-file

\item TIME is a time-of-day specification, comma-separated time-ranges or '*'
meaning all times.  A range looks like HHMM-HHMM.

\item DOW is a day-of-the-week spec, a comma-separated list of weekdays, in
numeric form (0=sunday, 1=monday, ...) or '*' for all weekdays.

\item DOM is a day-of-the-month spec.  It's a comma-separated list of day-ranges,
where a range is a day or DD-DD, or '*' ofr all days.

\item MON is a month spec.  It's a comma-separated list of month-ranges, in
numeric form, like MM or MM-MM or '*' for all months.

\item ALIAS is the alias that this DESTination maps to during the specified
time-period.  It's defined in an alias line.

\end{itemize}
This permits different DESTinations to be sent to different people at different times,
depending on who's on duty.

\subsection{Alias Lines}%
\index{Alias Lines}

An alias line looks like:

\begin{verbatim}%
	alias ALIAS METHOD:ADDR ...\end{verbatim}

Where:

\begin{itemize}


\item ALIAS is the alias being defined

\item METHOD is an alert-delivery method (see methods below)

\item ADDR is an address which is valid for that method

\end{itemize}
This indirection permits delivery of the same alert via multiple methods, in case
one or more of the methods isn't available, as well as to different people.

\subsection{Method Lines}%
\index{Method Lines}

A method line looks like:

\begin{verbatim}%
	method METHOD COMMAND-LINE\end{verbatim}

Where:

\begin{itemize}


\item METHOD is the method being defined

\item COMMAND-LINE is the program to run with any arguments it requires.
It will be passed the alert message on stdin and the address
to send it to at the end of the COMMAND-LINE.

\end{itemize}
\subsection{An Example}%
\index{An Example}

We have three guys on different shifts who manage network operations (Tom, Dick and Harry)
during the week.  On the week-end Frank is on call.  We also want to email a copy to
an email address which collects all the alerts.
We want to send the alerts to whoever is working at the time.  Say the abstract destination
specified in the alerts config-file (see the alerts config-file section)  is \texttt{alerts}.  We might use lines
like those below:

\begin{verbatim}%
	map alerts 0600-1359 1,2,3,4,5 * * tom
	map alerts 1400-2159 1,2,3,4,5 * * dick
	map alerts 0000-0559,2200-2359 1,2,3,4,5 * * harry
	map alerts * 0,6 * * frank\end{verbatim}

\begin{verbatim}%
	alias tom email:tom@our.com email:alert-history@our.com winpopup:console
	alias dick email:dick@our.com email:alert-history@our.com winpopup:console
	alias harry email:harry@our.com email:alert-history@our.com winpopup:console
	alias frank page:555-1234 email:alert-history@our.com winpopup:console\end{verbatim}

\begin{verbatim}%
	method email /home/remstats/bin/alert-email
	method winpopup /home/remstats/bin/alert-winpopup
	method page /home/remstats/binalert-page\end{verbatim}

Note: the hypothetical \texttt{page} method isn't provided with remstats.  There are lots of different
programs to send pages.  Look at alerter (see the alerter section)  if you want to add your own methods; it's easy.
%------------------------------------ configfile-alert-template-map.pod ---

\section{Configuration - alert-template-map}%
\index{Configuration - alert-template-map}

The \texttt{alert-template-map} tells which 
alert-template (see the alert-template section)  to use for which addressee or
RRD.  The lines look like:

\begin{verbatim}%
	address	regex template\end{verbatim}

or

\begin{verbatim}%
	rrd rrd template\end{verbatim}

or

\begin{verbatim}%
	rrd rrd:variable template\end{verbatim}

Addresses are checked first.  This is to allow special mapping for devices
like pagers which can't display a lot of information.  If none of the 
special addresses match, then RRDs are checked, first with variables
then without.  An RRD can be an RRD instance, like \texttt{port-ftp}, or the 
wild RRD, e.g. \texttt{port-*}.

The \texttt{template} is the name of the template file in the \texttt{alert-templates}
config-dir.
%------------------------------------ configfile-alert-templates.pod ---

\section{Configuration - alert-templates}%
\index{Configuration - alert-templates}

The \texttt{alert-templates} directory contains the alert message templates.  They
are just text files with cookies (see the cookies section)  in them.  The cookies available are
slightly different than the standard list, but they work the same way.  You
put \#\#COOKIENAME\#\# wherever you want to see the value of the 'cookiename'
variable.  The ones available for alerts are:

\begin{itemize}


\item HOST - the host for the alert

\item REALRRD - the RRD instance for the alert

\item FIXEDRRD - the RRD instance with the character-set translated a bit
for file-names and message-id's

\item VAR - the variable name

\item STATUS - the alert status (OK, WARN, ERROR, CRITICAL)

\item VALUE - the value of the variable that caused this alert

\item RELATION and THRESHOLD - the alert is triggered when the VALUE is
no longer in RELATION to the THRESHOLD value.

\item START - when the alert was first noticed

\item DURATION - how long the alert has been in this STATUS

\item HOSTDESC - the description line for this host

\item RRDDESC - the description for this instance of the RRD

\item NOW - the current time as a unix timestamp

\item NOWTEXT - the current time for email headers

\item ALERTHOST - the hostname of the host sending the alert

\item TOWHO - the addressee for this alert

\end{itemize}
There are three special files in the \texttt{alert-templates} directory, 
which \textbf{must} exist:

\begin{itemize}


\item DEFAULT - which contains the default template to be used when no
other matches the alert-template-map (see the alert-template-map section) .

\item HEADERS - which supplies the headers for each message, with
the same substitutions as the rest of the template files.  Make very sure
that the HEADERS file ends with or contains an empty line or your 
message will be interpreted as part of the headers and will 
undoubtedly look wrong.  The alert-email (see the alert-email section)  script does not check this.

\item FOOTER - supplies a standard ending for each message.

\end{itemize}%------------------------------------ configfile-archives.pod ---

\section{Configuration - Archives}%
\index{Configuration - Archives}

The archives file names various data-retention periods.  RRDtool|http://ee-staff.ethz.ch/\~{}oetiker/webtools/rrdtool
calls them RRAs.  Each line is in two pieces: an archive name and an RRA
specification, exactly as documented in the rrdcreate manpage.  Unfortunately, 
modifying this after the rrd has been created isn't one of the things that RRDtool
does.  I've got an rrd munger on my L$<$to-do list|todo (see the RRDtool|http://ee-staff.ethz.ch/\~{}oetiker/webtools/rrdtool
calls them RRAs.  Each line is in two pieces: an archive name and an RRA
specification, exactly as documented in the rrdcreate manpage.  Unfortunately, 
modifying this after the rrd has been created isn't one of the things that RRDtool
does.  I've got an rrd munger on my L$<$to-do list|todo section) , but it's still
not done.

For example:

\begin{verbatim}%
	day-avg         AVERAGE:0.1:1:600
	week-avg        AVERAGE:0.1:7:300
	month-avg       AVERAGE:0.1:30:300
	3month-avg      AVERAGE:0.1:90:300
	year-avg        AVERAGE:0.1:365:300\end{verbatim}

\begin{verbatim}%
	day-min         MIN:0.1:1:600
	week-min        MIN:0.1:7:300
	month-min       MIN:0.1:30:300
	3month-min      MIN:0.1:90:300
	year-min        MIN:0.1:365:300\end{verbatim}
%------------------------------------ configfile-availability.pod ---

\section{Configuration - Availability}%
\index{Configuration - Availability}

There are two types of availability definitions: for an RRD or for an 
RRD on a particular host.  The RRD may also be a wildcard RRD, like
"df-*" or an instance of an RRD, like "df-/home".  The definitions
look like:

\begin{verbatim}%
	rrd RRDNAME VARNAME CF RELATION THRESHOLD
and
	host HOSTNAME RRDNAME VARNAME CF RELATION THRESHOLD\end{verbatim}

The CF is one of LAST, MIN, MAX or AVERAGE, with rrdtool's usual
meaning.  The RELATION can be any one of: $<$, $<$=, $>$, $>$=, or =.  
The THRESHOLD is the number to which the value of VARNAME must be 
in the correct RELATION.  (Clear as mud.)  

As an example, take the following definition:

\begin{verbatim}%
	rrd ping rcvd MINIMUM $>$ 0\end{verbatim}

This means that the variable 'rcvd' in the ping rrd must be greater 
than zero for it to be considered "available".  All time intervals 
where it isn't, or for which no data is available, are considered 
"unavailable".

There are also two other record types: colors and thresholds.  A colors
record looks like:

\begin{verbatim}%
	colors COLOR1 ...\end{verbatim}

A thresholds line looks like:

\begin{verbatim}%
	thresholds NUMBER ...\end{verbatim}

and must have the same number of values as the colors line.  Only one of
each.  Here's an example to make the use clear (I hope):

\begin{verbatim}%
	colors avail1 avail2 avail3 avail4
	thresholds 99 98 95 90\end{verbatim}

The \texttt{colors} line above requires that the colors 'avail1', ... be defined in the
colors (see the colors section)  config-file.  The \texttt{thresholds} line above specifies 
that if an availability is 99\% or above, it should be colored 'avail1' color, 
98\% to 99\%, use 'avail2' color, etc.
%------------------------------------ configfile-colors.pod ---

\section{Configuration - Colors}%
\index{Configuration - Colors}

The \texttt{colors} config-file just gives names to colors so you don't have 
to remember or decipher hex numbers.  Each line is: a colour 
name and a six-digit hex number giving the RGB values.  The color 
"down" is special and is used in the ping index to color the 
background of hosts which are down.

For example:

\begin{verbatim}%
	totalcolor      00a000
	usedcolor       a00000
	downcolor       a07777\end{verbatim}
%------------------------------------ configfile-customgraphs.pod ---

\section{Configuration - Customgraphs}%
\index{Configuration - Customgraphs}

The \texttt{customgraphs} directory contains files which define graphs which 
aren't associated with a specific host.  They are very like a graph 
defined on an rrd (see the rrd section) .  They do have a times
line preceeding the graph definition, to set the time-periods for that
graph.  They are linked in under the \texttt{Custom Index}.

Note that the graph definition itself must be indented, like rrd graphs.

As an example:

\texttt{times   day yesterday week 3month year}

\begin{verbatim}%
        --upper-limit 100 --lower-limit 0 --rigid
        --vertical-label 'CPU \%'
        --title 'CPU Usage (\#\#GRAPHTIME\#\#)'
        DEF:silverlockuser=\#\#DATADIR\#\#/silverlock.dgim.crc.ca/cpu.rrd:user:AVERAGE
        DEF:silverlocksys=\#\#DATADIR\#\#/silverlock.dgim.crc.ca/cpu.rrd:system:AVERAGE
        DEF:loisuser=\#\#DATADIR\#\#/lois.dgim.crc.ca/cpu.rrd:user:AVERAGE
        DEF:loissys=\#\#DATADIR\#\#/lois.dgim.crc.ca/cpu.rrd:system:AVERAGE
        CDEF:silverlock=silverlockuser,silverlocksys,+
        CDEF:lois=loisuser,loissys,+
        'LINE2:silverlock\#\#\#COLOR1\#\#:silverlock'
        'LINE2:lois\#\#\#COLOR2\#\#:lois'\end{verbatim}
%------------------------------------ configfile-general.pod ---

\section{Configuration - General}%
\index{Configuration - General}

This is the miscellaneous config-file, but there are some critical pieces here:

\begin{itemize}


\item \texttt{datadir} (REQUIRED) - 
The data for a given host is stored under \texttt{datadir/hostname}.  
There are also other status files stored in this directory.

\item \texttt{staletime} (UNUSED) - 
How long before we count a status as stale. (seconds)

\item \texttt{minuptime} -
How long a host must be up before it stops being flagged as recently up.
(seconds)

\item \texttt{keepalerts} (UNUSED) -
How long to keep records of alerts after the condition no longer exists.
(seconds)

\item \texttt{uptimealert} - 
If this is set, the alert-monitor (see the alert-monitor section)  will cause a warning level condition on the
fake rrd MISC for the fake variable UPTIME, for any host whose uptime
is less than this value.  Whether this will trigger an alert depends on
the alerts (see the alerts section)  file.

\item \texttt{pinger} -
If defined, this names the ping-collector (see the ping-collector section)  to be used before all the 
other collectors (see the collectors section) .  (Unless you write your own, you put \texttt{ping-collector}
here.)  If you don't include this line, then you'll want to make sure
the the \texttt{ping-collector} is listed in the \texttt{collectors} line (below).

\item \texttt{collectors} -
This line tells run-remstats (see the run-remstats section)  which collectors to run.  The default
list is all of them, so you can gain some benefit by pareing this line
down to those you are using, but remember it if you add new 
rrds (see the rrds section)  that need other collectors later. \textbf{Note:} you 
list the names of the collectors without the '\texttt{-collector}' on the
end.  E.G. the \texttt{ping-collector} would be included as just '\texttt{ping}'.

\item \texttt{monitors} -
This line tells run-remstats (see the run-remstats section)  which monitors (see the monitors section)  to run.  The default is
all of them.

\item \texttt{pagemakers} -
This tells run-remstats (see the run-remstats section)  which pagemakers (see the pagemakers section)  to run at the end, if the 
config-dir has changed.  The default is all of them.

\item \texttt{max-port-patterns} -
This tells the port-collector (see the port-collector section)  how many parenthesised patterns there can
be, at most, in \texttt{valuepattern}s or \texttt{infopattern}s.  The default is 10.

\item \texttt{watchdogtimer} -
This sets the limit that run-remstats (see the run-remstats section)  will apply to each of the programs
that it runs, so that, e.g., a hanging collector will not hang the whole
remstats cycle.

\item \texttt{keeplogs} -
This tells how long cleanup (see the cleanup section)  will permit old files to hang around, in seconds.

\end{itemize}%------------------------------------ configfile-groups.pod ---

\section{Configuration - Groups}%
\index{Configuration - Groups}

If any name has spaces, it must be 'quoted'
or "quoted".  Any groups not listed here \textsl{will not be linked into the HTML 
index pages generated by html-writer}, but pages will still be created for them.
If there is a file in the \texttt{htmldir} with the same name as a group-name, but
with the spaces replaced by '\_' and all the letters lower-case, followed by
'.html', then the group-names in html pages will be linked to those pages.
E.G. for a group named \texttt{"Local Routers"}, if there is a file called 
\texttt{local\_routers.html}, the name of the group will be made into a link to that
file.
%------------------------------------ configfile-hosts.pod ---

\section{Configuration - Hosts}%
\index{Configuration - Hosts}

The \texttt{hosts} files are what the whole configuration has been working 
toward.  Here we tell which hosts we're interested in and what we want to 
monitor.  Here's a sample host file called \texttt{clark.dgim.crc.ca}:

\begin{verbatim}%
	desc    DNS and Web
	ip      142.92.39.18
	aliases	ns1.crc.ca
	via	142.92.32.10
	group   Servers
	contact	Thomas Erskine $<$thomas.erskine@crc.ca$>$
	tools   ping traceroute telnet http clark-special:special
	rrd     ping 
	rrd     cpu 
	noalert	cpu user
	community	xyzzy
	rrd     load 
	nograph load users
	rrd     if-le0 
	alert	if-le0 ierr $<$ 1000 5000 10000
	alert	if-le0 in WARN
	rrd     df-/var 
	rrd     df-/tmp 
	rrd     port-http critical
	rrd     port-ssh 
	rrd     port-whois
	noavailability port-whois status
	noavailability port-whois response
	rrd     port-domain critical\end{verbatim}

The name of the file (\texttt{clark.dgim.crc.ca]}) is the host that you're
interested in.  The name should be a fully-qualified-domain-name, but anything
which perl's getaddrbyname can resolve should work.

The \texttt{ip} line saves the IP number from having to be looked up and
could be used to deal with hosts which aren't in the DNS.  If you want the
IP number to be looked up each time, you can leave this line out.

The \texttt{desc} line gives this host a description graph-writer (see the graph-writer section) 
will put on pages about this host.

The \texttt{alias} line tells remstats about other names for this host.  This
is mainly for the \texttt{ping-collector} to allow it to tell for sure when 
it has got a response from this host.

The \texttt{via} line is used by the topology-monitor (see the topology-monitor section)  to specify networking
gear (like hubs and switches) which are in the path to the host, but won't
show up in a traceroute.

The \texttt{group} line is required and tells which group this host
belongs to.  Remember, you defined all the groups back in the 
general (see the general section)  file?

The \texttt{contact} line tells who to contact for this host.  If a line in
the alerts config-file (see the alerts config-file section)  refers to a 
recipient called \texttt{CONTACT}, the value of the host's contact line 
will be substituted.

The \texttt{tools} line tells which tools (defined in the 
tools config-file (see the tools config-file section) )
you want to appear for this host.  E.G. if a host doesn't have a 
web-server, there's no point in providing a link to connect to it.
To accomodate host-specific tools, a toolname can be given as 
\texttt{real-tool-name:display-name}.  This means that the tool will be defined
in the \texttt{tools} config-file as \texttt{real-tool-name}, but will be displayed
as \texttt{display-name}.

The rrd (see the rrd section)  lines tell which rrds to collect for this host.  
If the rrd was defined as a wildcard, it will have the instance 
specified here.  In the example there are three wildcard lines, referring 
to \texttt{if-le0}, \texttt{df-/var} and \texttt{df-/mail}.  The first is looking at the data 
for network interface hme0 and the others are getting data on the /var and 
/mail file-systems, respectively.  

The first \texttt{alert} line is setting the alert threshold for \texttt{if-le0}
to 50.  If this host file was from the same configuration as the previous
\texttt{rrd} sample, the alert here would override the one in the \texttt{rrd} file.
There is also a \texttt{noalert} line, which cancels an alert set in the
rrd without setting a replacement alert.  The alert line for a host
must specify the rrd as well, but is otherwise the same as an alert on an
rrd.

The second \texttt{alert} line is specifying the status (\texttt{WARN}) for missing data
for the \texttt{in} variable.

There can also be descriptions for rrds.  If you append to an
\texttt{rrd} line something like \texttt{desc='xyzzy'}, then you'll see
that description on pages dealing with it.  I added this for labelling
network interfaces, but you can use if for anything you want.

The \texttt{community} specifies the SNMP community string to use for this 
host to fectch SNMP data.  If the host config-file doesn't specify any RRDs 
collected by the snmp-collector, you don't need to specify a community.

If this host uses any rrds collected by the snmp-collector, it can also
specify a port to use like:

\begin{verbatim}%
	snmpport	3401\end{verbatim}

If the RRD itself specifies a port, then the RRD-specified port will be
used instead, for that RRD.

If you don't want a particular graph for this host, you can include a 
\texttt{nograph} line.  It looks like:

\begin{verbatim}%
	nograph rrdname graphname\end{verbatim}

There can also be a \texttt{statusfile} line, looking like:

\begin{verbatim}%
	statusfile NNN\end{verbatim}

with \texttt{NNN} replaced by the name of a status file from that hosts's data directory.
This permits the main index pages to show the status of an un-pingable host as the
status of something else, like the reachability of it's web-server (STATUS-port-http).

The \texttt{noavailability} lines tell the availability-report (see the availability-report section)  program not to report on
certain rrd/variable combinations.  In this case, we don't want to see availability stats
on the whois server.  Maybe it's too embarassing?
%------------------------------------ configfile-host-templates.pod ---

\section{Configuration - Host Templates}%
\index{Configuration - Host Templates}

These config-files simply hold the same kind of lines as a
host config-file (see the host config-file section) .  By adding a line like:

\begin{verbatim}%
	template some-host-template\end{verbatim}

to a host config-file, you achieve the same effect as adding all
the lines contained within the template file.  If you have many
hosts which are similar, this can be a usefull way of keeping the
configuration consistent.

It can also be used to parameterize things.  As an example, if you
are using the nt-status-server (see the nt-status-server section)  and are only running it on a single
host which is providing information on various other NT hosts, you
might make a template, say \texttt{default-nt-status-server} like:

\begin{verbatim}%
	nt-status-server my.nt.status.server\end{verbatim}

and replace the \texttt{nt-status-server} lines in those hosts with:

\begin{verbatim}%
	template default-nt-status-server\end{verbatim}

Then if you want to change which machine is running the \texttt{nt-status-server},
you'd just have to change the template.
%------------------------------------ configfile-html.pod ---

\section{Configuration - HTML}%
\index{Configuration - HTML}

The \texttt{html} file defines stuff related to web-page generation.  There
are several different kinds of information.

\subsection{Locations }%
\index{Locations }

These things define where things are, like URLS.  They are:

\begin{itemize}


\item \texttt{htmldir} (REQUIRED) - 
The html stuff for a given host is stored under \texttt{htmldir/hostname}.

\item \texttt{htmlurl} (REQUIRED) -
How to refer to the \texttt{htmldir} in a URL.

\item \texttt{viewdir} -
Where to store the views, in case you don't want them under the \texttt{htmldir}.

\item \texttt{viewurl} -
How to refer to the \texttt{viewdir} in a URL.

\item \texttt{webmaster} (REQUIRED) -
Who's in charge of these web-pages, an email address to get stuffed into
mailto URLs.

\item \texttt{logourl} -
Where is the logo for this site

\item \texttt{homeurl} - 
ehere is home for this site

\item \texttt{topurl} -
where top goes for this site

\item \texttt{rrdcgi} -
where to find the rrdcgi program, I like to link it and rrdtool into 
\texttt{/usr/local/bin}, for ease of use.

\item \texttt{motdfile} -
where to find the Message-Of-The-Day file.  This is used to add in 
announcements at the top of the index pages, except the host index.

\end{itemize}
\subsection{"How-To's" }%
\index{"How-To's" }

\begin{itemize}


\item \texttt{thumbnail} -
How big the graph portion of a thumbnail image is to be (WIDTHxHEIGHT)

\item \texttt{metadata} -
Where to store CERN-style meta-data, to set expiry times for the gifs.
(METADIR METASUFFIX)

\item \texttt{background} -
what should the background look like.  It's mostly obsolete, because 
you can get the most of the same effects by editing the \texttt{default.css} 
style file instead.

\item \texttt{htmlrefresh} - 
How often to cause the web pages to refresh themselves. (seconds)

\item \texttt{upstatus}, \texttt{upunstablestatus}, \texttt{downunstablestatus}, \texttt{downstatus}, 
\texttt{okstatus}, \texttt{warnstatus}, \texttt{errorstatus}, \texttt{criticalstatus} - 
HTML to display for various statuses.  The defaults use $<$span style="xxx"$>$ tags.

\item \texttt{viewindices} -
Should view-writer (see the view-writer section)  write the index links at the top of view pages? 
(yes or no)

\item \texttt{showinterfaces} -
Should graph-writer (see the graph-writer section)  show interfaces on a host page?
(yes or no)

\item \texttt{keepimages} -
How long cleanup (see the cleanup section)  will permit old images to hang around, in seconds.

\item \texttt{default-tools} -
What tools to show for a host which doesn't specify any.

\end{itemize}
\subsection{Markers }%
\index{Markers }

This group supplies html to wrap various things in the generated web-pages.

\begin{itemize}


\item indexprefix, indexsuffix - for the items on the \texttt{Indices} line
of the header

\item groupprefix, groupsuffix - for the group names on the various indices

\item hostprefix, hostsuffix - for the host names on the various indices

\item toolprefix, toolsuffix - for the tool names on the toolbar

\item linkprefix, linksuffix - for the links in the footer

\item outofrangeprefix, outofrangesuffix - for the current value on the
availability pages when it has gone outside the specified bounds.  (See
availability-report (see the availability-report section) .)

\end{itemize}
\subsection{Labels }%
\index{Labels }

If you translate the labels, the web-pages should be translated.  It
doesn't include error-messages or debugging messages.

The currently available ones, with their defaults, are:

\begin{verbatim}%
	alertreport	Alert Report
	comment		Comment
	contact		Contact
	customindex	Custom Index
	description	Description
	groupindex	Group Index
	hardware	Hardware
	hostindex	Host Index
	indices		Indices
	ipnumber	IP \#
	lastupdateon	This page last updated on
	links		Links
	logreport	Log Report
	operatingsystem	Operating System
	overallindex	Overall Index
	pingindex	Ping Index
	quickindex	Quick Index
	status		Status
	tools		Tools
	uptime		Uptime
	viewindex	View Index\end{verbatim}

And also the:

\begin{itemize}


\item \texttt{uptimeflag} - shows on some index pages when a host has
been up for less than \texttt{mintime} (defined in the 
general (see the general section)  file.)

\item \texttt{alertflagwarn}, \texttt{alertflagerror} and \texttt{alertflagcritical} - 
give HTML to be inserted in the quick index for hosts which have
alerts active.

\end{itemize}%------------------------------------ configfile-links.pod ---

\section{Configuration - Links}%
\index{Configuration - Links}

The links config-file supplies links that you want to put with the standard
links at the bottom of the web pages.  They're in two pieces: the text
to be shown and the URL to link to.

An example:

\begin{verbatim}%
	SourceWorks http://www.sourceworks.com/\end{verbatim}
%------------------------------------ configfile-oids.pod ---

\section{Configuration - OIDs}%
\index{Configuration - OIDs}

[These are for SNMP and you can ignore this config-file if you're not interested.]

The SNMP implementation in the snmp-collector is primitive and only knows
about OIDs (Object IDs) by their number.  Since I'm not interested in bringing
in a full MIB compiler to deal with the MIBs, this section lets you specify
names for the OID numbers you're interested in using later.  The lines look
like:

\begin{verbatim}%
	CiscoCpuLoad    1.3.6.1.4.1.9.2.1.58.0\end{verbatim}

for a non-hypothetical example, if you happen to have Cisco routers.  If you
have the ucd-snmp package, their snmptranslate program comes in handy for
pulling out the appropriate numbers without the bother of tracking through
the wretched MIBs.
%------------------------------------ configfile-remotepings.pod ---

\section{Configuration - remotepings}%
\index{Configuration - remotepings}

The \texttt{remotepings} file simply lists all the machines which are
running the remoteping-server.  Or at least all the machines
that you want to query.
%------------------------------------ configfile-rrds.pod ---

\section{Configuration - RRDs}%
\index{Configuration - RRDs}

These files are the most complicated.  Here's an example, again
taken from the \texttt{if-} rrd supplied with remstats.

\begin{verbatim}%
	source          unix-status
	step            300
	data            in=interface\_packets\_in:* COUNTER:600:0:U
	data            ierr=interface\_errors\_in:* COUNTER:600:0:U
	data            out=interface\_packets\_out:* COUNTER:600:0:U
	data            oerr=interface\_errors\_out:* COUNTER:600:0:U
	data            coll=interface\_collisions:* COUNTER:600:0:U
	alert           in $<$ 100
	alert           out $<$ 100
	alert		in nodata WARN
	archives        day-avg week-avg month-avg 3month-avg year-avg
	times           day yesterday week 3month year
	graph           if-* desc='Interface data for \#\#RRD\#\#'
			--title 'Interface \#\#RRD\#\# \#\#GRAPHTIME\#\#'
			--lower-limit 0
			--vertical-label 'packets'
			DEF:in=\#\#DB\#\#:in:AVERAGE
			DEF:out=\#\#DB\#\#:out:AVERAGE
			DEF:ierr=\#\#DB\#\#:ierr:AVERAGE
			DEF:oerr=\#\#DB\#\#:oerr:AVERAGE
			'LINE1:in\#\#\#COLOR1\#\#:Input Packets'
			'LINE1:out\#\#\#COLOR2\#\#:Output Packets'
			'LINE1:ierr\#\#\#COLOR3\#\#:Input Errors'
			'LINE1:oerr\#\#\#COLOR4\#\#:Output Errors'\end{verbatim}

This example shows most things that can be done, except multiple graphs on
the same rrd, which is as simple as adding another graph line and its
definition.

First, the rrd name is special, in this case.  Any rrd file which ends in a '-'
is assumed to be for a wildcard rrd, in this case \texttt{if-*}.  This avoids
problems with file-systems which are overly fussy about which characters can
be in file-names.

This rrd definition
will match any rrd beginning with 'if-' specified in a host config-file.
Wildcard rrds are necessary when a given host may have more than one of 
whatever the rrd is referring to, in this case network interfaces.  The
network interface name will replace the '*' in the rrd line in the host config-file.
It will also be available in the \texttt{\#\#WILDPART\#\#} magic cookie (see the magic cookie section) .

The \texttt{source unix-status} means that this RRD gets its data from the 
unix-status-collector (see the unix-status-collector section) .

The \texttt{step} line sets the step value for the rrd.  This is the expected
frequency of data updates.  (See the manpage for
rrdcreate.)  N.B. Setting this is required, but changing some RRDs won't 
change how often the collectors run.  If you have significant numbers
which require different update periods, you've got a choice.  If it's
not very "expensive" to do those queries every time, then just ignore any
complaints from run-remstats about updates failing.  Otherwise it gets messy.
You've got to set up three separate config-dirs.  One for one time period,
and one for the other running out of cron at appropriate time-periods only
running collectors, and a separate one to run the monitors and pagemakers.

(FIXME - the writing stinks)

The \texttt{data} lines define various DS elements for this RRD.  [See the
manpage for rrdcreate.]  The first part is the DS name, with an extension.
The collectors produce long names and may have instance-names added to the 
variable name, in this case to tell which interface this data is for.  So
the first part looks like \texttt{dsname=variable:instance}.  The 
\texttt{dsname} is used for the RRD DS name and the \texttt{variable:instance}
part is used to tell updater which collector information applies to this DS.
The rest of the line is straight from rrdcreate's description of DS.

It's also possible to invoke configuration-supplied private functions (see the private functions section) 
on the incoming raw data.  The \texttt{data} line would look like:

\begin{verbatim}%
	data	xyzzy=\&function(variablename) ...\end{verbatim}

It's your responisbility to make sure that \texttt{function} is available and that it
works.

The \texttt{alert} lines are setting the thresholds for alerts, in this
case for the variables \texttt{in} and \texttt{out}.  They must
specify, in order: the variable-name, the relation ($<$, =, $>$, delta$<$ and delta$>$)
and a space-separated list of thresholds.  Since these ones only 
provide one number each, they can only have OK or WARN statuses.  If the 
variables \texttt{in} or \texttt{out} have values less than ($<$) 100, they
are considered to be OK.  Otherwise they're elevated to WARN status.
What will happen when they go into WARN status depends on the 
alerts (see the alerts section)  file.  These alerts will apply to any host 
which uses this rrd, unless it overrides it.

The last alert specifies that missing data for the variable \texttt{in} will be
considered to be status \texttt{WARN}, for purposes of generating alerts.
The full description of the alerts is kept in te docs for alert-monitor (see the alert-monitor section) 
as it is the program which implements them.

The \texttt{archives} line tells how to keep the data for this rrd, using
the names defined in the archives (see the archives section)  file.

There can be multiple \texttt{graph} lines describing as many graphs from 
the data in this rrd as you want.  The graph-name must be wildcarded if the
rrd is.  A \texttt{graph} line is followed by its definition which must be
indented.  The definition is straight from rrdgraph with the
magic cookie (see the magic cookie section)  substitution.  If you want a 
description , you can add:

\begin{verbatim}%
	desc='whatever you want'\end{verbatim}

or

\begin{verbatim}%
	desc="whatever you want"\end{verbatim}

to the \texttt{graph} line.  This is used to set the alt text on the web-page.

\subsection{Collector-specific Stuff}%
\index{Collector-specific Stuff}

An rrd collected by the port-collector (see the port-collector section)  may specify that this particular
service is critical, by simply including the word "critical" at the end of
line.  This will cause the status to be elevated to CRITICAL status  if 
the status ever reaches ERROR level.

An rrd collected by the log-collector (see the log-collector section)  will have extra stuff
on each data line after the DS information.  The extra stuff will be
the function and pattern needed by log-collector to pass to the
log-server (see the log-server section)  to get that variable's data.

An RRD collected by the snmp-collector (see the snmp-collector section)  needs to specify which OIDs to fetch.
They are specified by name in the RRD with a line like:

\begin{verbatim}%
	oid APCUpsAdvInputLineVoltage\end{verbatim}

which refers to a name defined earlier in the oids (see the oids section)  file.

An RRD collected by the snmp-collector may also specify an SNMP port to use
with a line like:

\begin{verbatim}%
	port	3401\end{verbatim}
%------------------------------------ configfile-scripts.pod ---

\section{Configuration - Scripts}%
\index{Configuration - Scripts}

The \texttt{script XXX} files are describing how to query a given port for 
its status and are used by the port-collector (see the port-collector section) .  They look like:

\begin{verbatim}%
	send	GET / HTTP/1$\backslash$.0$\backslash$n$\backslash$n
	timeout	5
	port	80
	infopattern \^Server:$\backslash$s+(.*)\$
	valuepattern \^Content-length:$\backslash$s*($\backslash$d+)
	ok	\^HTTP/$\backslash$d$\backslash$.$\backslash$d 200
	warn	\^HTTP/$\backslash$d$\backslash$.$\backslash$d [45]$\backslash$d$\backslash$d\end{verbatim}

This example is taken from the supplied \texttt{config-base} and queries an 
HTTP server for its root page.  First, it sends the "send" text, which 
in this case is a minimal HTTP request, and waits no more than 5 seconds.  
After the port is closed from the remote end, or the timeout expires, 
any text which was returned is examined by the various tests.  In this 
case, if the web-server sends back a line beginning something like 
"HTTP/1.1 200", the port will be marked as "OK".  Similarly, there are 
"warn", "error" and "critical" statuses possible.

The \texttt{port} is optional and \texttt{getservbyname} will be called on the 
script name, if port isn't specified.  This also lets you have multiple
scripts for the same port, using different names for the script.

The \texttt{infopattern} is optional, and supplies a pattern which will be matched
against each line in the result.  If there is a match, files will be created
in the data directory for that host called \texttt{INFOn-rrdname}, where \texttt{n} will
be in the range 1..9 and \texttt{rrdname} will be the name of this rrd, converted to
a file-name.  The files will contain matches for parenthesised items in the
regular expression.  E.G. in the example above, a file will be created called
\texttt{INFO1-http} which will contain whatever the web-server said its 
type and version was.

Similarly, the \texttt{valuepattern} is also optional, but the matches will be returned
as collected items called \texttt{value1} through \texttt{value9}.  In the example, this
would cause the collector to return a line like:

\begin{verbatim}%
	hostname timestamp value1 1022\end{verbatim}

An RRD definition could use this by including a line like:

\begin{verbatim}%
	data pagesize=value1 GAUGE:600:0:10000\end{verbatim}

For a working example, look at the RRD definition for weathernetwork.
%------------------------------------ configfile-times.pod ---

\section{Configuration - Times}%
\index{Configuration - Times}

The \texttt{times} file specifies time intervals for which graphs will be made.
I suppose it should be renamed graphtimes or something, but I've got other
things to do.  Each line is in three pieces: a time name, a start time and 
and end time.  The times are relative to the current time and so will always
be non-positive.

The currently defined times are:

\begin{verbatim}%
	thumb           -60*60*2 0
	day             -60*60*24 0
	week            -60*60*24*7 0
	month           -60*60*24*30 0
	3month          -60*60*24*30*3 0
	year            -60*60*24*365 0
	yesterday       -60*60*24*2 -60*60*24
	lastweek        -60*60*24*7*2 -60*60*24*7\end{verbatim}

\section{Note: }%
\index{Note: }

The times \texttt{thumb} and \texttt{day} are special.  The graph-writer (see the graph-writer section)  expects
them to exist and to have certain meanings.  The \texttt{thumb} time is a short
interval which is used to make the ping thumbnail graphs for the ping index.
The \texttt{day} time is the default time interval.  The higher-level pages will
use the \texttt{day} graph as a link to the other time intervals.
%------------------------------------ configfile-tools.pod ---

\section{Configuration - Tools}%
\index{Configuration - Tools}

The \texttt{tools} file is only used by graph-writer (see the graph-writer section)  to create toolbars.  Each 
line is in two pieces: a tool-name and a URL to link to for this tool.  

The URL can have magic cookies (see the magic cookies section)  in it to substitute
in things like hostname.  Currently, the only cookies which will get
substituted here are \texttt{HOST}, \texttt{IP} and \texttt{HTMLURL}.  If you think of 
other usefull ones, please tell me (see the tell me section) .
%------------------------------------ configfile-views.pod ---

\section{Views - your own selection of graphs on one page}%
\index{Views - your own selection of graphs on one page}

The views config-dir contains files, one per view, describing a collection
of things that you want to see on one page.  There are three kinds:

\begin{itemize}


\item \textbf{simple} - you specify which graphs or customgraphs you want, using 
lines like:
\begin{verbatim}%
	graph        hostname rrdname graphname
	customgraph  customgraphname\end{verbatim}

You can have as many lines as you want, and can mix graphs and customgraphs.
The order you list them in is the order they will appear in the resultant
page.


\item \textbf{template} - you specify a view template to use to generate the page.  
See the docs on view template (see the view template section)  for explanations.

\item \textbf{datapage} - you specify a datapage to use to generate the page.
See the docs on datapage.cgi (see the datapage.cgi section)  for explanations.

\end{itemize}
You can also specify a \texttt{description} line, like:

\begin{verbatim}%
	desc	This is what I'm taking about\end{verbatim}

Where the pages are generated is dependant on the \texttt{viewdir} and \texttt{viewurl}
directives in the html config-file (see the html config-file section) .  The view pages may
have the usual indices on them, if the html config-file (see the html config-file section) 
includes:

\begin{verbatim}%
	viewindices	yes\end{verbatim}

but by default leave them off.
%------------------------------------ configfile-view-templates.pod ---

\section{View Templates}%
\index{View Templates}

View templates give you complete control over page layout in a view.  They are
complete HTML pages with embedded magic cookies, which are substituted for
during view generation (by view-writer (see the view-writer section) ).  The resulting page will
be an \texttt{rrdcgi} CGI script.  The magic cookies are:

\begin{itemize}


\item $<$VIEW::GRAPH hostname rrdname graphname [graphtime]$>$ -
This inserts a graph definition for \texttt{rrdcgi}. The graphtime is from the 
times config-file (see the times config-file section) , and is optional.

\item $<$VIEW::CUSTOMGRAPH customgraphname [graphtime]$>$ - This inserts a customgraph 
definition for \texttt{rrdcgi}. The graphtime is from the 
times config-file (see the times config-file section) , and is optional.

\item $<$VIEW::INCLUDE filename$>$ - This inserts the contents of the named file when
the view-page is displayed. (Using the \texttt{rrdcgi} cookie $<$RRD::INCLUDE filename$>$.)

\item $<$VIEW::HEADER title here$>$ - Inserts a standard remstats header.

\item $<$VIEW::FOOTER$>$ - Inserts a standard remstats footer.

\item $<$VIEW::STATUS host status-file$>$ - inserts the contents of the named status-file when
the view-page is displayed. (Using the \texttt{rrdcgi} cookie $<$RRD::INCLUDE filename$>$.)

\end{itemize}
You can also include \texttt{rrdcgi} magic cookies.
%------------------------------------ config-tools.pod ---

\chapter{Configuration Tools}
\index{Configuration Tools}

These tools are intended to help you build the hosts part of your 
configuration file.  They take a file (or files) of hostnames and
emit host config-files for them.  There are currently no config generators
for the log-collector, the remoteping-collector or the unix-status-collector.

\begin{itemize}


\item split-config (see the split-config section)  - converts old config-files to new config-dirs (see the config-dirs section) 

\item new-config (see the new-config section)  - makes a new config-dir populated by symlinks to config-base

\item new-ping-hosts (see the new-ping-hosts section)  - adds a hosts with a ping rrd

\item new-port-hosts (see the new-port-hosts section)  - adds hosts which are collected by the port-collector (see the port-collector section) 

\item new-snmp-hosts (see the new-snmp-hosts section)  - adds hosts which are collected by the snmp-collector (see the snmp-collector section) 

\item new-unix-hosts (see the new-unix-hosts section)  - adds hosts which are running the unix-status-server (see the unix-status-server section) 

\item nt-discover (see the nt-discover section)  - finds and adds Windows NT hosts

\item snmp-showif (see the snmp-showif section)  - shows interfaces from SNMP

\item snmp-get (see the snmp-get section)  - for testing if you can get a particular OID

\end{itemize}%------------------------------------ split-config.pod ---

\section{split-config - convert a config-file to a config-dir}%
\index{split-config - convert a config-file to a config-dir}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
split-config version 1.4
usage: ../split-config [options] configfile configdir
where options are:
	-d	enable debugging output
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

This is the conversion program to convert an old-style config-file (everything in
one file) into the new-style config-dir (a directory containing files and 
sub-directories.  For the layout of the new config-dir, see the $<$docs|configuration$>$.

It also deals with the other configuration changes which came with version 0.12.1:

\begin{itemize}


\item the [html (see the html section) ] group is now documented and \texttt{split-config}
will create it in the likely case that it's missing.

\item All the web-page creation stuff that was in the [general (see the general section) ]
section has been moved to the html config-file (see the html config-file section) .

\item The [groups] section has been separated out into the groups (see the groups section)  
file.

\end{itemize}%------------------------------------ new-config.pod ---

\section{new-config - make a new config-dir}%
\index{new-config - make a new config-dir}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
new-config version 1.9
usage: new-config [options] new-config-dir
where options are:
    -d ddd  set debug level to 'ddd'
    -f fff  use 'fff' as config-base [/home/remstats/etc/config-base]
    -h      show this text
\end{verbatim}

\subsection{Description: }%
\index{Description: }

\texttt{new-config} makes a new config-dir and populates it with symlinks
to \texttt{/home/remstats/etc/config-base}.  It makes the \texttt{scripts} and \texttt{rrds}
subdirectories as symlinks too.  It makes the \texttt{customgraphs} and
\texttt{hosts} subdirectories as real directories.  If you disagree
with which ones it chooses as symlinks, look at the top of the
program at @links and @subdirs.

You are likely to be modifying the following files, so they are
copied instead of being links:

\begin{verbatim}%
	alerts alert-destination-map general html links tools\end{verbatim}
%------------------------------------ new-ping-hosts.pod ---

\section{new-ping-hosts - add ping RRD to host definition}%
\index{new-ping-hosts - add ping RRD to host definition}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
new-ping-hosts version 1.9
usage: new-ping-hosts [options] group [hostfile ...]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' as config-dir [/home/remstats/etc/config]
    -h      show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

You supply a list of files containing hostnames, one per line.  
If there is no hostfile supplied, then it will read from stdin.
If there is no host config-file for that host, \texttt{make-ping-hosts} 
will write entries like:

\begin{verbatim}%
	\# hosts/www.example.com
	desc	gggg host
	group	gggg
	ip	123.456.789.123
	tools	ping traceroute
	rrd	ping\end{verbatim}

for that host.  If that host already exists, it will simply add:

\begin{verbatim}%
	rrd   ping\end{verbatim}

to the end of the hosts file.  It doesn't check if the host already
has a ping rrd.
%------------------------------------ new-port-hosts.pod ---

\section{new-port-hosts - add RRDs for services}%
\index{new-port-hosts - add RRDs for services}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
new-port-hosts version 1.9
usage: new-port-hosts [options] group [hostfile ...]
where options are:
    -d      enable debugging output
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -h      show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

You supply a file or files of hostnames, one per line, or let
it read from stdin.

You can use this to add RRDs to a host describing
the various services running on a server, or at least the ones that the 
port-collector (see the port-collector section)  knows how to talk to.  It's actually a very limited
port-scanner, and will attempt to connect to each of the 
services.  For each one that answers, \texttt{new-port-hosts}
will write an entry for the corresponding rrd.

If the host has no file, \texttt{new-port-hosts} will add one with appropriate
header info and a ping rrd.  Otherwise, it will just add the port-based
rrd's to the end of the host file.
%------------------------------------ new-snmp-hosts.pod ---

\section{new-snmp-hosts - add RRDs collected by snmp-collector}%
\index{new-snmp-hosts - add RRDs collected by snmp-collector}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
new-snmp-hosts version 1.12
usage: new-snmp-hosts [options] group community-string [hostfile ...]
where options are:
    -d      enable debugging output
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -h     	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

if you don't supply a file of hostnames, then it will read from stdin.

You can use \texttt{new-snmp-hosts} to add RRDs collected by the snmp-collector.
It works by looking for a single OID for each RRD.  If the OID exists
on a given host (i.e. it returns data), then the RRD which uses that 
data is added to the host.  There is currently no way to configure it
except for modifying the code.  Complain if you'd actually use such a thing.

It's up to you to discard any you don't want.

If there is no hosts file, it will create one with default
header info.  If there is one, it will just append the rrds.
%------------------------------------ new-unix-hosts.pod ---

\section{new-unix-hosts - add rrds collected by the unix-status-collector}%
\index{new-unix-hosts - add rrds collected by the unix-status-collector}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
new-unix-hosts version 1.6
usage: new-unix-hosts [options] group [hostfile ...]
where options are:
    -d      enable debugging output
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -h     	show this help
    -p ppp  use port 'ppp' [1957]
    -t ttt  use 'ttt' for timeout [10]
\end{verbatim}

\subsection{Description: }%
\index{Description: }

If you don't supply a file of hostnames, then it will read from stdin.

This will add all the remstats distributed rrds collected by the
unix-status-collector (see the unix-status-collector section) , except for those using the \texttt{PS} section
of the collector.

It's up to you to discard any you don't want.

If there is no existing host file for a given host, it will create one 
with default header info.  If there is one, it will just append the
new rrds.
%------------------------------------ nt-discover.pod ---

\section{nt-discover - find and add new NT hosts}%
\index{nt-discover - find and add new NT hosts}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
nt-discover version 1.4
usage: ../nt-discover [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for the config-dir [/home/remstats/etc/config]
    -h      show this help
    -s      update status files even if host data-dir found
    -t ttt  use 'ttt' as timeout (in seconds) [10]
\end{verbatim}

\subsection{Description: }%
\index{Description: }

Note: \texttt{Nt-discover} is not called \texttt{new-nt-hosts} because it is a different kind of
program.  Instead of you providing a list of hosts to add, it finds them itself.

Using information supplied in the discovery config-file (see the discovery config-file section) , \texttt{nt-discover}
will contact a host running the nt-status-server (see the nt-status-server section) , and run three separate queries:

\begin{itemize}


\item \texttt{NET-VIEW} will give a list of hosts to check

\item \texttt{USRSTAT} will give a list of NT users (currently unused, but may be interesting)
-item \texttt{SRVINFO} (for each of the hosts found in the first step) will give some more details
on each host and write new host config-files for each new one.  It will not update an existing
host config-file.


\end{itemize}%------------------------------------ snmp-showif.pod ---

\section{snmp-showif - display interfaces from SNMP}%
\index{snmp-showif - display interfaces from SNMP}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
snmp-showif version 1.5
usage: ../snmp-showif [options] host community
where options are:
	-d	enable debugging output
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

This utility can be used to get a list of interfaces on an SNMP queryable 
host.  You can use it to figure out which interfaces you want to add,
and what names remstats uses for them.  

It will show ifIndex, ifDescr, ifSpeed, ifType, ifName, ifInOctets, 
ifOutOctets, ifOperStatus and ifAlias (if it exists).
%------------------------------------ snmpif-description-updater.pod ---

\section{snmpif-description-updater }%
\index{snmpif-description-updater }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
snmpif-description-updater version 1.5
usage: snmpif-description-updater [options]
where options are:
	-d ddd  set debugging level to 'ddd'
	-f fff  use 'fff' for config-dir [/home/remstats/etc/config]
	-h      show this help message
\end{verbatim}

\subsection{Description: }%
\index{Description: }

This script updates host config-files, for those which contain \texttt{snmpif-*}
RRDs, by fetching the ifAlias OID via SNMP and re-writing the configuration
file if any of the descriptions have changed.  I'd suggest running it every
now and then, say once a day, unless you're making very frequent changes to
the descriptions.

If somebody has gear which uses an OID other than ifAlias to store the 
description, then I'll have to consider making this more general, but
it'll do for now.
%------------------------------------ servers.pod ---

\chapter{Servers}
\index{Servers}

\section{Servers }%
\index{Servers }

There are a four servers currently:

\begin{itemize}


\item unix-status-server (see the unix-status-server section)  is queried by the unix-status-collector (see the unix-status-collector section) 
for various information it obtains by running various 
commonly-available programs: \texttt{df}, \texttt{vmstat}, \texttt{uptime}, \texttt{netstat},
\texttt{uname}, \texttt{ps} ...

\item log-server (see the log-server section)  (queried by the log-collector (see the log-collector section) )
reads the unread portion of the specified log-file and returns the requested
statistics.

\item remoteping-server (see the remoteping-server section)  is contacted by the remoteping-collector (see the remoteping-collector section)  which
supplies a list of hosts.  The server runs multiping (see the multiping section)  against them and
returns results for each, similar to the results obtained from the 
ping-collector (see the ping-collector section) .

\item nt-status-server (see the nt-status-server section)  - provides access to information from Windows NT workstations and servers.

\end{itemize}%------------------------------------ log-server.pod ---

\section{log-server - providing remote access to log information}%
\index{log-server - providing remote access to log information}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
log-server version 1.8
usage: ../log-server [options] logfile ...
where options are:
	-d nnn	enable debugging output at level 'nnn'
	-p ppp	set the prefix for context-files to 'ppp' [log-server-]
	-h	show this help
\end{verbatim}

The log-server must be supplied with at least one log-file
to serve.

\subsection{Description: }%
\index{Description: }

The log-server is queried by the log-collector (see the log-collector section)  using a
"protocol" described in the log-collector documentation.
It will provide information from any of the log-files on it's 
command-line, but no others.  It is recommended that you use
the tcp\_wrappers or some other form of access-control to 
limit access to this server.  The information may or may not 
be sensitive, according to which log-files you are serving,
but letting anyone query it will mean that you will lose some
data, unless you're sure that they will only query it in test
mode.

The log-server will store context for each log-file
that is served, by default in \texttt{/var/tmp/log-server-XXX},
where \texttt{XXX} is replaced by a munged version of the log-file
name.  If you want this stored somewhere else, use the \texttt{-p}
switch or change the program.

\subsection{Notes: }%
\index{Notes: }

Don't forget to list all the log-files that you want to serve on
the command-line.  If there are too many for your inetd, make a
tiny shell script with the \texttt{log-server} invocation and run that
from inetd.

For details on installation, you'd better look at the 
server installation docs (see the server installation docs section) .
%------------------------------------ nt-status-server.pod ---

\section{nt-status-server - allow remote gathering of Windows NT data}%
\index{nt-status-server - allow remote gathering of Windows NT data}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
	usage: nt-status-server [options]
	where options are:
	    -a      show all available performance counters
	    -d ddd  enable debugging at level 'ddd' [\$main::debug]
	    -h      show this help message
	    -i [ppp sss] install this as an NT service, using 'ppp' as
		    as perl and 'sss' as this script.  Defaults to
			perl=C:$\backslash$Perl$\backslash$bin$\backslash$perl.exe
			script=wherever-it's-invoked-from
	    -p ppp  run server on port 'ppp' [1957]
	    -s      run stand-alone, i.e. not as a service
	    -u      un-install this service
	N.B.: Just running this script will cause it to run as a service,
	and when it stops, it will properly stop as a service.\end{verbatim}

\subsection{Description: }%
\index{Description: }

The nt-status-server allows the nt-status-collector (see the nt-status-collector section) 
to get data from a remote machine running some flavour of NT and possibly 
Windows 2000.  It runs \texttt{SRVINFO} from the NT Resource Kit, to find the 
version of NT and examines the NT performance counters for other information.

For details on installation, look at the server installation docs (see the server installation docs section) .

\subsection{Protocol: }%
\index{Protocol: }

The nt-status-collector (see the nt-status-collector section)  connects to the \texttt{nt-status-server} and sends
a series of commands, ending with 'GO'.  Then the server sends back the data
it obtained and closes the connection.
The commands are often the names of programs to run (in UPPERCASE) and
the ones known currently are:

\begin{itemize}


\item SRVINFO - runs SRVINFO and returns the version of NT

\item PERFCOUNTERS - examines the NT performance counters and returns 
information about memory, disk, processes, ...

\item PULIST - runs PULIST (from the NT ResKit) and shows counts for all
the running processes.

\item MSDRPT - runs WINMSDP to show (currently) memory total and free.

\item USRSTAT - runs USRSTAT (from the NT ResKit) and shows when the various
users in the specified NT domain last logged in, and which domain-controller
authorized them.

\item NET-VIEW - runs "NET VIEW" to list the computers currently visible.

\item TIME - compares local and remote times

\end{itemize}
If you want to see what it returns, you can simply start it up and telnet to it.

\subsection{Installation }%
\index{Installation }

You'll have to use SRVANY to run it as a service until I figure out why the service
code doesn't work.  Note that I've had to run the service under the local system account
to get it to be able to access most interesting info.

\subsection{Bugs }%
\index{Bugs }

\begin{itemize}


\item It is intended that it will eventually install itself as an NT service, and most
of the code is there, but it doesn't currently work.  Patches gratefully accepted.
For now you have to invoke it with the \texttt{-s} switch to have it run stand-alone or use
SRVANY to provide the NT service stuff, (which also requires the \texttt{-s} flag.

\item Not only is is currently single-threaded (i.e. won't accept more than one connection
at a time), but if a second connection comes in the server won't answer any more requests
and will have to be re-started.  I've added code to nt-status-collector (see the nt-status-collector section)  so that it
won't run if there is another instance running already.  This won't help if you're using
telnet to test the nt-status-server, so be prepared to restart nt-status-server if it
gets wedged because of this.

\end{itemize}%------------------------------------ remoteping-server.pod ---

\section{remoteping-server - allow remote collection of ping data}%
\index{remoteping-server - allow remote collection of ping data}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
remoteping-server version 1.5
usage: ../remoteping-server [options]
where options are:
	-d nnn	enable debugging output at level 'nnn'
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The remoteping-server allows the remoteping-collector (see the remoteping-collector section)  to obtain ping 
data remotely.  Like the ping-collector (see the ping-collector section) , it uses multiping (see the multiping section) 
to get ping data, but it can be queried from a remote site.

I'm looking for volunteers; please look at
this note (see the this note section) .
%------------------------------------ unix-status-server.pod ---

\section{unix-status-server - allow remote gathering of unix data}%
\index{unix-status-server - allow remote gathering of unix data}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
unix-status-server version 1.26
usage: ../unix-status-server [options]
where options are:
	-d nnn	enable debugging output at level 'nnn'
	-h	show this help
	-r	include remotely-mounted file-systems
	-t tst	do tests 'tst, a comma-separated list of:
		vmstat, df, uptime, netstat, uname, ps, proc, 
		ftpcount, netstat-tcpstates, fileage and qmailq
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The unix-status-server allows the unix-status-collector (see the unix-status-collector section) 
to get data from a remote machine running some flavour of unix.  It
runs several different programs on request (uname, vmstat, df, uptime, 
netstat, ps, ftpcount, qmail-qstat, and qmail-qread).  

\subsection{Protocol: }%
\index{Protocol: }

The unix-status-collector (see the unix-status-collector section)  connects to the \texttt{unix-status-server} and sends
a series of commands, ending with 'GO'.  Then the server sends back the data
it obtained by running the requested programs and closes the connection.
The commands are usually the names of programs to run (in UPPERCASE) and
the ones known currently are:

\begin{itemize}


\item UNAME runs uname and returns:
machine, os\_name, os\_release, os\_version

\item VMSTAT runs vmstat and returns variables relating to memory usage
depending on the operating system

\item DF runs df and for each file-system returns:
dfsize:FSNAME, dfused:FSNAME, dfpercent:FSNAME
inodessize:FSNAME, inodesused:FSNAME, inodespercent:FSNAME

\item UPTIME runs uptime and returns:
uptime (a timestamp in seconds), users, load1, load5, load15

\item NETSTAT runs netstat and, for each interface, returns:
interface\_packets\_in:IFNAME, interface\_errors\_in:IFNAME,
interface\_packets\_out:IFNAME, interface\_errors\_out:IFNAME,
interface\_collisions:IFNAME

\item PS runs ps and returns various numbers pulled out of the output
(see below)

\item FTPCOUNT runs ftpcount (from wuftpd) to find out which groups the
ftp-server's users fall into

\item QMAILQ runs qmail-qstat and qmail-qread and returns:
qmail\_qsize, qmail\_qbacklog, qmail\_qlocal, qmail\_qsite, 
qmail\_qremote

\item FILEAGE returns timestamps for the ages of specified files
(see below)

\item TIME return the difference in time-stamps between the host running the unix-status-server
and the querying host.  It must be given the querying host's timestamp following
the \texttt{TIME} directive.  The two variables returned are time and timediff.

\end{itemize}
If you want to see what it returns, you can simply invoke the \texttt{unix-status-server}
as a local script and type commands at it.

\subsection{Programs: }%
\index{Programs: }

\begin{itemize}


\item \texttt{/usr/local/bin/uname} or \texttt{/usr/bin/uname}
It's cosmetic, for web-page header info, but sometimes it's
really usefull too.

\item \texttt{/usr/bin/vmstat} or \texttt{/usr/ucb/vmstat}
for scanrate, interrupts, context-switches and cpu-time, and 
of course free memory and swap

\item \texttt{/usr/local/bin/df} or \texttt{/usr/xpg4/bin/df} or \texttt{/bin/df}
the gnu df.  I need the -P flag (for Posix, but it makes df put
its info on one line), and the -i flag for inode info.

\item \texttt{/usr/local/bin/uptime} or \texttt{/usr/bin/uptime} or 
\texttt{/usr/ucb/uptime}
the gnu uptime has a format I know how to parse.  Others sometimes
invent new ways to be cute about the display that I don't always
recognise.

\item \texttt{/usr/bin/netstat} or \texttt{/usr/ucb/netstat}
to get network interface info

\item \texttt{/usr/bin/ps} or \texttt{/bin/ps}
for counting the number of running instances of a named process.

\item \texttt{/usr/local/bin/ftpcount} (part of wu-ftpd distribution) shows the number of ftp clients of wu-ftpd
from each access group.

\item \texttt{/var/qmail/bin/qmail-qstat} and \texttt{/var/qmail/bin/qmail-qread}
If you have qmail (see \textbf{http://www.qmail.org/}), these will
let you get information about the queue size, which you can't
find from the logs.  Otherwise, ignore them.

\end{itemize}
\subsection{PS Usage:}%
\index{PS Usage:}

With extended commands, of which \texttt{PS} is the first, you also specify
what you want to look for with extra commands, in addition to the \texttt{PS}
command.  A command looks like:

\begin{verbatim}%
	varname PS func pattern\end{verbatim}

The \texttt{varname} is used to create a variable-name for the returned data.
The name will be \texttt{ps:varname}.  \texttt{Func} is one of \texttt{count}, \texttt{sum},
\texttt{last}, \texttt{average}, \texttt{min}, \texttt{max}.  \texttt{Pattern} is a perl-style 
regular-expression, the simplest form of which is just a string.

For an example, if we wanted to know how many web-servers were running
over time, we might use (very sloppily):

\begin{verbatim}%
	webservers PS count httpd\end{verbatim}

[You probably want a better regular expression.]

\subsection{FILEAGE Usage:}%
\index{FILEAGE Usage:}

For the \texttt{FILEAGE} command, you have to specify an extended command
that looks like:

\begin{verbatim}%
	varname FILEAGE /path/to/file\end{verbatim}

This will produce a timestamp for the last-modification time of \texttt{/path/to/file}.

\subsection{Notes: }%
\index{Notes: }

With older versions of \texttt{vmstat}
(ones that mash fields together), it will give up on \texttt{vmstat} and not return
memory and CPU info.  It also requires a version of \texttt{df} that will accept the
\texttt{-P} and \texttt{-i} flags.  The \texttt{-P} flag forces the output 
for a file-system to stay on one line (easier for me to parse) and the
\texttt{-i} returns info about inodes.  If the \texttt{-i} flag is missing,
you won't get any inode data.  You also won't get any inode data if
the file-system doesn't have inodes.  (Duh :-).

For details on installation, look at the server installation docs (see the server installation docs section) .
%------------------------------------ collectors.pod ---

\chapter{Collectors}
\index{Collectors}

\section{Collectors Data Format}%
\index{Collectors Data Format}

All the collectors produce data on stdout in the same standard form:

\begin{verbatim}%
	host timestamp variable value\end{verbatim}

If the \texttt{variable} is for something like network interfaces,
where the host can have several of them, the data will look like:

\begin{verbatim}%
	host timestamp variable:instance value\end{verbatim}

Having all the collectors using a standard form permits a single 
updating program, updater (see the updater section) , to process the data from them all, and 
also means that I can write a new collector without needing to change 
the updater.

\chapter{Collectors}
\index{Collectors}

\section{Remstats supplied collectors}%
\index{Remstats supplied collectors}

\begin{itemize}


\item log-collector (see the log-collector section)  - gets info from remote 
log-files

\item ping-collector (see the ping-collector section)  - pings hosts

\item port-collector (see the port-collector section)  - checks on remote services

\item remoteping-collector (see the remoteping-collector section)  - pings hosts from somewhere else

\item unix-status-collector (see the unix-status-collector section)  - gets info from unix hosts

\item snmp-collector (see the snmp-collector section)  - gets info via SNMP

\item snmp-route-collector (see the snmp-route-collector section)  - counts routes available from BGP peers

\end{itemize}
The usual invocation of a collector (via run-remstats (see the run-remstats section) ) is:

\begin{verbatim}%
	xxx-collector | updater xxx\end{verbatim}

\chapter{Collectors}
\index{Collectors}

\section{How to write your own collector}%
\index{How to write your own collector}

There are a few requirements:

\begin{enumerate}


\item  it must write its results to stdout in 
standard form (see the top of this file.)

\item  it must be placed in the same directory with the rest of
the collectors, and must be called XXX-collector, replacing "XXX"
with whatever it's collecting.

\item  it must take (or at least ignore), the same arguments that 
the other collectors do, specificly, the \texttt{-f}, \texttt{-u} and \texttt{-F} flags, 
and the \texttt{-G} and \texttt{-H} flags, if I ever get around to implementing 
them (see todo (see the todo section) ).

\item  you must add it to the list of collectors (the \texttt{collectors}
line in the general config-file  (see the general config-file  section) ).

\item  you must define rrd(s) specifying "source XXX" to use the data
from this collector.

\item  you must add "rrd YYY" to the appropriate 
host config-files (see the host config-files section) .

\end{enumerate}
There is a supplied \texttt{skeleton-collector.pl} file supplied with the
distribution, which does everything except collect data.  You should
be able to plug your code into its \texttt{collect\_host} routine and have a
collector, if you don't mind writing in perl.
%------------------------------------ log-collector.pod ---

\section{log-collector - get stats from remote log-files}%
\index{log-collector - get stats from remote log-files}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
log-collector version 1.12
usage: ../log-collector [options]
where options are:
   -d nnn  enable debugging output at level 'nnn'
   -f fff  use config-dir 'fff'[/home/remstats/etc/config]
   -F      force collection, even if it's not time
   -h      show this help
   -H HHH  only do hosts from 'HHH', a comma-separated list
   -p ppp  contact log-server on port 'ppp' [1958]
   -t ttt  timeout each port attempt after 'ttt' seconds [10]
   -u      ignore uphosts file
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The log-collector gets data from remote log-server (see the log-server section) 's.  This way the
whole log-file doesn't have to be transfered.  The "protocol",
if it deserves that name, is very simple.  The collector sends a request,
which looks like (you can type it in via telnet):

\begin{verbatim}%
	LOGFILE /wherever/the/logfile.is
	varname	function pattern
	...
	GO\end{verbatim}

The directives are all in \textbf{UPPERCASE}.  They are \texttt{LOGFILE}, 
\texttt{GO}, \texttt{DEBUG} and \texttt{TEST}.  The \texttt{LOGFILE} directive 
tells the \texttt{log-server} which file to read.  The \texttt{GO} 
directive starts the request.  \texttt{DEBUG}
causes some extra remote debugging output, and \texttt{TEST} makes the
\texttt{log-server} operate in test mode.  In test mode it doesn't update the
last-read position for that log-file, so you won't lose any data when testing.

The other lines are telling the \texttt{log-server} what data to collect.
The first "word" is the variable name to be returned.  The next is the function
to be applied (from \texttt{count}, \texttt{sum}, \texttt{average}, \texttt{min}, \texttt{max}, 
\texttt{first} and \texttt{last}).  The rest of the line is a perl-style regex.  
Except for the count function, the regex must contain a (parenthesized) 
number, to which the function will be applied.

For example, the line:

\begin{verbatim}%
	rootlogins count ROOT LOGIN\end{verbatim}

would return data for a variable called rootlogins.  The value would be the count
of the records in the specified logfile which had the string 'ROOT LOGIN' in them.

The pattern can be much more complicated, for example (from the httpdlog rrd):

\begin{verbatim}%
	bytes sum $\backslash$sHTTP/$\backslash$d$\backslash$.$\backslash$d"$\backslash$s+2$\backslash$d$\backslash$d$\backslash$s+($\backslash$d+)\end{verbatim}

This looks through a standard web-server log-file and extracts the bytes transferred
and adds them up to produce the total number of bytes transferred in that sample 
period.

\subsection{How to make RRDs that use the log-collector}%
\index{How to make RRDs that use the log-collector}

It's easiest to explain by example.  Look at the beginning of the rrd \texttt{httpdlog},
copied here:

\begin{verbatim}%
	source  log
	step    300
	data    requests        GAUGE:600:0:U   count (GET|POST)
	data    success         GAUGE:600:0:U   count $\backslash$sHTTP/$\backslash$d$\backslash$.$\backslash$d"$\backslash$s+2$\backslash$d$\backslash$d
	data    bytes           GAUGE:600:0:U   sum $\backslash$sHTTP/$\backslash$d$\backslash$.$\backslash$d"$\backslash$s+2$\backslash$d$\backslash$d$\backslash$s+($\backslash$d+)\end{verbatim}

To form the requests to be sent to the log-server, the log-collector takes the 
DS name, e.g. \texttt{success}, and the last part of the line after all the DS definition
\texttt{count $\backslash$sHTTP/$\backslash$d$\backslash$.$\backslash$d"$\backslash$s+2$\backslash$d$\backslash$d}, combines the two and sends:

\begin{verbatim}%
	success count $\backslash$sHTTP/$\backslash$d$\backslash$.$\backslash$d"$\backslash$s+2$\backslash$d$\backslash$d\end{verbatim}

Note that the pattern can include magic cookies (see the magic cookies section)  as of remstats version 0.12.2.
%------------------------------------ nt-status-collector.pod ---

\section{nt-status-collector - stats from Windows NT hosts}%
\index{nt-status-collector - stats from Windows NT hosts}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
nt-status-collector version 1.25
usage: ../nt-status-collector [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -F      force collection, even if it's not time
    -h      show this help
    -H HHH  only try hosts from 'HHH', a comma-separated list
    -p ppp  connect to server on port 'ppp' [1957]
    -t ttt  set timeout to 'ttt' [25]
    -u      ignore uphosts file
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The \texttt{nt-status-collector} gets its data from the nt-status-server (see the nt-status-server section) .
It sends a query consisting mostly of the sections of the server
that it wants to run.  It can also request that processes with
specific names be counted and that information returned too.
A query for all the sections might look like:

\begin{verbatim}%
	SRVINFO
	PERFCOUNTERS
	PULIST
	MSDRPT
	USRSTAT ntdomain
	NET-VIEW
	GO\end{verbatim}

Note that \texttt{PULIST}, \texttt{MSDRPT}, \texttt{USRSTAT} and \texttt{NET-VIEW} aren't currently
used by anything, but they may be usefull for something.  Also, USRSTAT wants
an NT domain-name with the query.
%------------------------------------ ping-collector.pod ---

\section{ping-collector - get reachability of hosts}%
\index{ping-collector - get reachability of hosts}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
ping-collector version 1.16
usage: ../ping-collector [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -F      force collection even if it's not time
    -h      show this help
    -H HHH  only try hosts from 'HHH', a comma-separated list
    -u      for compatibility with run-remstats; ignored
\end{verbatim}

\subsection{Description: }%
\index{Description: }

ping-collector uses multiping (see the multiping section)  to get numbers on how reachable the 
hosts are.  Each host is sent 10 pings (ICMP echo-request) and the 
number of responses and the min, max and average RTT (Return
Trip Time) is logged, giving the variables ping-sent, ping-rcvd,
pingrtt-min, pingrtt-avg and pingrtt-max.
%------------------------------------ multiping.pod ---

\section{multiping }%
\index{multiping }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
usage: ../multiping/multiping [-Rdfnqrtv] [-c count] [-i wait] [-l preload]
            [-p pattern] [-s packetsize] host

       Options:
       R: ICMP record route
       d: set SO_DEBUG socket option
       f: 'flood' mode
       n: force addresses to be displayed in numeric format
       r: set SO_DONTROUTE socket option
       t: show results in tabular form
       v: verbose mode for ICMP stuff
\end{verbatim}

\subsection{Description: }%
\index{Description: }

Multiping runs pings in parallel which permits you to ping lots of hosts 
quickly.  I wrote a program using Net::Ping to try to how bad a simple-minded
approach was.  With .025s between pings in my programs and 1s in multiping,
my program took 17 minutes and multiping took 37 seconds.  Maybe someone
will not be able to get multiping going and will re-write it in perl.  Not
me.  I'd be happy to include it if some-one wants to send me a copy.
%------------------------------------ port-collector.pod ---

\section{port-collector - get service status}%
\index{port-collector - get service status}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
port-collector version 1.15
usage: ../port-collector [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -F      force collection even if it's not time
    -h      show this help
    -H HHH  only try hosts from 'HHH', a comma-separated list
    -t ttt  set default timeout to 'ttt' [5]
    -u      ignore uphosts file
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The \texttt{port-collector} gets data about services running on
specified TCP ports.  It will attempt to connect to the specified
port on the host, and optionally send a string to it.  It will
then examine the response, if any, for certain patterns.  This
permits it to query almost any text-based protocol.  For information
on how to set up a new service, look in the 
scripts (see the scripts section)  directory in the configuration directory.

The rrd specification can also override the port specified by the script,
by appending a colon and the port-number.  E.G.  for a web-server
on port 8000, you could specify the rrd like:

\begin{verbatim}%
	rrd port-http:8000\end{verbatim}

According to whether it can connect to the service and what response
it gets back, it sets a status to one of OK, WARN, ERROR, CRITICAL.
These are arbitrary levels, except that OK means normal, and their
meanings are determined by the configuration file.  The 
\texttt{port-collector} will also log how long it took the service to
respond.  These numbers are not intended for benchmarking, but only
for determining the health of the service.

\subsection{Returned Data}%
\index{Returned Data}

The variables returned by the port-collector are:

\begin{verbatim}%
	port-PORTNAME - containing the status of the port, calculated by 
		the script for this port
	port-PORTNAME-response - containing the response-time for the query\end{verbatim}

\subsection{Other data from the port-collector}%
\index{Other data from the port-collector}

The main RRD for the port-collector is \texttt{port-*}, but it is possible to 
define other RRDs.  If you want to collect information from the results
elicited by the send string, you can provide either or both of the
\texttt{infopattern} or \texttt{valuepattern} in the script associated with the RRD.
The script must be named the same as the rrd.  Look in the
scripts configfile docs (see the scripts configfile docs section)  for details on scripts.

A matching \texttt{valuepattern} will cause the port-collector to return
variables named \texttt{RRDNAME:value\#} with "\texttt{\#}" replaced by a single digit,
corresponding to the number of the parenthesized part of the pattern that
was matched.  

A matching \texttt{infopattern} will cause the port-collector to create status
files for this host called INFO1-RRDNAME.  None of the existing pagemakers (see the pagemakers section) 
use these status files, but the view-writer (see the view-writer section)  could do so if a 
view template (see the view template section)  refered to them.
%------------------------------------ remoteping-collector.pod ---

\section{remoteping-collector - reachability from other sites}%
\index{remoteping-collector - reachability from other sites}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
remoteping-collector version 1.10
usage: ../remoteping-collector [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -h      show this help
    -p ppp  use port 'ppp' instead of the default [1959]
    -t ttt  use 'ttt' for timeout [60]
    -u      for run-remstats compatibility
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The \texttt{remoteping-collector} is intended to gather ping statistics
(see ping-collector (see the ping-collector section) ) from remote sites.  It works by contacting
remoteping-server (see the remoteping-server section) s running on other machines.  This way it will be 
possible to monitor the same list of hosts from multiple points 
on the network and determine several things:

\begin{itemize}


\item general health of parts of the network of interest to
the co-operating parties, and 

\item if certain parts of the network are performing better or
worse than others.

\end{itemize}
\subsection{Note: }%
\index{Note: }

Note the use of the future tense in the previous paragraph.  I'm
looking for volunteers to run the remoteping-server (see the remoteping-server section)  and let me 
have access to it.  In return, I'll let you look at the
stats that this process gathers.  I'm planning to monitor ISPs and
other sites across Canada, as well as commonly accessed sites around
the world, to determine how we're doing in network 
performance, here in Canada.  If you want to volunteer, please hit
the mailto URL below and ignore the bounce from 
my spam protection (see \textbf{http://silverlock.dgim.crc.ca/\~{}terskine/qmail/tms.html}).
%------------------------------------ snmp-collector.pod ---

\section{snmp-collector - get data via SNMP}%
\index{snmp-collector - get data via SNMP}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
snmp-collector version 1.15
usage: snmp-collector [options]
where options are:
    -c ccc  use 'ccc' for the read community string; overrides host
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -F      force collection even if it's not time
    -h      show this help
    -H HHH  only try hosts from 'HHH', a comma-separated list
    -u      ignore uphosts file
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The snmp-collector collects data available via SNMP.  There are
some things that are hardcoded in, but it's mostly configurable.
It will attempt to query for the following, if available:

\begin{itemize}


\item \textbf{sysDescr} - tells what kind of a device this is

\item \textbf{sysUptime} - how long it has been up

\end{itemize}
and use them in the host index page.

The \texttt{snmpif-*} rrd is wired into the snmp-collector (for now) and
causes it to fetch the following for each interface:

\begin{itemize}


\item \textbf{ifType} - interface type

\item \textbf{ifOperStatus} - operational status

\item \textbf{ifSpeed} - interface speed

\item \textbf{ifInErrors} - input errors

\item \textbf{ifOutErrors} - output errors

\item \textbf{ifInOctets} - input octets (aka bytes)

\item \textbf{ifOutOctets} - output octets (aka bytes)

\item \textbf{ifInUcastPkts} - input unicast packets

\item \textbf{ifOutUcastPkts} - output unicast packets

\item \textbf{ifInNUcastPkts} - input non-unicast 
(broadcast and multicast) packets

\item \textbf{ifOutNUcastPkts} - output non-unicast 
(broadcast and multicast) packets

\end{itemize}
The sysDescr and sysUptime are saved for the host display and the
ifType and ifSpeed are combined to give a hardware description
for the interface.  Crude, but portable.

For other SNMP data, you'll need to look at the 
[oids] (see the [oids] section)  file in the 
configuration directory.  The rrd will need to contain \texttt{oid}
lines specifying names assigned in the oids section (see the oids section section) .
If the host doesn't have one, the rrd will also need to specify
a \texttt{community}.  Here's an example:

\begin{verbatim}%
	[rrd snmpmem]
	source          snmp
	step            300
	data            freemem=ciscofreemem GAUGE:600:0:U
	data            totalmem=ciscototalmem GAUGE:600:0:U
	archives        day-avg week-avg month-avg year-avg
	times           day yesterday week month year
	oid             CiscoFreeMem
	oid             CiscoTotalMem\end{verbatim}

This rrd definition will fetch the amount of free memory and total memory
available on a Cisco router.  Since it's querying a Cisco-specific MIB,
it's not usefull on other gear.
%------------------------------------ snmp-route-collector.pod ---

\section{snmp-route-collector }%
\index{snmp-route-collector }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
snmp-route-collector version 1.12
usage: snmp-route-collector [options]
where options are:
    -c ccc  use 'ccc' for the read community string; overrides host
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -F      force collection even if it's not time
    -h      show this help
    -H HHH  only try hosts from 'HHH', a comma-separated list
    -u      ignore uphosts file
\end{verbatim}

\subsection{Description: }%
\index{Description: }

This is a specialized form of SNMP collector which walks a part of the BGP4
MIB, specificly \texttt{bgp4PathAttrBest}, to count routes available from a given
BGP peer host.  It notes both the total number of routes and how many of them
are the best route to that destination.

Unfortunately, it doesn't scale.  On routers with large numbers of peers 
it can take a \textbf{long} time to troll through all the routes.  This needs to 
be replaced.
%------------------------------------ unix-status-collector.pod ---

\section{unix-status-collector - stats from unix hosts}%
\index{unix-status-collector - stats from unix hosts}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
unix-status-collector version 1.16
usage: unix-status-collector [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -F      force collection even it it's not time yet
    -h      show this help
    -H HHH  only try hosts from 'HHH', a comma-separated list
    -p ppp  connect to server on port 'ppp' [1957]
    -t ttt  set timeout to 'ttt' [10]
    -u      ignore uphosts file
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The unix-status-collector gets its data from the unix-status-server (see the unix-status-server section) .
For a detailed explanation of what the various directives mean,
see its documentation, as it's the implementor.
It sends a query consisting mostly of the sections of the server
that it wants to run.  It can also request that processes with
specific names be counted and that information returned too.
A query for all the sections might look like:

\begin{verbatim}%
	UNAME
	UPTIME
	TIME 986485967
	VMSTAT
	DF
	NETSTAT
	QMAILQ
	PS
	webservers ps count httpd
	FILEAGE
	test fileage /var/spool/locks/lockfile
	PROC
	swaptot proc /proc/meminfo \^SwapTotal:$\backslash$s+($\backslash$d+)
	GO\end{verbatim}

The \texttt{webservers ps count httpd} line requests that the ps section
count the number of processes called \texttt{httpd} and return
that as a variable called \texttt{webservers}.

The \texttt{test fileage /var/spool/locks/lockfile} line requests the last 
modification time of the file \texttt{/var/spool/locks/lockfile}, which is 
returned in seconds.

The \texttt{swaptot ...} line looks for the total swap size in \texttt{/proc/meminfo}.

The best way to see what it will produce is to run it manually.
%------------------------------------ updater.pod ---

\chapter{updater}
\index{updater}

\section{updater - add new data to RRDs}%
\index{updater - add new data to RRDs}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
updater version 1.9
usage: updater [options] collector
where options are:
	-d nnn	enable debugging output at level 'nnn'
	-f fff	use 'fff' for config-dir [/home/remstats/etc/config]
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

It reads collector output in standard form from stdin and updates the 
appropriate RRDs.  It wants to know which collector the information came
from to avoid looking for information that won't be there.
%------------------------------------ monitors.pod ---

\chapter{Monitors}
\index{Monitors}

\section{Monitors }%
\index{Monitors }

Currently, there are three monitors:

\begin{itemize}


\item ping-monitor (see the ping-monitor section)  - determines reachability of hosts

\item alert-monitor (see the alert-monitor section)  - figures out status of various values
specified in the rrds (see the rrds section)  and hosts (see the hosts section)  config-files

\item topology-monitor (see the topology-monitor section)  - to analyze changing routes to your monitored hosts

\end{itemize}%------------------------------------ alert-monitor.pod ---

\section{alert-monitor - a status evaluator and alert trigger}%
\index{alert-monitor - a status evaluator and alert trigger}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
alert-monitor version 1.20
usage: ../alert-monitor [options]
where options are:
	-d nnn  enable debugging output at level 'nnn'
	-f fff  use config-dir 'fff'[/home/remstats/etc/config]
	-h      show this help
	-s sss  search 'sss' data samples for values [5]
	-u      generate alerts for hosts unreachable through a down host
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The \texttt{alert-monitor} compares the current value of variables specified in
the alerts file (see the alerts file section)  in the configuration directory with
threshold values and sets the status of those variables accordingly.  
It saves the current status of variables in \texttt{/home/remstats/data/ALERTS}.

What value corresponds to what status level is set in the 
rrd definition (see the rrd definition section)  or sometimes the 
host definition (see the host definition section) .  This way an rrd
definition will specify generally reasonable levels, but they can be 
overridden for hosts where they aren't reasonable.

For an rrd definition, an alert line looks like:

\begin{verbatim}%
	alert varname relation oklevel [warnlevel [errorlevel]]\end{verbatim}

or

\begin{verbatim}%
	alert varname nodata status\end{verbatim}

[The latter says that missing data for variable \texttt{varname} will cause its status
to be level \texttt{status}.]

For a host-specified alert level, the line looks like:

\begin{verbatim}%
	alert rrdname varname relation oklevel [warnlevel [errorlevel]]\end{verbatim}

or

\begin{verbatim}%
	alert rrdname varname nodata status\end{verbatim}

and the interpretation is the same, except that you're having to say
which rrd this alert refers to.

The available relations are:

\begin{verbatim}%
	$<$ (value is less than threshold)
	$>$ (value is greater than threshold)
	= (value is equal to threshold)
	|$<$ (absolute value of value is less than threshold)
	|$>$ (absolute value of value is greater than threshold)
	delta$<$ (difference between last two values is less than threshold)
	delta$>$ (difference between last two values is greater than threshold)
	$>$daystddev (value is outside threshold * the past day's standard-deviation)
	$>$weekstddev (value is outside threshold * the past day's standard-deviation)
	$>$monthstddev (value is outside threshold * the past day's standard-deviation)\end{verbatim}

\subsection{Example }%
\index{Example }

To make things more concrete for the first (normal) case, here's a real example, 
from the \texttt{load} rrd supplied in \texttt{config-base}:

\begin{verbatim}%
	alert load5 $<$ 3 7 10\end{verbatim}

This means that if the \texttt{load5} variable is less than 3, the status is set to OK.
If it's less than 7, it's WARN, less than 10 it's ERROR and more than that, it's
CRITICAL.

Since the first match is taken, it's possible to leave out the upper levels if
you don't want them to ocurr.  For example if you only wanted \texttt{load5} to ever
go to WARN level, never above, you could use:

\begin{verbatim}%
	alert load5 $<$ 3\end{verbatim}

and then the only possible status levels are OK and WARN.

The possible \texttt{relation}s are: $<$, =, $>$, |$<$, |$>$, delta$<$, delta$>$.  The first
three should be obvious.  The next two allow comparisons to the absolute value of
the variable's current value.  The last two allow comparisons to the change in
value.

\subsection{Causing alerts}%
\index{Causing alerts}

Depending on the lines in the alerts file (see the alerts file section) , the status may also
trigger alerts.  A matching line in the alerts config-file (see the alerts config-file section)  will cause
\texttt{alert-monitor} to run the alerter (see the alerter section)  for each of the specified 
recipients.  It will also be passed, in order:

\begin{itemize}


\item \textbf{recipient} - the recipient; for alert-email (see the alert-email section)  it
will be an email address

\item \textbf{hostname} - the name of the host that the alert applies to

\item \textbf{ip} - the IP number for that host, in case it's not in DNS

\item \textbf{rrdname} - the name of the RRD

\item \textbf{wildpart} - the wild part of a wildcard RRD.  E.G, for an
RRD of \texttt{port-ftp} (using the wildcard RRD \texttt{port-*}) the wildpart
would be \texttt{ftp}.

\item \textbf{variable} - the name of the variable

\item \textbf{status} - the current status, as decided by alert-monitor

\item \textbf{old\_status} - the previous status

\item \textbf{value} - the current value of the variable

\item \textbf{relation} - the relation used to compare the variable to the
threshold, mostly for creating informative messages

\item \textbf{threshold} - the threshold value that was exceeded

\item \textbf{start} - timestamp of when the alert started

\item \textbf{duration} - number of seconds that the alert has been active

\item \textbf{host-description} - the description field from the host config-file

\item \textbf{rrd-description} - the description tag on this rrd (desc="xxx")

\item \textbf{webmaster} - the email address of the remstats person

\item \textbf{template} - the name of the template file to generate the message from.

\end{itemize}%------------------------------------ alerter.pod ---

\section{alerter - construct and send alert text}%
\index{alerter - construct and send alert text}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
alerter version 1.8
usage: alerter [options] args
where options are:
    -d ddd  set debugging output to level 'ddd'
    -h      show this help
    -f fff  use 'fff' as configuration directory [/home/remstats/etc/config]
The args are documented in alert-monitor; a quick list:
    towho host ip realrrd wildpart var status old_status value relation 
    threshold alertstart duration hostdesc rrddesc webmaster template
\end{verbatim}

\subsection{Description: }%
\index{Description: }

[\texttt{Alerter} may be rolled into the \texttt{alert-monitor} at some point in
the future.  It was easier to test as a separate program, and the performance
hasn't been an issue for me.]

\texttt{Alerter} is passed its parameters (specified above) by the alert-monitor (see the alert-monitor section) .
Most of them are used to fill in information in the text of the alert.  The
interesting ones are \texttt{towho} and \texttt{template}.

It also reads the alert-destination-map config-file (see the alert-destination-map config-file section) 
to decide where the alert needs to go.  This will give it a list of (method, address)
pairs.

For a given template-name, say \texttt{xxx}, and method, say \texttt{method}, it will 
look for files in /home/remstats/etc/config/alert-templates, called:

\begin{verbatim}%
	method-xxx
	method-DEFAULT
	xxx
	DEFAULT\end{verbatim}

and take the first one it finds.  Similarly, it will look for a header to add to the
top of the template called:

\begin{verbatim}%
	method-HEADER
	HEADER\end{verbatim}

and a footer in one of:

\begin{verbatim}%
	method-FOOTER
	FOOTER\end{verbatim}

The three pieces will be concatenated giving the template text.  Then substitutions
will be done for the following \#\#MAGICCOOKIES\#\#:

\begin{verbatim}%
	HOST IP REALRRD WILDPART FIXEDRRD VAR STATUS OLDSTATUS
	VALUE RELATION THRESHOLD START DURATION HOSTDESC RRDDESC 
	NOW TEXTNOW ALERTHOST TOWHO WEBMASTER\end{verbatim}

This gives the alert text.  From the method definition in the
alert-destination-map config-file (see the alert-destination-map config-file section) 
\texttt{alerter} knows which program to run to send the alert text to the
appropriate address, and it does it.

\subsection{Alert-Sending Scripts}%
\index{Alert-Sending Scripts}

These are now easy to write, and in many cases you won't even have to
write one.  There are two requirements for an alert-sending script:

\begin{enumerate}


\item  It must take an address to send to on the command-line, and

\item  It must accept the text on stdin.

\end{enumerate}
E.G. you could use sendmail with no wrapper.
%------------------------------------ alert-email.pod ---

\section{alert-email - an alert sending script}%
\index{alert-email - an alert sending script}

This is a simple script intended to be run by the alerter (see the alerter section) .  
Like all alert-senders, it takes one argument on the command-line:
the "address" to send the alert to.  The text of the alert is
fed to this script on stdin.  

It sends the alert text to "address" via email, by invoking sendmail,
though there's no reason that it couldn't be re-written to do an SMTP
injection directly if some-one wanted to.  With no error-checking, it
could be re-written as:

\begin{verbatim}%
	\#!/bin/sh
	/usr/lib/sendmail "\$1"\end{verbatim}
%------------------------------------ alert-winpopup.pod ---

\section{alert-winpopup - an alert sending script}%
\index{alert-winpopup - an alert sending script}

This is a simple script intended to be run by the alerter (see the alerter section) .  
Like all alert-senders, it takes one argument on the command-line:
the "address" to send the alert to.  The text of the alert is
fed to this script on stdin.  

It sends the alert to use "address", in this case a windows NetBIOS
machine name, via a Windows popup message.
%------------------------------------ ping-monitor.pod ---

\section{ping-monitor - determine reachability status}%
\index{ping-monitor - determine reachability status}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
ping-monitor version 1.5
usage: ../ping-monitor [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -h      show this help
    -s sss  examine 'sss' samples [5]
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The \texttt{ping-monitor} looks at the last 5 samples (by default)
of ping data and determines the status of the host.  It will choose
one of the following four statuses:

\begin{itemize}


\item \textbf{UP} - the host is up now and has always (throughout
the sample period) responded to pings.

\item \textbf{UPUNSTABLE} - the host is up now, but on at least
one of the samples, it did not respond. 

\item \textbf{DOWNUNSTABLE} - the host is not responding now, but
it has responded within the sample period.

\item \textbf{DOWN} - the host is down now and has not responded
within the sample period.

\end{itemize}
It also writes coloring information for the ping-index web-page.
%------------------------------------ topology-monitor.pod ---

\section{topology-monitor }%
\index{topology-monitor }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
topology-monitor version 1.6
usage: topology-monitor [options] oldfile newfile
where options are:
	-d	enable debugging output
	-f fff use 'fff' for config-dir [/home/remstats/etc/config]
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The \texttt{topology-monitor} runs out of do-traceroutes (see the do-traceroutes section)  to find changes in 
network paths to the monitored hosts.  After \texttt{do-traceroutes} has run 
traceroute for each monitored host, the \texttt{topology-monitor} compares the
current network path to that host with the previous path.  Currently,
all that is done with this information is to log when it changes.
%------------------------------------ run-remstats.pod ---

\chapter{run-remstats}
\index{run-remstats}

\section{run-remstats - run a complete cycle}%
\index{run-remstats - run a complete cycle}

\chapter{run-remstats}
\index{run-remstats}

\section{Usage: }%
\index{Usage: }

\begin{verbatim}%
run-remstats version 1.9
usage: ../run-remstats [options] [-- options-to-be-passed]
where options are:
    --debug=nnn       enable debugging output at level 'nnn'
    --config_dir=fff  use 'fff' for config-dir [/home/remstats/etc/config]
    --help            show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

\texttt{run-remstats} is the main script for a remstats collection machine.
As a simplified overview:

\begin{itemize}


\item check-config (see the check-config section)  is run first.

\item In parallel, all the collectors (see the collectors section)  are run, each feeding it's own
updater (see the updater section)  process.  Some of them query remstats servers (see the servers section) , some get their
information in other ways.  So you have a bunch of pipelines like:
\begin{verbatim}%
	xxx-collector | updater xxx\end{verbatim}


\item When all the collectors have finished, the monitors (see the monitors section)  get run in
parallel to figure out what's happening.

\item Afterwards, if the configuration directory has changed, run the pagemakers (see the pagemakers section) ,
to re-do the web-pages.

\item Finally, it prints all the stderr output of all the various programs,
separated by program.

\end{itemize}
For each of these programs, \texttt{run-remstats} will set a timer (see \texttt{watchdogtimer}
in the general config-file (see the general config-file section) ).  If the timer expires and the
program is still running, \texttt{run-remstats} will kill that process.  This avoids the
problem of a hanging collector hanging the whole remstats cycle.

It also manages a lock-file to make sure that two instances don't run 
concurrently.  The lock-file's name is based on the name of the \texttt{run-remstats}
script.  (See \textbf{Running multiple copies of run-remstats} below.)

It keeps a status file in the configured temp directory (\texttt{/home/remstats/tmp} 
by default) which is used by monitor (see the monitor section)  to show where the \texttt{run-remstats} 
process has gotten to.

When starting, it will also look for a file in the tmp directory called 
\texttt{STOP-run-remstats} (default), and if it exists, will refuse to run at all.

\subsection{Running multiple copies of run-remstats}%
\index{Running multiple copies of run-remstats}

If you symlink \texttt{run-remstats} to \texttt{run-remstats-XXX}, then the 
default configuration directory for \texttt{run-remstats-XXX} will be 
\texttt{/home/remstats/etc/config-XXX}.  Since the lock-file is named for the script 
which invokes it, you won't have collisions between
the two instances, as long as your configuration files don't 
conflict.  You can have multiple collector-only instances collecting 
data which is formatted by a single pagemaker instance, (in theory) 
but this will require at least three config-dirs which must be 
closely co-ordinated.  If you want to do this for performance 
reasons, I do plan to address this in future.

\subsection{Configuration: }%
\index{Configuration: }

See the general (see the general section)  config-file.  The lines
to configure run-remstats are:

\begin{verbatim}%
	pinger, collectors, monitors, pagemakers, watchdogtimer\end{verbatim}
%------------------------------------ check-config.pod ---

\section{check-config }%
\index{check-config }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
check-config version 1.14
usage: check-config [options]
where options are:
	-c      write SNMP communities
	-C CCC  set configuration-debugging output to level 'CCC'
	-d ddd  enable debugging output at level 'ddd'
	-D      dump configuration (must have DEBUG enabled in fixup.config)
	-e      print environment variables to stdout
	-f fff  use config-dir 'fff' [/home/remstats/etc/config]
	-h      show this help
	-l lll	list 'lll' on stdout (comma-separated list of: host, ip, rrd)
	-s sss  shell type to use for -e [sh]
	-t      test-mode; don't make any changes
\end{verbatim}

\subsection{Description: }%
\index{Description: }

\texttt{check-config} uses the common \texttt{read\_config} routine to
read the configuration file which will confirm that it can be
read successfully by other programs.  It also makes sure that
the data directories for all hosts exist, and creates new RRDs.

run-remstats (see the run-remstats section)  also uses the \texttt{-e} option to make basic configuration
information avaiable to the shell.
%------------------------------------ pagemakers.pod ---

\section{Pagemakers }%
\index{Pagemakers }

The remstats pagemakers make web-pages, and update other information used
in making web-pages.  They only need to be run when the configuration file
has changed and run-remstats (see the run-remstats section)  is smart enough to do that.

\begin{itemize}


\item graph-writer (see the graph-writer section)  - makes web-pages with the graphs and links them together

\item snmpif-setspeed (see the snmpif-setspeed section)  - sets maximums on snmpif-* rrds

\item datapage-interfaces (see the datapage-interfaces section)  - makes datapages for every snmpif-* rrd

\item datapage-inventory (see the datapage-inventory section)  - lists all monitored hosts, uptime, software and hardware

\item snmpif-description-updater (see the snmpif-description-updater section)  - updates the descriptions for snmpif-* rrds
from the SNMP descriptions

\end{itemize}%------------------------------------ graph-writer.pod ---

\section{graph-writer }%
\index{graph-writer }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
graph-writer version 1.15
usage: ../graph-writer [options] collector
where options are:
	-d nnn	enable debugging output at level 'nnn'
	-D	enable configuration debugging output
	-f fff	use 'fff' for config-dir [/home/remstats/etc/config]
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

This is the main remstats pagemaker (see the pagemaker section) .  It makes the 
web-pages with the graphs and other pages to link them together and 
organize them.  There are three kinds of page that it makes:

\begin{itemize}


\item \textbf{Indices} - The main three indices are the \textbf{Overall Index}, the
\textbf{Ping Index} and the \textbf{Quick Index}.  Each of these shows all the hosts
being monitored, grouped by the group you assigned them to.  The 
\textbf{Overall Index} shows a section for each host, with a link to all of the
graphs for that host.  The \textbf{Ping Index} shows a small graph of the last
two hours of ping data for that host, for each host, with the graph background
specially coloured for hosts which aren't reachable.  The \textbf{Quick Index}
shows, for each host: a link, a status indicator and optionally a link to
alert.cgi (see the alert.cgi section)  for alerts for that host.
There is also the \textbf{Custom Index} to show links to all the 
customgraphs (see the customgraphs section) .


\item \textbf{Host Pages} - For each host, there is a \textbf{Host Page} which shows
some information about the host and all the day graphs for that host.  The 
graphs are all links to ...

\item \textbf{Graph Pages} - Each graph is also available in various timespans, 
depending on the times (see the times section)  that you specified in
the rrd (see the rrd section)  definition which caused the generation of
that graph.

\end{itemize}
Graph-writer is the replacement for both \texttt{grapher} and \texttt{html-writer}.  
Before version 0.10.0, \texttt{grapher} would make new graphs, as part of the 
update run, and \texttt{html-writer} would re-write the html pages.  Now, 
\texttt{graph-writer} makes a CGI script for each web-page, using \texttt{rrdcgi} as 
its interpreter.  \texttt{Rrdcgi} simply spits out the page as it was written 
with "magic cookies" replaced by $<$IMG SRC...$>$ tags and makes sure that 
there is a recent version of the graph file.  Much better than generating 
all the graphs every five minutes and have most of them never get looked at.
%------------------------------------ snmpif-setspeed.pod ---

\section{snmpif-setspeed }%
\index{snmpif-setspeed }

This is a gross hack which modifies all the \texttt{snmpif-*} rrds to set the
maximum limits on all monitored interfaces.  The input and output bps 
variables have their maximum set to the the maximum for that interface.
The various packet counters have their maximums set to the maximum possible
packets-per-second assuming minimum-length packets, for that interface
speed.

You may not want to run this if you have better knowledge of what real
maximums will be encountered for particular interfaces.
%------------------------------------ datapage-alert-writer.pod ---

\section{datapage-alert-writer }%
\index{datapage-alert-writer }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
Use of uninitialized value at ../datapage-alert-writer line 156.
datapage-alert-writer version 
usage: ../datapage-alert-writer [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -h      show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

This writes a datapage (see datapage.cgi (see the datapage.cgi section) ) which gets linked into the header of
each page as the "Alert Index".  It gives a quick overview of alert statuses and values for
each host.  It ought to be self-explanatory.
%------------------------------------ datapage-interfaces.pod ---

\section{datapage-interfaces }%
\index{datapage-interfaces }

This makes a datapage (see the datapage section)  for each host with \texttt{snmpif-*}
rrds, showing all those interfaces.
%------------------------------------ datapage-inventory.pod ---

\section{datapage-inventory }%
\index{datapage-inventory }

This makes a single page showing all the monitored hosts.  For each host,
it shows:

\begin{itemize}


\item the uptime (from the \texttt{uptime} program or SNMP uptime)

\item the hardware type (from the \texttt{uname} program), if available

\item the software version (from the \texttt{uname} program or 
the SNMP system.sysDescr)

\end{itemize}%------------------------------------ datapage-status.pod ---

\section{datapage-status }%
\index{datapage-status }

\subsection{Usage }%
\index{Usage }

\begin{verbatim}%
datapage-status version 1.4
usage: datapage-status [options] file ...
where options are:
	-d	enable debugging output
	-e      show run-time errors in generated pages
	-f fff use 'fff' for config-dir [/home/remstats/etc/config]
	-h	show this help
\end{verbatim}

\subsection{Description }%
\index{Description }

The \texttt{datapage-status} program creates a datapage (to be interpreted by
datapage.cgi (see the datapage.cgi section) ) showing the current values of all
variables in all RRDs for that host, in addition to the usual remstats
headers.
%------------------------------------ view-writer.pod ---

\section{view-writer }%
\index{view-writer }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The \texttt{view-writer} makes web-pages from the view definitions which are
contained in the views config-dir (see the views config-dir section) .  All the documentation
relating to \texttt{view-writer} is there too, as it only implements what the views
request.
%------------------------------------ remstats-monitor.pod ---

\section{remstats-monitor - watch remstats processes}%
\index{remstats-monitor - watch remstats processes}

\subsection{Usage: }%
\index{Usage: }

\texttt{remstats-monitor [sleeptime]}

where sleeptime is the time (in seconds) to wait between polls

\subsection{Description: }%
\index{Description: }

This is primarily a development tool.  It loops doing a \texttt{ps} command,
weeding out everything except the remstats processes and cleaning up the results,
to make it easier to read.  It also shows the process-id from run-remstats (see the run-remstats section) 
lock-file, and the status from its status file.

It's not written portably and will probably have to be tweaked by hand
if you want to run it.  If you find it of interest,
please let me (see the me section)  know.
%------------------------------------ cgis.pod ---

\section{CGI Scripts}%
\index{CGI Scripts}

These are intended to be invoked via the html-writer created toolbars, to
do the supplied functions to the host in question.

\begin{itemize}


\item alert.cgi (see the alert.cgi section)  - Shows the current alert status of selected rrd variables.

\item availability-report.cgi (see the availability-report.cgi section)  - Shows availability of RRD variables.

\item dataimage.cgi (see the dataimage.cgi section)  - Generates images based on live data.

\item datapage.cgi (see the datapage.cgi section)  - Generates web-pages containing dynamic data.

\item graph.cgi (see the graph.cgi section)  - Allows non-remstats web-pages to show remstats graphs.

\item log-event.cgi (see the log-event.cgi section)  - log a manual event.

\item ping.cgi (see the ping.cgi section)  - Ping the host.

\item showlog.cgi (see the showlog.cgi section)  -  Display selected portions of the remstats log files.

\item traceroute.cgi (see the traceroute.cgi section)  - find network path to a host

\item whois.cgi (see the whois.cgi section)  - look up information about hosts, IP\#s, ...

\end{itemize}%------------------------------------ alert-cgi.pod ---

\section{alert.cgi - Alert Reporting and Updating}%
\index{alert.cgi - Alert Reporting and Updating}

This CGI script will generate the Alert Report and also let you modify it.
You can turn alerts off for a specific line (by checking the \texttt{quench}
check-box).  You can also attach comments to a specific alert, for example
to let other people know that you're already working on it, or when a
service will be available again.
%------------------------------------ availability-report-cgi.pod ---

\section{availability-report.cgi }%
\index{availability-report.cgi }

The \texttt{availability-report.cgi} calls availability-report (see the availability-report section)  to produce
a report of "availability" according to the definitions in the
availability (see the availability section)  config-file.
%------------------------------------ dataimage-cgi.pod ---

\section{dataimage.cgi - create images driven by live data}%
\index{dataimage.cgi - create images driven by live data}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
	$<$IMG SRC="http://remstats.sourceworks.com:1954/dataimage.cgi?imagename"$>$\end{verbatim}

\subsection{Description: }%
\index{Description: }

\texttt{Dataimage.cgi} reads an image definition from 
\texttt{/home/remstats/datapage/imagename.image}.  Some of the commands are in common
with datapage.cgi (see the datapage.cgi section)  and are documented
there:

\begin{verbatim}%
	oid, rrd, status, eval, debug, macro, macroend and *EOD*\end{verbatim}

These retrieve and manipulate data.  There are also commands to create
images:

\begin{verbatim}%
	image, colordef, color, linewidth, line, rectangle, circle, 
	fill, font, text, out, flow\end{verbatim}

\section{Image Commands}%
\index{Image Commands}

\subsection{image }%
\index{image }

The image command has two formats.  The first looks like:

\begin{verbatim}%
	image WIDTH HEIGHT\end{verbatim}

This creates a blank image of the size specified.  Sometimes you'll want a
background for the image, and you can use the second form to specify
a file to read for the background:

\begin{verbatim}%
	image BGFILE\end{verbatim}

This will create the new image the same size as the one in \texttt{BGFILE}, 
by reading \texttt{BGFILE} and using its contents as the background.  N.B., the
image must be a PNG graphic.

The \texttt{image} command also defines a few colors (see \texttt{colordef} below):
\texttt{black}, \texttt{white} and \texttt{transparent}, sets the current color to
\texttt{black}, fills the image with \texttt{white} and sets the \texttt{linewidth} to 1.

\subsection{colordef }%
\index{colordef }

[It can also be spelled \texttt{colourdef}.]

This defines a new colour and names it.  The command looks like:

\begin{verbatim}%
	colordef COLORNAME RED GREEN BLUE\end{verbatim}

where \texttt{RED}, \texttt{GREEN} and \texttt{BLUE} specify the level of each of those colours
to be mixed to define the colour referred to in the script as \texttt{COLORNAME}.

\subsection{color }%
\index{color }

[It can also be spelled \texttt{colour}.]

This sets the current colour, to be used by those commands that don't specify 
a colour.  It is used as simply:

\begin{verbatim}%
	color COLORNAME\end{verbatim}

\subsection{linewidth }%
\index{linewidth }

This sets the width of lines.  It isn't honoured by all other commands,
unfortunately, but so far this hasn't been a problem for me.  It looks like:

\begin{verbatim}%
	linewidth WIDTH\end{verbatim}

\subsection{line }%
\index{line }

This just draws a line in the current \texttt{color} and \texttt{linewidth}:

\begin{verbatim}%
	line X1 Y1 X2 Y2\end{verbatim}

\subsection{rectangle }%
\index{rectangle }

This is a way to draw a rectangle, without useing \texttt{line} 4 times:

\begin{verbatim}%
	rectangle X1 Y1 X2 Y2 [filled]\end{verbatim}

The co-ordinates (\texttt{X1}, \texttt{Y1}) and (\texttt{X2}, \texttt{Y2}) define oposite corners
of the rectangle.  If the keyword \texttt{filled} is added to the end, the 
rectangle will be filled with the current colour as well.

\subsection{circle }%
\index{circle }

Here you get a circle:

\begin{verbatim}%
	circle X Y RADIUS [filled]\end{verbatim}

The circle will be centered on (\texttt{X}, \texttt{Y}) with a radius of \texttt{RADIUS}.
If the keyword \texttt{filled} is added to the end, the 
circle will be filled with the current colour as well.

\subsection{fill }%
\index{fill }

This command permits you to fill arbitrary regions:

\begin{verbatim}%
	fill X Y [COLORNAME]\end{verbatim}

The \texttt{COLORNAME} is optional.

\subsection{text }%
\index{text }

The \texttt{text} command sets text into the image, for labelling things:

\begin{verbatim}%
	text X Y TEXT\end{verbatim}

\subsection{font }%
\index{font }

This changes the font for the \texttt{text} command:

\begin{verbatim}%
	font (giant|large|mediumbold|medium|small|tiny)\end{verbatim}

\subsection{out }%
\index{out }

This permits the script to output additional information to an auxiliary
file.  I added this for doing image-maps automatically, which can be
automatically loaded by a datapage.cgi (see the datapage.cgi section)  web-page.

The syntax is:

\begin{verbatim}%
	out TEXT\end{verbatim}

\subsection{flow }%
\index{flow }

This draws a strange double-headed, bi-coloured arrow.  Think of it as two
half arrows, split lengthwise, one in each direction.  The colour and width
of each half arrow indicates the flow in that direction.  I use it for
indicating network traffic flow, which usually isn't the same in both 
directions.  It looks like:

\begin{verbatim}%
	flow X1 Y1 X2 Y2 INFLOW OUTFLOW\end{verbatim}

The co-ordinates (\texttt{X1}, \texttt{Y1}), (\texttt{X2}, \texttt{Y2}) indicate the ends of the 
flow.  \texttt{INFLOW} and \texttt{OUTFLOW} indicate the level in each direction,
relative to (\texttt{X1}, \texttt{Y1}).
%------------------------------------ datapage-cgi.pod ---

\section{datapage.cgi - dynamic data in web-pages}%
\index{datapage.cgi - dynamic data in web-pages}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
	$<$A HREF="http://remstats.sourceworks.com:1954/datapage.cgi?pagename"$>$whatever$<$/A$>$\end{verbatim}

\subsection{Data Collection}%
\index{Data Collection}

\texttt{Datapage.cgi} looks for the page definition in the file 
\texttt{@@DATAPAGEDIR@@/pagename.page} The page definition is in two parts, 
separated by a line like:

\begin{verbatim}%
	BEGIN-PAGE\end{verbatim}

The first part's purpose is to define variables to be included in the 
second part, which is an HTML template, with magic cookies.

All lines in the first or definition part are subject to variable interpolation.
Any ocurrance of \texttt{\$\{variablename\}} will be replaced by the current
contents of the variable \texttt{variablename}.  This will be done up to
five levels, permitting expansion of \$\{\$\{h\}\_\$\{interface\}\}, providing that
you've got values for the variables \texttt{h} and \texttt{interface}.
N.B. variable names must be lower case.

In addition, within a macro expansion, macro-arguments will also be
interpolated, before variable interpolation, for all ocurrances of
\texttt{\$\{ARGNAME\}}, assuming that there is an argument for the 
current macro called \texttt{ARGNAME}.  N.B. macro argument names must 
be UPPER case.

\subsection{Common Commands}%
\index{Common Commands}

The commands permitted in the first part are:

\begin{verbatim}%
	oid, rrd, status, eval, debug, macro, macroend,
	alertstatus, alertvalue and *EOD*\end{verbatim}

These commands are in common with the dataimage.cgi (see the dataimage.cgi section) 
script, but are only documented here.

\begin{itemize}


\item oid 
This fetches an SNMP value into a datapage variable.  The command looks like:

\begin{verbatim}%
	oid VARNAME HOSTNAME OIDNAME\end{verbatim}

The \texttt{VARNAME} is the name of the datapage variable (let's just call 
them variables from now on).

The \texttt{HOSTNAME} is the name of the host
to query.  The SNMP community-string is usually supplied in
that host's config-file, but can be supplied in usual MRTG fashion by
giving \texttt{COMMUNITY@HOSTNAME} or even \texttt{COMMUNITY@HOSTNAME:PORTNUMBER}
instead of the \texttt{HOSTNAME}.

The \texttt{OIDNAME} must be defined in the
oids config-file (see the oids config-file section) , but can be suffixed by the usual
numbers.  E.G. you can use ifName.4 to get the ifName for interface 4.


\item rrd 
This fetches a value from an RRD database into a variable.  It looks like:

\begin{verbatim}%
	rrd VARNAME HOSTNAME RRDNAME DSNAME CF\end{verbatim}

The \texttt{RRDNAME} is the name of the rrd, as remstats knows it, not fully
qualified.  I.E. it will be under the config-file defined \texttt{datadir},
and under the host's directory under that.

The \texttt{DSNAME} is the ds-name within that RRD file and the \texttt{CF}
is the usual RRD consolidation-function to be applied.


\item status 
This is so-named because it fetches remstats status files, usually written
by the various collectors (see the collectors section)  and monitors (see the monitors section) .  It looks like:

\begin{verbatim}%
	status VARNAME HOSTNAME STATUSNAME\end{verbatim}

The \texttt{STATUSNAME} is the name of the status file, as named in the
host's data directory.  There is a standard mapping applied by the
function \texttt{to\_filename} from the \texttt{remstats.pl$<$/t} file to 
munge the filename so that it won't conflict with the filesystem.  Either
look for the name in the data directory, use the function (see eval) or
look at the code.  I \textbf{am} planning on changing the mapping when I
figure out the best way to do it.


\item eval 
The eval command lets you modify the values fetched by previous \texttt{oid},
\texttt{rrd}, \texttt{status} and \texttt{eval} commands with arbitrary perl code.  
It looks like:

\begin{verbatim}%
	eval VARNAME PERLEXPRESSION\end{verbatim}

The \texttt{PERLEXPRESSION} is a perl expression and can be arbitrarily complex, 
but gets messy quickly with the \texttt{datapage.cgi} and perl both doing variable
interpolation.

Note: \texttt{datapage.cgi} uses private.pl (see the private.pl section) , so you can include commonly
used functions here to make your datapage creation easier.


\item debug 
The \texttt{debug} command takes a number which is the level to set debugging to.
It causes extra output which may be helpful in figuring out why your page
isn't working the way you expected.


\item alertstatus 
This lets you fetch the alert level for a given (host, rrd, dsname, cf)
combination.  The command looks like:

\begin{verbatim}%
	alertstatus VARNAME HOSTNAME RRDNAME DSNAME [CF]\end{verbatim}

This will fetch the alert status and put it in the datapage variable \texttt{VARNAME}.
The status will be the same set of values shown on the alerts report (see the alerts report section) 
for status.
The \texttt{CF} parameter is optional and is rrdtool's consolidation function.
It will be set to \texttt{AVERAGE} if it's not supplied.


\item alertvalue 
This is the same as \texttt{alertstatus} except that it sets the variable to the
current value of the (host, rrd, variable, cf) combination.


\end{itemize}
\subsection{The HTML template}%
\index{The HTML template}

This is almost just HTML with a few magic cookies inserted.  The difference is
that the beginning must include HTTP headers.  If you don't want anything
fancy, just begin like:

\begin{verbatim}%
	------ cut here ------
	BEGIN-PAGE
	content-type: text/html\end{verbatim}

\begin{verbatim}%
	------ cut here ------\end{verbatim}

Note: the empty line after \texttt{content-type:} is \textbf{not} optional.  It's
necessary to end the HTTP headers.

The magic cookies are:

\begin{itemize}


\item $<$DATAPAGE::STATUS host statusfile$>$
inserts a specified status file


\item $<$DATAPAGE::VAR varname$>$
interpolates the value of a datapage variable


\item $<$DATAPAGE::HEADER title$>$
generates a standard remstats header


\item $<$DATAPAGE::STATUSHEADER hostname$>$
generates the status headers for the named host


\item $<$DATAPAGE::TOOLBAR hostname$>$
generates the toolbar for the named host


\item $<$DATAPAGE::FOOTER$>$ 
generates a standard remstats footer


\item $<$DATAPAGE::INCLUDE filename$>$
include the contents of a file from the datapage directory, for imagemaps ...


\item $<$DATAPAGE::PATHINCLUDE filename-with-path$>$
include contents of a file specified with a complete path


\item $<$DATAPAGE::MACRO macroname [argvalue] ...$>$
include boilerplate HTML with substitutions


\item $<$DATAPAGE::GRAPH host rrd graph time$>$
generate the specified remstats graph


\item $<$DATAPAGE::CUSTOMGRAPH graph time$>$
generate the specified remstats customgraph


\item $<$DATAPAGE::ERRORS$>$ 
inserts the text of errors encountered in generating the page.  Without
this one, you won't see any errors.  That way you include the errors and
debugging output (see next item), which you're creating/debugging the 
datapage and afterwards turn them off.  The errors and debugging output
may include information you don't want to reveal to outsiders.  Also,
collecting all the error output together avoids spoiling the formatting
of the page.


\item $<$DATAPAGE::DEBUG$>$ 
inserts debugging output.  Without it, you won't see any debugging output.


\end{itemize}%------------------------------------ graph-cgi.pod ---

\section{graph.cgi - exporting remstats graphs}%
\index{graph.cgi - exporting remstats graphs}

The purpose of \texttt{graph.cgi} is to allow remstats graphs
to appear on external (not part of remstats) web-pages.
It's \textbf{not} efficient, with the graphs being generated whenever
the page is reloaded, but it is portable.  All you do is to
create an $<$IMG SRC...$>$ tag with the appropriate values, like:

\begin{verbatim}%
	$<$IMG SRC="http://remstats.sourceworks.com:1954/graph.cgi?host=aaa\&rrd=bbb\&graph=ccc\&graphtime=ddd"$>$\end{verbatim}

and replace \texttt{aaa} with the name of the host, as remstats knows it, \texttt{bbb}
with the name of the RRD, \texttt{ccc} with the name of the graph within that RRD,
and \texttt{ddd} with the name of the timespan, from the 
times config-file (see the times config-file section) .  If the RRD is a wildcard RRD, e.g. 
\texttt{snmpif-*}, then you must use the specific instance, e.g. \texttt{snmpif-eth0}.

That's all there is to it.
%------------------------------------ log-event-cgi.pod ---

\section{log-event.cgi - log events from a web-page}%
\index{log-event.cgi - log events from a web-page}

This shows up on the showlog.cgi (see the showlog.cgi section)  as a link to permit
you to manually enter events into the log.  Don't feel
obliged to enter all the fields.  The data isn't checked
for meaning, just for syntax.  In other words, a host-name
must look like a host-name, but it doesn't have to be a 
real host-name.

This cgi-script ought to be protected.  See the 
web-server installation (see the web-server installation section)  docs.
%------------------------------------ ping-cgi.pod ---

\section{ping.cgi }%
\index{ping.cgi }

The \texttt{ping.cgi} script allows you to ping a host.  It's intended to be
called off a host's toolbar, but that's not required.  Simply provide
the hostname or IP number and it'll ping it.  

As an example, you could ping ftp.uu.net with a URL like:

\begin{verbatim}%
	http://remstats.sourceworks.com:1954/ping.cgi?host=ftp.uu.net (see \textbf{http://remstats.sourceworks.com:1954/ping.cgi?host=ftp.uu.net})\end{verbatim}
%------------------------------------ showlog-cgi.pod ---

\section{showlog.cgi }%
\index{showlog.cgi }

Any alert is also logged to the remstats log files (one file per day).  Other
information is also logged, for example, the topology-monitor (see the topology-monitor section)  logs network
topology changes.  The \texttt{showlog.cgi} script allows you to display selected
portions of the log files, by time-period, by host, ...
%------------------------------------ traceroute-cgi.pod ---

\section{traceroute.cgi }%
\index{traceroute.cgi }

This script uses traceroute (see the traceroute section)  to find the path from the remstats host to 
some other specified host.  It's intended to be called off a host's
toolbar, but that's not required. For example, you could trace the path from
here (trevelyan.sourceworks.com) to ftp.uu.net with a URL like:

\begin{verbatim}%
	http://remstats.sourceworks.com:1954/traceroute.cgi?host=ftp.uu.net (see the http://remstats.sourceworks.com:1954/traceroute.cgi?host=ftp.uu.net section) \end{verbatim}

There are other options that you can specify:

\begin{itemize}


\item \texttt{no\_names} - just shows IP numbers instead of looking up the domain-names

\item \texttt{ASNs} - look up the Autonomous System Numbers (ASNs) for the IP number of each hop.  It
can be useful for figuring out which networks you are traversing.

\item \texttt{owners} - look up the "owner" via SOA records

\item \texttt{fast} - continues on to the next hop as soon as the current one answers

\end{itemize}%------------------------------------ whois-cgi.pod ---

\section{whois.cgi }%
\index{whois.cgi }

This script talks to the ARIN whois database (by default) to look up network
names, IP numbers and AS numbers.  It's usually linked into the results of
traceroute.cgi (see the traceroute.cgi section)  so that you can look up what your
traceroute results actually mean.

Try \texttt{traceroute.cgi} if you want to see how it works.
%------------------------------------ do-traceroutes.pod ---

\chapter{do-traceroutes}
\index{do-traceroutes}

\section{do-traceroutes - find the path to each host}%
\index{do-traceroutes - find the path to each host}

This runs traceroute against each host being monitored.  After
they've all finished, it runs the topology-monitor (see the topology-monitor section) .  

I'm planning to make graphical representations of how you are
connected to the hosts you're monitoring, but that's not working yet.
%------------------------------------ traceroute.pod ---

\section{traceroute }%
\index{traceroute }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
2.9.2tee0.0: Usage: traceroute [-adnruvAMOQ] [-w wait] [-S start_ttl] [-m max_ttl] [-p port#] [-q nqueries] [-g gateway] [-t tos] [-s src_addr] [-g router] host [data size]
      -a: Abort after 10 consecutive drops
      -d: Socket level debugging
      -g: Use this gateway as an intermediate hop (uses LSRR)
      -S: Set start TTL (default 1)
      -m: Set maximum TTL (default 30)
      -n: Report IP addresses only (not hostnames)
      -p: Use an alternate UDP port
      -q: Set the number of queries at each TTL (default 3)
      -r: Set Dont Route option
      -s: Set your source address
      -t: Set the IP TOS field (default 0)
      -u: Use microsecond timestamps
      -v: Verbose
      -w: Set timeout for replies (default 5 sec)
      -A: Report AS# at each hop (from GRR)
      -M: Do RFC1191 path MTU discovery
      -O: Report owner at each hop (from DNS)
      -P: Parallel probing
      -Q: Report delay statistics at each hop (min/avg+-stddev/max) (ms)
      -T: Terminator (line end terminator)
      -U: Go to next hop on any success
\end{verbatim}

\subsection{Description: }%
\index{Description: }

Hmm.  I think that describes its use pretty well.  What does it do?  
Oh.  Well it sends UDP packets with the time-to-live set to 1, then 2 
then 3 and so on.  This causes the routers that these packets are sent 
through to complain after the requisite number of hops.  I.E. the first router 
complains about the first packets, with TTL set to one, the second about 
the packets with TTL set to two etc.  Traceroute catches the complaints 
and times how long it took.  This not only shows you how your packets 
are getting to the destination, but sometimes, where the congestion
is as well.  There's a lots better explanation in the source, so 
if you want more, 
UTSL (see \textbf{http://www.tuxedo.org/\~{}esr/jargon/html/entry/UTSL.html}).

This version of traceroute is used in traceroute.cgi (see the traceroute.cgi section) ,
which isn't required,
just handy on occasion, and in do-traceroute (see the do-traceroute section) , which you don't need unless
you're curious about your routing and how it's changing over time.  The only
extra options that do-traceroute uses are the \texttt{-A} option to look up the
ASN (Autonomous System Number) and the \texttt{-O} option to look up the DNS owner.
%------------------------------------ misc.pod ---

\chapter{Miscellany}
\index{Miscellany}

\section{Miscellaneous Scripts}%
\index{Miscellaneous Scripts}

These are scripts that don't really fit in anywhere.

\begin{itemize}


\item availability-report (see the availability-report section)  shows availability of RRD variables

\item genindex (see the genindex section)  makes an index

\item genmenu (see the genmenu section)  makes the vertical menu-bars used in these docs.

\item htmlpod (see the htmlpod section)  makes pod files from html files (roughly).

\item podhtml (see the podhtml section)  makes html files from pod files.

\item podlatex (see the podlatex section)  makes LaTeX files from pod files.

\item podpdf (see the podpdf section)  makes PDF files from pod files.

\item rrd-report (see the rrd-report section)  produces reports from a raw rrd.

\end{itemize}
These are release-related scripts:

\begin{itemize}


\item convert-config-links (see the convert-config-links section)  - copies links to files (just read it)

\end{itemize}%------------------------------------ availability-report.pod ---

\section{availability-report }%
\index{availability-report }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
availability-report version 1.19
usage: availability-report [options]
where options are:
    -c      use colors in the output
    -d ddd  set debugging output to level 'ddd'
    -f fff  set config-dir to 'fff' [/home/remstats/etc/config]
    -h      show this help
    -H HHH  show only hosts HHH (comma-separated list) [all]
    -G GGG  show only groups GGG (comma-separated list) [all]
    -R RRR  show only rrds RRR (comma-separated list) [all]
    -g      show group summary
    -t ttt  availability for time-period ttt (start,finish)
\end{verbatim}

\subsection{Description: }%
\index{Description: }

This is mainly intended to be called from 
availability-report.cgi (see the availability-report.cgi section) .  It provided
a report on "availability" of specified RRD variables, by default, all
that have definitions in the availability (see the availability section) 
config-file.  Exactly what it means for a variable to be "available"
is up to you.  It's intended to give some measure of when a host or
service isn't useable, so, e.g. the default definition of availability
for the \texttt{ping} RRD variable \texttt{rcvd} (number of ping responses received)
is:

\begin{verbatim}%
	ping rcvd MINIMUM $>$ 0\end{verbatim}

In english, the \texttt{rcvd} variable is considered unavailable if:

\begin{verbatim}%
	- it is less than or equal to zero (I.E. it didn't respond to ping)
	- there is no data available for that time period\end{verbatim}

\textbf{N.B.:} The interaction between rrd archive consolidation and the xff value,
(see rrdcreate), can result in longer periods of unavailability or conversely,
masking periods of unavailability.  Choose the consolidation function carefully
to make sure you're getting the best data possible.
%------------------------------------ cleanup.pod ---

\section{cleanup - removes stale, old files}%
\index{cleanup - removes stale, old files}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
cleanup version 1.4
usage: ../cleanup [options]
where options are:
    -d nnn  enable debugging output at level 'nnn'
    -f fff  use 'fff' for config-dir [/home/remstats/etc/config]
    -h      show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

It removes old collector data from /home/remstats/data/LAST, old logs from 
/home/remstats/data/LOGS, old traceroute data from /home/remstats/data/TRACEROUTES
and old images from all the host subdirectories of /home/remstats/html.

Run it out of cron every now and then, say once a day, with a line
like:

\begin{verbatim}%
	0 2 * * * /home/remstats/bin/cleanup\end{verbatim}
%------------------------------------ convert-config-links.pod ---

\section{convert-config-links }%
\index{convert-config-links }

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
usage: ../convert-config-links [-h]
\end{verbatim}

\subsection{Description: }%
\index{Description: }

The problem is that an upgrade installation of remstats will overwrite the config-base
directory, but previous installations of remstats created new configuration directories
as symlinks to config-base.  Some of these files need to be changed and some are commonly
changed, specificly:

\begin{verbatim}%
	alerts alert-destination-map general html links tools\end{verbatim}

Installing a new version of remstats will overwrite config-base, including these files.

\texttt{convert-config-links} is a conversion tool for upgrading from remstats versions
before 1.0A.  It will convert the commonly changed config-files from symlinks to
copies of the appropriate files from config-base.  In remstats versions after 1.0A
the new-config (see the new-config section)  program will "Do the Right Thing" (TM) and make copies by itself,
so you'll only have to run this once.

If you're installing remstats for the first time, you can ignore this program.
%------------------------------------ genindex.pod ---

\section{genindex - make an index from output of podhtml}%
\index{genindex - make an index from output of podhtml}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
genindex version 1.4
usage: genindex [options] file ...
where options are:
	-d	enable debugging output
	-f fff  use 'fff' format for output (html, pod or text)[pod]
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

\texttt{genindex} reads the index output of podhtml (see the podhtml section)  and builds a crude index.
It's mainly for using your browser's \texttt{find} command on and it's not pretty.
Show me something simple and better and I'll use it.
%------------------------------------ genmenu.pod ---

\section{genmenu - generate a collapsing menu}%
\index{genmenu - generate a collapsing menu}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
genmenu version 1.5
usage: ../genmenu [options] pagename menufile
where options are:
	-d	enable debugging output
	-h	show this help
\end{verbatim}

\subsection{Description: }%
\index{Description: }

\texttt{genmenu} reads the menu description file and generates a vertical
menu-bar, collapsed according to which pagename you gave it.  This
requires all the documentation to be rebuilt whenever you change the
menu definition, but avoids having to use JavaScript.  

I couldn't find a simple stand-alone program that did this, so here you are.
It doesn't require remstats.

\subsection{The Menu Definition File}%
\index{The Menu Definition File}

The file has a simple format.  Blank lines and lines beginning with '\#'
are ignored.  The other lines look like:

\begin{verbatim}%
	[tabs]pagename [page title]\end{verbatim}

The number of \texttt{tabs} shows the level of sub-menus, making the definition
file easy to grasp at a glance.  Note that the \texttt{tabs} are actual tab characters.
The \texttt{page title} (optional) is what shows up in the menu, while the 
\texttt{pagename} is used to make the URL to link to.  If the page name is 
\texttt{xyz}, then a link to \texttt{xyz.html} is produced.  If the \texttt{page title} is missing,
then the \texttt{pagename} is used instead.
%------------------------------------ htmlpod.pod ---

\section{podhtml - convert HTML to POD}%
\index{podhtml - convert HTML to POD}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
	htmlpod htmlfile $>$podfile\end{verbatim}

\subsection{Description: }%
\index{Description: }

Quick and Dirty.

I only wrote it to do the first cut for converting my old html-based
documentation to pod format.  It's by no means complete or even
correct.  However, it did convert over 90\% of the HTML markup that
I was using.

Use it if you want, but don't complain about it without providing a
patch to fix your complaint.
%------------------------------------ podhtml.pod ---

\section{podhtml - translate a POD file to HTML}%
\index{podhtml - translate a POD file to HTML}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
podhtml version 1.5
usage: podhtml [options] podfile
where options are:
	-d ddd  enable debugging output
	-h      show this help
	-s sss  use 'sss' as the suffix for html files [.html]
	-u uuu  use 'uuu' as a URL prefix
\end{verbatim}

\subsection{Description: }%
\index{Description: }

See the docs for \texttt{pod2html}.  The only changes that I made
intentionally from how \texttt{pod2html} does things are:

\begin{itemize}


\item if a line looks blank it's treated as blank.  I prefer
to avoid surprises.

\item I added a new \texttt{=exec} which executes a command line and
inserts the output of stdout into the resulting HTML as a $<$PRE$>$
section.  This was so that I could get the latest usage message
from programs inserted without having to run each program separately,
save its output in a file, and manually insert the file into 
the POD file.

\item I also caused it to append to a file called \texttt{podhtml--rawindex}
for each =head1 and =head2, a URL for that page and section and the
contents of that =headN.  This is used by genindex (see the genindex section)  to make an index.

\end{itemize}
I wrote this version in frustration with the way pod2html does
links.  Or doesn't.  I could never tell without trying whether
it would generate a link or not.
%------------------------------------ podlatex.pod ---

\section{podlatex - translate a POD file to LaTeX}%
\index{podlatex - translate a POD file to LaTeX}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
podlatex version 1.4
usage: podlatex [options] podfile
where options are:
	-d ddd  enable debugging output
	-h      show this help
	-s sss  use 'sss' as the suffix for html files [.html]
	-u uuu  use 'uuu' as a URL prefix
\end{verbatim}

\subsection{Description: }%
\index{Description: }

See the docs for \texttt{pod2latex}.  The only changes that I made
intentionally from how \texttt{pod2latex} does things are:

\begin{itemize}


\item if a line looks blank it's treated as blank.  I prefer
to avoid surprises.

\item I added a new \texttt{=exec} which executes a command line and
inserts the output of stdout into the resulting HTML as a $<$PRE$>$
section.  This was so that I could get the latest usage message
from programs inserted without having to run each program separately,
save its output in a file, and manually insert the file into 
the POD file.

\item I changed the text wrapping links.

\end{itemize}
I wrote this version in frustration with the way pod2latex does
links.
%------------------------------------ podpdf.pod ---

\section{podpdf - translate a POD file to pdf}%
\index{podpdf - translate a POD file to pdf}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%

	../podpdf 
	[ --help --verbose <1|2 --paper <usletter> --podfile <file> ] <file>
	
	--help
	    displays this explanation of correct usage
	    
	--vebose <1|2>
	    regulates the volume of progress comments: argument must be 1 or 2
	    
	--podfile <file>
	    supplies the input file to process as an explicit parameter. The
	    input file may also be supplied from STDIN or from the command
	    line as the array element --paper.
	    
	Further information can be found in the POD section of Pod.pm. Enter:
	    perl -e "use Pod::Pdf; pod2pdf('<your_library_path>/Pod/Pdf.pm')"
	to get the POD in PDF format :)

	\end{verbatim}

\subsection{Description: }%
\index{Description: }

See the docs for \texttt{Pod::PDF}.  This is only a tiny wrapper for it.
%------------------------------------ rrd-report.pod ---

\section{rrd-report - display summaries of an RRD file}%
\index{rrd-report - display summaries of an RRD file}

\subsection{Usage: }%
\index{Usage: }

\begin{verbatim}%
rrd-report version 1.6
usage: rrd-report [options] rrd-file
where options are:
	-b bbb	begin at time 'bbb' (see Note 3)
	-c ccc  select data from consolidation-function 'ccc' [AVERAGE]
	-d ddd  enable debugging output at level 'ddd'
	-D DDD  show the dates as 'DDD' [both,pretty]
			(none|both|start|finish),(raw|simple|pretty)
	-e eee  end at time 'eee' (see Note 3)
	-f fff  use report format 'fff' [simple]
			(from 'simple', 'label', 'html')
	-h      show this help
	-i iii  report on intervals 'iii' (see Note 2) [1d]
	-l      list the DS names in this rrd, no report
	-n nnn  use 'nnn' as the format to print the numbers [%lf]
	-s sss  summary on interval 'sss' (see Note 2) [1w]
	-v vvv  show variables 'vvv' (var:cf comma-separated) [ALL]
Note: if report interval (-i) and summary interval (-s) are equal,
  no summary reporting is done.
Note 2: intervals are numbers of seconds, minutes, hours, days, weeks, Months
  or years.  E.G. "4w" for 4 weeks, "1M" for one month.
Note 3: Begin and End times are a unix timestamp (seconds since Jan 1, 1970) or
  plus-or-minus an interval, as in Note 2.  E.G. "-1w" means "one week ago".
\end{verbatim}

\subsection{Examples: }%
\index{Examples: }

I hope that the above is enough to use it after seeing a few examples.
Here's the equivalent of the command that created the RRD for the example.

rrdtool create ping.rrd $\backslash$
	DS:sent:GAUGE:600:0:10 $\backslash$
	DS:rcvd:GAUGE:600:0:10 $\backslash$
	DS:min:GAUGE:600:U:U $\backslash$
	DS:avg:GAUGE:600:U:U $\backslash$
	DS:max:GAUGE:600:U:U $\backslash$
	RRA:AVERAGE:0.1:1:600 $\backslash$
	RRA:AVERAGE:0.1:7:300 $\backslash$
	RRA:AVERAGE:0.1:30:300 $\backslash$
	RRA:AVERAGE:0.1:90:300 $\backslash$
	RRA:AVERAGE:0.1:365:300 $\backslash$
	RRA:MIN:0.1:1:600 $\backslash$
	RRA:MIN:0.1:7:300 $\backslash$
	RRA:MIN:0.1:30:300 $\backslash$
	RRA:MIN:0.1:90:300 $\backslash$
	RRA:MIN:0.1:365:300 $\backslash$
	RRA:MAX:0.1:1:600 $\backslash$
	RRA:MAX:0.1:7:300 $\backslash$
	RRA:MAX:0.1:30:300 $\backslash$
	RRA:MAX:0.1:90:300 $\backslash$
	RRA:MAX:0.1:365:300

See "man rrdcreate" for an explanation for the command itself.  The
fields are:

\begin{itemize}


\item sent/rcvd - number of ping packets sent/received

\item min/avg/max - the round-trip-time (min, average and max) for the pings

\end{itemize}
Here's a default report from one of my ping RRDs:

\begin{verbatim}%
	\%rrd-report ping.rrd
	[snip]
	data 1999-10-25 17:20:49 1999-10-26 17:20:49 10.000000 10.000000 10.000000 9.864444 9.899444 9.934444 41.569556 42.210222 42.850889 45.626889 45.758833 45.890778 50.955111 51.253056 51.551000
	data 1999-10-26 17:20:49 1999-10-27 17:20:49 10.000000 10.000000 10.000000 9.934444 9.987819 10.000000 39.536556 41.498103 46.124938 42.166222 45.386889 49.370000 50.955111 52.435532 54.635926
	summary 1999-10-19 17:20:49 1999-10-26 17:20:49 10.000000 10.000000 10.000000 9.331111 9.932391 10.000000 38.317778 42.750146 48.318444 41.500556 46.736223 50.265778 49.122444 52.261605 59.867778
	[snip]
	data 1999-11-17 16:20:49 1999-11-18 16:20:49 10.000000 10.000000 10.000000 8.000000 9.934245 10.000000 36.400000 46.585421 50.000000 41.256667 49.592941 58.640000 49.036667 53.837716 117.240000
	summary 1999-11-16 16:20:49 1999-11-18 16:20:49 10.000000 10.000000 10.000000 9.142857 9.929788 10.000000 38.285714 46.482773 50.000000 47.148095 49.503659 51.294286 50.000000 53.124615 65.880952
	overall 1999-10-19 17:20:49 1999-11-18 16:20:49 9.978889 9.999918 10.000000 1.323333 9.876767 10.000000 6.194333 45.631272 76.394778 6.516556 48.842746 107.286556 6.971111 54.319770 179.554222\end{verbatim}

Each "data" line is a report for the interval covered by the two 
timestamps, (by default one day).  The values are the requested 
(or in this case all) DS:CF combinations. The "summary" lines are 
just reports over a longer interval (by default one week).
The "overall" line is for the whole selected time-period.

Hmm.  There's much too much there.  What I'd really like to see is 
just the interesting stuff.  I know how many pings I'm sending 
during this period (10), so drop that and just show the minimum min
average avg and maximum max:

\begin{verbatim}%
	\% rrd-report -v rcvd:AVERAGE,min:MIN,avg:AVERAGE,max:MAX
	data 1999-10-19 17:54:57 1999-10-20 17:54:57 9.820267 38.317778 43.948411 55.716667
	data 1999-10-20 17:54:57 1999-10-21 17:54:57 9.966716 39.303333 46.180111 59.867778
	data 1999-10-21 17:54:57 1999-10-22 17:54:57 9.907440 40.469000 48.496274 56.022222
	data 1999-10-22 17:54:57 1999-10-23 17:54:57 9.977827 40.232333 47.571133 54.475062
	[snip]
	summary 1999-11-09 16:54:57 1999-11-16 16:54:57 9.950836 39.310056 52.578943 179.554222
	data 1999-11-17 16:54:57 1999-11-18 16:54:57 9.934164 36.400000 49.606736 117.240000
	summary 1999-11-16 16:54:57 1999-11-18 16:54:57 9.928672 38.285714 49.489729 65.880952
	overall 1999-10-19 17:54:57 1999-11-18 16:54:57 9.876767 6.194333 48.842746 179.554222\end{verbatim}

Well, I can figure out when the period ended, so leave out the end-time, and
I don't like seeing all those meaningless (in this case) decimal places, so
how about:

\begin{verbatim}%
	\% rrd-report -D start,pretty -n \%.1lf -v rcvd:AVERAGE,min:MIN,avg:AVERAGE,max:MAX
	[snip]
	data 1999-11-14 17:27:04 10.0 40.0 49.4 88.7
	data 1999-11-15 17:27:04 9.7 21.7 48.0 63.4
	data 1999-11-16 17:27:04 9.9 38.3 49.4 61.3
	summary 1999-11-09 17:27:04 10.0 39.3 52.6 179.6
	data 1999-11-17 17:27:04 9.9 36.4 49.6 117.2
	summary 1999-11-16 17:27:04 9.9 38.3 49.5 65.9
	overall 1999-10-19 18:27:04 9.9 6.2 48.8 179.6\end{verbatim}

OK.  I'd like to see the last year with a one-week interval, with no summaries.
(Setting the report-interval to the same as the summary-interval 
drops summaries.  You still get an overall line.)

\begin{verbatim}%
	\% rrd-report -D start,pretty -n \%.1lf -v rcvd:AVERAGE,min:MIN,avg:AVERAGE,ma
	x:MAX -i 1w -s 1w
	data 1998-11-19 09:04:43 NODATA NODATA NODATA NODATA
	[snip]
	data 1999-02-25 09:04:43 9.9 45.0 55.0 64.2
	data 1999-03-04 09:04:43 10.0 43.9 54.5 64.3
	[snip]
	data 1999-11-11 09:04:43 10.0 39.3 51.7 179.6
	data 1999-11-18 09:04:43 9.9 37.4 49.7 169.7
	overall 1998-11-19 09:04:43 9.6 0.0 45.3 103.7\end{verbatim}

And for those of us who like to see it on the web:
[You'll just have to look in the web version of this documentation
to see what it looks like.]
%------------------------------------ thanks.pod ---

\chapter{Thank-you's}
\index{Thank-you's}

\section{Thank-you's }%
\index{Thank-you's }

\begin{itemize}


\item Tobias Oetiker
- for MRTG and RRDtool


\item Larry Wall and the rest of the perl hackers 
- for making perl into the "swiss-army-chainsaw" of programming languages


\item Vikas Aggarwal
- for multiping from NOCOL, so pinging doesn't take forever


\item Ehud Gavron and others
- for the NANOG (see \textbf{http://www.nanog.org/}) traceroute.


\item Will Maton
- numerous suggestions and encouragement


\item Adam Kennedy
- initial pre-release testing


\item Ken Filipps
- suggestion to brand remstats port-probes


\item Andrew Cochran
- for Telnet.pm open error

- for non interface-MIB interfaces suggestion, e.g. frame-relay


\item Marek Snowarski
- for installation and documentation feedback


\item Matt Duggan
- for suggestions (views and description magic-cookies)


\item Steve Francis
- for suggestions and installation feedback


\item Alexander Reelsen
- for suggesting that the df-* rrd shouldn't use K-btytes

- for the masqueraded connection count code


\item Jon Villarreal 
-for pointing out the error in alert time selection


\end{itemize}
I've probably forgotten some others.  Please remind me if I've forgotten 
your contribution.

\printindex{default}
\end{document}