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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>Running the application</TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<CENTER>
<A HREF="http://www.erlang.se"><IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif"></A>
</CENTER>
<A NAME="5"><!-- Empty --></A>
<H2>5 Running the application</H2>
<P>The chapter <STRONG>Running the application</STRONG> describes how the
application is configured and started.
The topics include:
<P>
<UL>
<LI>
configuration directories and parameters
</LI>
<LI>
modifying the configuration files
</LI>
<LI>
starting the application (agent and/or manager)
</LI>
<LI>
debugging the application (agent and/or manager)
</LI>
</UL>
<P>Refer also to the chapter(s)
<A HREF="snmp_agent_config_files.html">Definition of Agent
Configuration Files</A> and
<A HREF="snmp_manager_config_files.html">Definition of Manager
Configuration Files</A> which contains more detailed information
about the agent and manager configuration files.<A NAME="configuration_params"><!-- Empty --></A><A NAME="5.1"><!-- Empty --></A>
<H3>5.1 Configuring the application</H3>
<P>The following two directories must exist in the system
to run the agent:
<P>
<UL>
<LI>
the <STRONG>configuration directory</STRONG> stores all
configuration files used by the agent (refer to the chapter
<A HREF="snmp_agent_config_files.html">Definition of Agent
Configuration Files</A> for more information).
</LI>
<LI>
the <STRONG>database directory</STRONG> stores the internal
database files.
</LI>
</UL>
<P>The following directory must exist in the system
to run the manager:
<P>
<UL>
<LI>
the <STRONG>configuration directory</STRONG> stores all
configuration files used by the manager (refer to the chapter
<A HREF="snmp_manager_config_files.html">Definition of Manager
Configuration Files</A> for more information).
</LI>
<LI>
the <STRONG>database directory</STRONG> stores the internal
database files.
</LI>
</UL>
<P>The agent and manager uses (application) configuration parameters to
find out where these directories are located. The parameters should be
defined in an Erlang system configuration file. The following
configuration parameters are defined for the SNMP application:
<P>
<DL>
<DT>
<CODE>agent = [agent_opt()]</CODE>
</DT>
<DD>
<CODE>agent_opt() = {restart_type, restart_type()} |
{agent_type, agent_type()} |
{agent_verbosity, verbosity()} |
{versions, versions()} |
{priority, priority()} |
{multi_threaded, multi_threaded()} |
{db_dir, db_dir()} |
{db_init_error, db_init_error()} |
{local_db, local_db()} |
{net_if, agent_net_if()} |
{mibs, mibs()} |
{mib_storage, mib_storage()} |
{mib_server, mib_server()} |
{audit_trail_log, audit_trail_log()} |
{error_report_mod, error_report_mod()} |
{note_store, note_store()} |
{symbolic_store, symbolic_store()} |
{config, agent_config()}</CODE><BR>
The SNMP agent specific options.<BR>
</DD>
<DT>
<CODE>manager = [manager_opt()]</CODE>
</DT>
<DD>
<CODE>manager_opt() = {restart_type, restart_type()} |
{net_if, manager_net_if()} |
{server, server()} |
{note_store, note_store()} |
{config, manager_config()} |
{inform_request_behaviour, manager_irb()} |
{mibs, manager_mibs()} |
{priority, priority()} |
{audit_trail_log, audit_trail_log()} |
{versions, versions() |
{def_user_module, def_user_module() |
{def_user_data, def_user_data()}
</CODE><BR>
The SNMP manager specific options.<BR>
</DD>
</DL>
<P>Agent specific config options and types:
<P>
<DL>
<DT>
<CODE>agent_type() = master | sub <optional></CODE>
</DT>
<DD>
If <CODE>master</CODE>, one master agent is
started. Otherwise, no agents are started. <BR>
Default is <CODE>master</CODE>.<BR>
</DD>
<DT>
<CODE>multi_threaded() = bool() <optional></CODE>
</DT>
<DD>
If <CODE>true</CODE>, the agent is multi-threaded, with one
thread for each get request. <BR>
Default is <CODE>false</CODE>.<BR>
</DD>
<DT>
<CODE>db_dir() = string() <mandatory></CODE>
</DT>
<DD>
Defines where the SNMP agent internal db files are stored.<BR>
</DD>
<DT>
<CODE>local_db() = [local_db_opt()] <optional></CODE>
</DT>
<DD>
<CODE>local_db_opt() = {repair, agent_repair()} |
{auto_save, agent_auto_save()} |
{verbosity, verbosity()}</CODE><BR>
Defines options specific for the SNMP agent local database.<BR>
For defaults see the options in <CODE>local_db_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>agent_repair() = false | true | force <optional></CODE>
</DT>
<DD>
When starting snmpa_local_db it always tries to open an
existing database. If <CODE>false</CODE>, and some errors occur, a new
database is created instead. If <CODE>true</CODE>, an existing file
will be repaired. If <CODE>force</CODE>, the table will be repaired
even if it was properly closed. <BR>
Default is <CODE>true</CODE>.<BR>
</DD>
<DT>
<CODE>agent_auto_save() = integer() | infinity <optional></CODE>
</DT>
<DD>
The auto save interval. The table is fluched to disk
whenever not accessed for this amount of time.<BR>
Default is <CODE>5000</CODE>.<BR>
</DD>
<DT>
<CODE>agent_net_if() = [agent_net_if_opt()] <optional></CODE>
</DT>
<DD>
<CODE>agent_net_if_opt() = {module, agent_net_if_module()} |
{verbosity, verbosity()} |
{options, agent_net_if_options()}</CODE><BR>
Defines options specific for the SNMP agent network interface
entity. <BR>
For defaults see the options in <CODE>agent_net_if_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>agent_net_if_module() = atom() <optional></CODE>
</DT>
<DD>
Module which handles the network interface part for the
SNMP agent. Must implement the
<A HREF="snmpa_network_interface.html">snmpa_network_interface
</A> behaviour.<BR>
Default is <CODE>snmpa_net_if</CODE>.<BR>
</DD>
<DT>
<CODE>agent_net_if_options() = [agent_net_if_option()] <optional></CODE>
</DT>
<DD>
<CODE>agent_net_if_option() = {bind_to, bind_to()} |
{sndbuf, sndbuf()} |
{recbuf, recbuf()} |
{no_reuse, no_reuse()} |
{req_limit, req_limit()}</CODE><BR>
These options are actually specific to the used module.
The ones shown here are applicable to the default
<CODE>agent_net_if_module()</CODE>.<BR>
For defaults see the options in <CODE>agent_net_if_option()</CODE>.<BR>
</DD>
<DT>
<CODE>req_limit() = integer() | infinity <optional></CODE>
</DT>
<DD>
Max number of simultanious requests handled by the agent.<BR>
Default is <CODE>infinity</CODE>.<BR>
</DD>
<DT>
<CODE>agent_mibs() = [string()] <optional></CODE>
</DT>
<DD>
Specifies a list of MIBs (including path) that defines which MIBs
are initially loaded into the SNMP master agent. <BR>
Note that the following will allways be loaded:<BR>
<UL>
<LI>
version v1: <CODE>STANDARD-MIB</CODE>
</LI>
<LI>
version v2: <CODE>SNMPv2</CODE>
</LI>
<LI>
version v3: <CODE>SNMPv2</CODE>, <CODE>SNMP-FRAMEWORK-MIB</CODE>
and <CODE>SNMP-MPD-MIB</CODE>
</LI>
</UL>
Default is <CODE>[]</CODE>.<BR>
</DD>
<DT>
<CODE>mib_storage() = ets | {ets, Dir} | {ets, Dir, Action} | dets | {dets, Dir} | {dets, Dir, Action} | mnesia | {mnesia, Nodes} | {mnesia, Nodes, Action} <optional></CODE>
</DT>
<DD>
Specifies how info retrieved from the mibs will be stored.<BR>
If <CODE>mib_storage</CODE> is <CODE>{ets, Dir}</CODE>, the table will also be
stored on file. If <CODE>Dir</CODE> is <CODE>default</CODE>, then <CODE>db_dir</CODE>
will be used.<BR>
If <CODE>mib_storage</CODE> is <CODE>dets</CODE> or if <CODE>Dir</CODE> is
<CODE>default</CODE>, then <CODE>db_dir</CODE> will be used for <CODE>Dir</CODE>.<BR>
If <CODE>mib_storage</CODE> is <CODE>mnesia</CODE> then <CODE>erlang:nodes()</CODE>
will be used for <CODE>Nodes</CODE>.<BR>
Default is <CODE>ets</CODE>. <BR>
<CODE>Dir = default | string()</CODE>. Dir is the directory where the
files will be stored. If <CODE>default</CODE>, then <CODE>db_dir</CODE> will be
used.<BR>
<CODE>Nodes = visible | connected | [node()]</CODE>.
<CODE>Nodes = visible</CODE> is translated to
<CODE>erlang:nodes(visible)</CODE>.
<CODE>Nodes = connected</CODE> is translated to
<CODE>erlang:nodes(connected)</CODE>.
If <CODE>Nodes = []</CODE> then the own node is assumed.<BR>
<CODE>Action = clear | keep</CODE>. Default is <CODE>keep</CODE>.
<CODE>Action</CODE> is used to specify what shall be done if the
mnesia/dets table already exist.<BR>
</DD>
<DT>
<CODE>mib_server() = [mib_server_opt()] <optional></CODE>
</DT>
<DD>
<CODE>mib_server_opt() = {mibentry_override, mibentry_override()} |
{trapentry_override, trapentry_override()} |
{verbosity, verbosity()}</CODE><BR>
Defines options specific for the SNMP agent mib server. <BR>
For defaults see the options in <CODE>mib_server_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>mibentry_override() = bool() <optional></CODE>
</DT>
<DD>
If this value is false, then when loading a mib each mib-
entry is checked prior to installation of the mib.
The perpose of the check is to prevent that the same symbolic
mibentry name is used for different oid's.<BR>
Default is <CODE>false</CODE>.<BR>
</DD>
<DT>
<CODE>trapentry_override() = bool() <optional></CODE>
</DT>
<DD>
If this value is false, then when loading a mib each trap
is checked prior to installation of the mib.
The perpose of the check is to prevent that the same symbolic
trap name is used for different trap's.<BR>
Default is <CODE>false</CODE>.<BR>
</DD>
<DT>
<CODE>error_report_mod() = atom() <optional></CODE>
</DT>
<DD>
Defines an error report module, implementing the
<A HREF="snmpa_error_report.html">snmpa_error_report</A>
behaviour. Two modules are provided with the toolkit:
<CODE>snmpa_error_logger</CODE> and <CODE>snmpa_error_io</CODE>.<BR>
Default is <CODE>snmpa_error_logger</CODE>.<BR>
</DD>
<DT>
<CODE>symbolic_store() = [symbolic_store_opt()]</CODE>
</DT>
<DD>
<CODE>symbolic_store_opt() = {verbosity, verbosity()}</CODE><BR>
Defines options specific for the SNMP agent symbolic store. <BR>
For defaults see the options in <CODE>symbolic_store_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>agent_config() = [agent_config_opt()] <mandatory></CODE>
</DT>
<DD>
<CODE>agent_config_opt() = {dir, agent_config_dir()} |
{force_load, force_load()} | {verbosity, verbosity()}</CODE><BR>
Defines specific config related options for the SNMP agent. <BR>
For defaults see the options in <CODE>agent_config_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>agent_config_dir = dir() <mandatory></CODE>
</DT>
<DD>
Defines where the SNMP agent configuration files are stored.<BR>
</DD>
<DT>
<CODE>force_load() = bool() <optional></CODE>
</DT>
<DD>
If <CODE>true</CODE> the configuration files are re-read
during startup, and the contents of the configuration
database ignored. Thus, if <CODE>true</CODE>, changes to
the configuration database are lost upon reboot of the
agent. <BR>
Default is <CODE>false</CODE>.<BR>
</DD>
</DL>
<P>Manager specific config options and types:
<P>
<DL>
<DT>
<CODE>server() = [server_opt()] <optional></CODE>
</DT>
<DD>
<CODE>server_opt() = {timeout, server_timeout()} |
{verbosity, verbosity()}</CODE><BR>
Specifies the options for the manager server process.<BR>
Default is <CODE>silence</CODE>.<BR>
</DD>
<DT>
<CODE>server_timeout() = integer() <optional></CODE>
</DT>
<DD>
Asynchroneous request cleanup time. For every requests,
some info is stored internally, in order to be able to
deliver the reply (when it arrives) to the proper destination.
If the reply arrives, this info will be deleted. But if
there is no relpy (in time), the info has to be deleted
after the <STRONG>best before</STRONG> time has been passed.
This cleanup will be performed at regular intervals, defined
by the <CODE>server_timeout()</CODE> time.
The information will have a <STRONG>best before</STRONG> time,
defined by the <CODE>Expire</CODE> time given when calling the
request function (see <A HREF="snmpm.html#ag">ag</A>,
<A HREF="snmpm.html#agn">agn</A> and
<A HREF="snmpm.html#as">as</A>).<BR>
Time in milli-seconds.<BR>
Default is <CODE>30000</CODE>.<BR>
</DD>
<DT>
<CODE>manager_config() = [manager_config_opt()] <mandatory></CODE>
</DT>
<DD>
<CODE>manager_config_opt() = {dir, manager_config_dir()} |
{db_dir, manager_db_dir()} |
{db_init_error, db_init_error()} |
{repair, manager_repair()} |
{auto_save, manager_auto_save()} |
{verbosity, verbosity()}</CODE><BR>
Defines specific config related options for the SNMP manager. <BR>
For defaults see the options in <CODE>manager_config_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>manager_config_dir = dir() <mandatory></CODE>
</DT>
<DD>
Defines where the SNMP manager configuration files are stored.<BR>
</DD>
<DT>
<CODE>manager_db_dir = dir() <mandatory></CODE>
</DT>
<DD>
Defines where the SNMP manager store persistent data.<BR>
</DD>
<DT>
<CODE>manager_repair() = false | true | force <optional></CODE>
</DT>
<DD>
Defines the repair option for the persistent database (if
and how the table is repaired when opened). <BR>
Default is <CODE>true</CODE>.<BR>
</DD>
<DT>
<CODE>manager_auto_save() = integer() | infinity <optional></CODE>
</DT>
<DD>
The auto save interval. The table is fluched to disk
whenever not accessed for this amount of time.<BR>
Default is <CODE>5000</CODE>.<BR>
</DD>
<DT>
<CODE>manager_irb() = auto | user | {user, integer()} <optional></CODE>
</DT>
<DD>
This option defines how the manager will handle the sending of
response (acknowledgement) to received inform-requests.
<BR>
<UL>
<LI>
<CODE>auto</CODE> - The manager will autonomously send response
(acknowledgement> to inform-request messages.<BR>
</LI>
<LI>
<CODE>{user, integer()}</CODE> - The manager will send response
(acknowledgement) to inform-request messages when the
<A HREF="snmpm_user.html#handle_inform">handle_inform</A>
function completes. The integer is the time, in milli-seconds,
that the manager will consider the stored inform-request info
valid.<BR>
</LI>
<LI>
<CODE>user</CODE> - Same as <CODE>{user, integer()}</CODE>, except that
the default time, 15000 milli-seconds, is used.<BR>
</LI>
</UL>
See
<A HREF="snmpm_network_interface.html">snmpm_network_interface
</A>,
<A HREF="snmpm_user.html">handle_inform</A> and
<A HREF="snmp_manager_netif.html">definition of the manager net if
</A> for more info.<BR>
Default is <CODE>auto</CODE>.<BR>
</DD>
<DT>
<CODE>manager_mibs() = [string()] <optional></CODE>
</DT>
<DD>
Specifies a list of MIBs (including path) and defines which MIBs
are initially loaded into the SNMP manager. <BR>
Default is <CODE>[]</CODE>.<BR>
</DD>
<DT>
<CODE>manager_net_if() = [manager_net_if_opt()] <optional></CODE>
</DT>
<DD>
<CODE>manager_net_if_opt() = {module, manager_net_if_module()} |
{verbosity, verbosity()} |
{options, manager_net_if_options()}
</CODE><BR>
Defines options specific for the SNMP manager network interface
entity. <BR>
For defaults see the options in <CODE>manager_net_if_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>manager_net_if_options() = [manager_net_if_option()] <optional></CODE>
</DT>
<DD>
<CODE>manager_net_if_option() = {bind_to, bind_to()} |
{sndbuf, sndbuf()} |
{recbuf, recbuf()} |
{no_reuse, no_reuse()}
</CODE><BR>
These options are actually specific to the used module.
The ones shown here are applicable to the default
<CODE>manager_net_if_module()</CODE>.<BR>
For defaults see the options in <CODE>manager_net_if_option()</CODE>.<BR>
</DD>
<DT>
<CODE>manager_net_if_module() = atom() <optional></CODE>
</DT>
<DD>
Module which handles the network interface part for the
SNMP manager. Must implement the
<A HREF="snmpm_network_interface.html">snmpm_network_interface
</A> behaviour.<BR>
Default is <CODE>snmpm_net_if</CODE>.<BR>
</DD>
<DT>
<CODE>def_user_module() = atom() <optional></CODE>
</DT>
<DD>
The module implementing the default user. See the
<A HREF="snmpm_user.html">snmpm_user
</A> behaviour.<BR>
Default is <CODE>snmpm_user_default</CODE>.<BR>
</DD>
<DT>
<CODE>def_user_data() = term() <optional></CODE>
</DT>
<DD>
Data for the default user. Passed to the user when calling
the callback functions.<BR>
Default is <CODE>undefined</CODE>.<BR>
</DD>
</DL>
<P>Common config types:
<P>
<DL>
<DT>
<CODE>restart_type() = permanent | transient | temporary</CODE>
</DT>
<DD>
See <A HREF="javascript:erlhref('../../../../', 'stdlib', 'supervisor.html#child_spec');">supervisor</A>
documentaion for more info.<BR>
Default is <CODE>permanent</CODE> for the agent and <CODE>transient</CODE>
for the manager.<BR>
</DD>
<DT>
<CODE>db_init_error() = terminate | create</CODE>
</DT>
<DD>
Defines what to do if the agent is unable to open an
existing database file. <CODE>terminate</CODE> means that the
agent/manager will terminate and <CODE>create</CODE> means that the
agent/manager will remove the faulty file(s) and create new ones.<BR>
Default is <CODE>terminate</CODE>.<BR>
</DD>
<DT>
<CODE>priority() = atom() <optional></CODE>
</DT>
<DD>
Defines the Erlang priority for all SNMP processes.<BR>
Default is <CODE>normal</CODE>.<BR>
</DD>
<DT>
<CODE>versions() = [version()] <optional></CODE>
</DT>
<DD>
<CODE>version() = v1 | v2 | v3</CODE><BR>
Which SNMP versions shall be accepted/used.<BR>
Default is <CODE>[v1,v2,v3]</CODE>.<BR>
</DD>
<DT>
<CODE>verbosity() = silence | info | log | debug | trace <optional></CODE>
</DT>
<DD>
Verbosity for a SNMP process. This specifies now much debug info
is printed.<BR>
Default is <CODE>silence</CODE>.<BR>
</DD>
<DT>
<CODE>bind_to() = bool() <optional></CODE>
</DT>
<DD>
If <CODE>true</CODE>, net_if binds to the IP adress.
If <CODE>false</CODE>, net_if listens on any IP address on the host
where it is running. <BR>
Default is <CODE>false</CODE>.<BR>
</DD>
<DT>
<CODE>no_reuse() = bool() <optional></CODE>
</DT>
<DD>
If <CODE>true</CODE>, net_if does not specify that the IP
and port address should be reusable. If <CODE>false</CODE>,
the address is set to reusable. <BR>
Default is <CODE>false</CODE>.<BR>
</DD>
<DT>
<CODE>recbuf() = integer() <optional></CODE>
</DT>
<DD>
Receive buffer size. <BR>
Default value is defined by <CODE>gen_udp</CODE>.<BR>
</DD>
<DT>
<CODE>sndbuf() = integer() <optional></CODE>
</DT>
<DD>
Send buffer size. <BR>
Default value is defined by <CODE>gen_udp</CODE>.<BR>
</DD>
<DT>
<CODE>note_store() = [note_store_opt()] <optional></CODE>
</DT>
<DD>
<CODE>note_store_opt() = {timeout, note_store_timeout()} |
{verbosity, verbosity()}</CODE><BR>
Specifies the options for the SNMP note store.<BR>
For defaults see the options in <CODE>note_store_opt()</CODE>.<BR>
</DD>
<DT>
<CODE>note_store_timeout() = integer() <optional></CODE>
</DT>
<DD>
Note cleanup time. When storing a note in the note store,
each note is given lifetime. Every <CODE>timeout</CODE> the note_store
process performs a GC to remove the expired note's. Time in
milli-seconds.<BR>
Default is <CODE>30000</CODE>.<BR>
</DD>
<DT>
<CODE>audit_trail_log() [audit_trail_log_opt()] <optional></CODE>
</DT>
<DD>
<CODE>audit_trail_log_opt() = {type, atl_type()} |
{dir, atl_dir()} |
{size, atl_size()} |
{repair, atl_repair()}
</CODE><BR>
If present, this option specifies the options for the
<STRONG>audit trail logging</STRONG>. The <CODE>disk_log</CODE> module is used
to maintain a wrap log. If present, the <CODE>dir</CODE> and
<CODE>size</CODE> options are mandatory.<BR>
If not present, audit trail logging is not used.<BR>
</DD>
<DT>
<CODE>atl_type() = read | write | read_write <optional></CODE>
</DT>
<DD>
Specifies what type of an audit trail log should be used.
The effect of the type is actually different for the the agent
and the manager. <BR>
For the agent:<BR>
<UL>
<LI>
If <CODE>write</CODE> is specified, only set requests are logged.
</LI>
<LI>
If <CODE>read</CODE> is specified, only get requests are logged.
</LI>
<LI>
If <CODE>read_write</CODE>, all requests are logged.
</LI>
</UL>
For the manager:
<BR>
<UL>
<LI>
If <CODE>write</CODE> is specified, only sent messages are logged.
</LI>
<LI>
If <CODE>read</CODE> is specified, only received messages are logged.
</LI>
<LI>
If <CODE>read_write</CODE>, both outgoing and incomming messages are
logged.
</LI>
</UL>
Default is <CODE>read_write</CODE>.<BR>
</DD>
<DT>
<CODE>atl_dir = dir() <mandatory></CODE>
</DT>
<DD>
Specifies where the audit trail log should be stored.<BR>
If <CODE>audit_trail_log</CODE> specifies that logging should take
place, this parameter <STRONG>must</STRONG> be defined.<BR>
</DD>
<DT>
<CODE>atl_size() = {integer(), integer()} <mandatory></CODE>
</DT>
<DD>
Specifies the size of the audit
trail log. This parameter is sent to <CODE>disk_log</CODE>. <BR>
If <CODE>audit_trail_log</CODE> specifies that logging should
take place, this parameter <STRONG>must</STRONG> be defined.<BR>
</DD>
<DT>
<CODE>atl_repair() = true | false | truncate | snmp_repair <optional></CODE>
</DT>
<DD>
Specifies if and how the audit trail log shall be repaired
when opened. Unless this parameter has the value <CODE>snmp_repair</CODE>
it is sent to <CODE>disk_log</CODE>. If, on the other hand, the value is
<CODE>snmp_repair</CODE>, snmp attempts to handle certain faults on it's
own. And even if it cannot repair the file, it does not truncate it
directly, but instead <STRONG>moves it aside</STRONG> for later off-line
analysis.<BR>
Default is <CODE>true</CODE>.<BR>
</DD>
</DL>
<A NAME="5.2"><!-- Empty --></A>
<H3>5.2 Modifying the Configuration Files</H3>
<P>To to start the application (agent and/or manager), the
configuration files must be modified and there are two ways
of doing this. Either edit the files manually, or run the
configuration tool as follows.
<P>If authentication or encryption is used (SNMPv3 only), start
the <CODE>crypto</CODE> application.
<PRE>
1> snmp:config().
Simple SNMP configuration tool (version 4.0)
------------------------------------------------
Note: Non-trivial configurations still has to be
done manually. IP addresses may be entered
as dront.ericsson.se (UNIX only) or
123.12.13.23
------------------------------------------------
Configure an agent (y/n)? [y]
Agent system config:
--------------------
1. Agent process priority (low/normal/high) [normal]
2. What SNMP version(s) should be used (1,2,3,1&2,1&2&3,2&3)? [3] 1&2&3
3. Configuration directory (absolute path)? [/ldisk/snmp] /ldisk/snmp/agent/conf
4. Config verbosity (silence/info/log/debug/trace)? [silence]
5. Database directory (absolute path)? [/ldisk/snmp] /ldisk/snmp/agent/db
6. Mib storage type (ets/dets/mnesia)? [ets]
7. Symbolic store verbosity (silence/info/log/debug/trace)? [silence]
8. Local DB verbosity (silence/info/log/debug/trace)? [silence]
9. Local DB repair (true/false/force)? [true]
10. Local DB auto save (infinity/milli seconds)? [5000]
11. Error report module? [snmpa_error_logger]
12. Agent type (master/sub)? [master]
13. Master-agent verbosity (silence/info/log/debug/trace)? [silence] log
14. Shall the agent re-read the configuration files during startup
(and ignore the configuration database) (true/false)? [true]
15. Multi threaded agent (true/false)? [false] true
16. Check for duplicate mib entries when installing a mib (true/false)? [false]
17. Check for duplicate trap names when installing a mib (true/false)? [false]
18. Mib server verbosity (silence/info/log/debug/trace)? [silence]
19. Note store verbosity (silence/info/log/debug/trace)? [silence]
20. Note store GC timeout? [30000]
21. Shall the agent use an audit trail log (y/n)? [n] y
21b. Audit trail log type (write/read_write)? [read_write]
21c. Where to store the audit trail log? [/ldisk/snmp] /ldisk/snmp/agent/log
21d. Max number of files? [10]
21e. Max size (in bytes) of each file? [10240]
21f. Audit trail log repair (true/false/truncate)? [true]
22. Which network interface module shall be used? [snmpa_net_if]
23. Network interface verbosity (silence/info/log/debug/trace)? [silence] log
24. Bind the agent IP address (true/false)? [false]
25. Shall the agents IP address and port be not reusable (true/false)? [false]
26. Agent request limit (used for flow control) (infinity/pos integer)? [infinity] 32
27. Receive buffer size of the agent (in bytes) (default/pos integer)? [default]
Agent snmp config:
------------------
1. System name (sysName standard variable) [bmk's agent]
2. Engine ID (snmpEngineID standard variable) [bmk's engine]
3. Max message size? [484]
4. The UDP port the agent listens to. (standard 161) [4000]
5. IP address for the agent (only used as id
when sending traps) [127.0.0.1]
6. IP address for the manager (only this manager
will have access to the agent, traps are sent
to this one) [127.0.0.1]
7. To what UDP port at the manager should traps
be sent (standard 162)? [5000]
8. Do you want a none- minimum- or semi-secure configuration?
Note that if you chose v1 or v2, you won't get any security for these
requests (none, minimum, semi_des, semi_aes) [minimum]
making sure crypto server is started...
8b. Give a password of at least length 8. It is used to generate
private keys for the configuration: kalle-anka
9. Current configuration files will now be overwritten. Ok (y/n)? [y]
- - - - - - - - - - - - -
Info: 1. SecurityName "initial" has noAuthNoPriv read access
and authenticated write access to the "restricted"
subtree.
2. SecurityName "all-rights" has noAuthNoPriv read/write
access to the "internet" subtree.
3. Standard traps are sent to the manager.
4. Community "public" is mapped to security name "initial".
5. Community "all-rights" is mapped to security name "all-rights".
The following agent files were written: agent.conf, community.conf,
standard.conf, target_addr.conf, target_params.conf,
notify.conf, vacm.conf and usm.conf
- - - - - - - - - - - - -
Configure a manager (y/n)? [y]
Manager system config:
----------------------
1. Manager process priority (low/normal/high) [normal]
2. What SNMP version(s) should be used (1,2,3,1&2,1&2&3,2&3)? [3] 1&2&3
3. Configuration directory (absolute path)? [/ldisk/snmp] /ldisk/snmp/manager/conf
4. Config verbosity (silence/info/log/debug/trace)? [silence] log
5. Database directory (absolute path)? [/ldisk/snmp] /ldisk/snmp/manager/db
6. Database repair (true/false/force)? [true]
7. Database auto save (infinity/milli seconds)? [5000]
8. Server verbosity (silence/info/log/debug/trace)? [silence] log
9. Server GC timeout? [30000]
10. Note store verbosity (silence/info/log/debug/trace)? [silence]
11. Note store GC timeout? [30000]
12. Which network interface module shall be used? [snmpm_net_if]
13. Network interface verbosity (silence/info/log/debug/trace)? [silence] log
14. Bind the manager IP address (true/false)? [false]
15. Shall the manager IP address and port be not reusable (true/false)? [false]
16. Receive buffer size of the manager (in bytes) (default/pos integer)? [default]
17. Shall the manager use an audit trail log (y/n)? [n] y
17b. Where to store the audit trail log? [/ldisk/snmp] /ldisk/snmp/manager/log
17c. Max number of files? [10]
17d. Max size (in bytes) of each file? [10240]
17e. Audit trail log repair (true/false/truncate)? [true]
18. Do you wish to assign a default user [yes] or use
the default settings [no] (y/n)? [n]
Manager snmp config:
--------------------
1. Engine ID (snmpEngineID standard variable) [bmk's engine]
2. Max message size? [484]
3. IP address for the manager (only used as id
when sending requests) [127.0.0.1]
4. Port number (standard 162)? [5000]
5. Configure a user of this manager (y/n)? [y]
5b. User id? kalle
5c. User callback module? snmpm_user_default
5d. User (callback) data? [undefined]
5. Configure a user of this manager (y/n)? [y] n
6. Configure an agent handled by this manager (y/n)? [y]
6b. User id? kalle
6c. Target name? [bmk's agent]
6d. Version (1/2/3)? [1] 3
6e. Community string ? [public]
6f. Engine ID (snmpEngineID standard variable) [bmk's engine]
6g. IP address for the agent [127.0.0.1]
6h. The UDP port the agent listens to. (standard 161) [4000]
6i. Retransmission timeout (infinity/pos integer)? [infinity]
6j. Max message size? [484]
6k. Security model (any/v1/v2c/usm)? [any] usm
6l. Security name? ["initial"]
6m. Security level (noAuthNoPriv/authNoPriv/authPriv)? [noAuthNoPriv] authPriv
6. Configure an agent handled by this manager (y/n)? [y] n
7. Configure an usm user handled by this manager (y/n)? [y]
7a. Engine ID [bmk's engine]
7b. User name? hobbes
7c. Security name? [hobbes]
7d. Authentication protocol (no/sha/md5)? [no] sha
7e Authentication [sha] key (length 0 or 20)? [""] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
7d. Priv protocol (no/des/aes)? [no] des
7f Priv [des] key (length 0 or 16)? [""] 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
7. Configure an usm user handled by this manager (y/n)? [y] n
8. Current configuration files will now be overwritten. Ok (y/n)? [y]
- - - - - - - - - - - - -
The following manager files were written: manager.conf, agents.conf , users.conf and usm.conf
- - - - - - - - - - - - -
--------------------
Configuration directory for system file (absolute path)? [/ldisk/snmp]
ok
</PRE>
<A NAME="5.3"><!-- Empty --></A>
<H3>5.3 Starting the application</H3>
<P>Start Erlang with the command:
<PRE>
erl -config /tmp/snmp/sys
</PRE>
<P>If authentication or encryption is used (SNMPv3 only), start
the <CODE>crypto</CODE> application. If this step is forgotten, the
agent will not start, but report a
<CODE>{config_error,{unsupported_crypto,_}}</CODE> error.
<PRE>
1> <STRONG>application:start(crypto).</STRONG>
ok
</PRE>
<PRE>
2> <STRONG>application:start(snmp).</STRONG>
ok
</PRE>
<A NAME="verbosity"><!-- Empty --></A><A NAME="5.4"><!-- Empty --></A>
<H3>5.4 Debugging the application</H3>
<P>It is possible to debug every (non-supervisor) process of the
application (both agent and manager), possibly with the exception
of the net_if module(s), which could be supplied by a user of the
application). This is done by calling the
<CODE>snmpa:verbosity/2</CODE> and <CODE>snmpm:verbosity/2</CODE> function(s)
and/or using
<A HREF="#configuration_params"> configuration parameters</A>.
The verbosity itself has several <STRONG>levels</STRONG>: <CODE>silence | info |
log | debug | trace</CODE>. For the lowest verbosity <CODE>silence</CODE>,
nothing is printed. The higher the verbosity, the more is printed.
Default value is always <CODE>silence</CODE>.
<PRE>
3> <STRONG>snmpa:verbosity(master_agent, log).</STRONG>
ok
5> <STRONG>snmpa:verbosity(net_if, log).</STRONG>
ok
6>
%% Example of output from the agent when a get-next-request arrives:
** SNMP NET-IF LOG:
got paket from {147,12,12,12}:5000
** SNMP NET-IF MPD LOG:
v1, community: all-rights
** SNMP NET-IF LOG:
got pdu from {147,12,12,12}:5000 {pdu, 'get-next-request',
62612569,noError,0,
[{varbind,[1,1],'NULL','NULL',1}]}
** SNMP MASTER-AGENT LOG:
apply: snmp_generic,variable_func,[get,{sysDescr,persistent}]
** SNMP MASTER-AGENT LOG:
returned: {value,"Erlang SNMP agent"}
** SNMP NET-IF LOG:
reply pdu: {pdu,'get-response',62612569,noError,0,
[{varbind,[1,3,6,1,2,1,1,1,0],
'OCTET STRING',
"Erlang SNMP agent",1}]}
** SNMP NET-IF INFO: time in agent: 19711 mysec
</PRE>
<P>Another useful function for debugging is
<CODE>snmpa_local_db:print/0,1,2</CODE>. For example, this function can
show the counters <CODE>snmpInPkts</CODE> and <CODE>snmpOutPkts</CODE>. Enter
the following command:
<PRE>
4> <STRONG>snmpa_local_db:print().</STRONG>
%% A lot of information.
</PRE>
<CENTER>
<HR>
<SMALL>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|