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
|
.TH snmpm 3 "snmp 4.11" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
snmpm \- Interface functions to the SNMP toolkit manager
.SH DESCRIPTION
.LP
The module \fIsnmpm\fR contains interface functions to the SNMP manager\&.
.SH COMMON DATA TYPES
.LP
The following data types are used in the functions below:
.RS 2
.TP 2
*
\fIoid() = [byte()]\fR
.RS 2
.LP
.LP
The \fIoid()\fR type is used to represent an ASN\&.1 OBJECT IDENTIFIER\&.
.RE
.TP 2
*
\fIsnmp_reply() = {error_status(), error_index(), varbinds()}\fR
.TP 2
*
\fIerror_status() = noError | atom()\fR
.TP 2
*
\fIerror_index() = integer()\fR
.TP 2
*
\fIvarbinds() = [varbind()]\fR
.TP 2
*
\fIatl_type() = read | write | read_write\fR
.RE
.SH EXPORTS
.LP
.B
monitor() -> Ref
.br
.RS
.TP
Types
Ref = reference()
.br
.RE
.RS
.LP
Monitor the SNMP manager\&. In case of a crash, the calling (monitoring) process will get a \&'DOWN\&' message (see the erlang module for more info)\&.
.RE
.LP
.B
demonitor(Ref) -> void()
.br
.RS
.TP
Types
Ref = reference()
.br
.RE
.RS
.LP
Turn off monitoring of the SNMP manager\&.
.RE
.LP
.B
notify_started(Timeout) -> Pid
.br
.RS
.TP
Types
Timeout = integer()
.br
Pid = pid()
.br
.RE
.RS
.LP
Request a notification (message) when the SNMP manager has started\&.
.LP
The \fITimeout\fR is the time the request is valid\&. The value has to be greater then zero\&.
.LP
The \fIPid\fR is the process handling the supervision of the SNMP manager start\&. When the manager has started a completion message will be sent to the client from this process: \fI{snmpm_started, Pid}\fR\&. If the SNMP manager was not started in time, a timeout message will be sent to the client: \fI{snmpm_start_timeout, Pid}\fR\&.
.LP
A client application that is dependent on the SNMP manager will use this function in order to be notified of when the manager has started\&. There are two situations when this is useful:
.RS 2
.TP 2
*
During the start of a system, when a client application \fIcould\fR start prior to the SNMP manager but is dependent upon it, and therefor has to wait for it to start\&.
.TP 2
*
When the SNMP manager has crashed, the dependent client application has to wait for the SNMP manager to be restarted before it can \fIreconnect\fR\&.
.RE
.LP
The function returns the pid() of a handler process, that does the supervision on behalf of the client application\&. Note that the client application is linked to this handler\&.
.LP
This function is used in conjunction with the monitor function\&.
.RE
.LP
.B
cancel_notify_started(Pid) -> void()
.br
.RS
.TP
Types
Pid = pid()
.br
.RE
.RS
.LP
Cancel a previous request to be notified of SNMP manager start\&.
.RE
.LP
.B
register_user(Id, Module, Data) -> ok | {error, Reason}
.br
.RS
.TP
Types
Id = term()
.br
Module = snmpm_user()
.br
Data = term()
.br
Reason = term()
.br
snmpm_user() = Module implementing the snmpm_user behaviour
.br
.RE
.RS
.LP
Register the manager entity (=user) responsible for specific agent(s)\&.
.LP
\fIModule\fR is the callback module (snmpm_user behaviour) which will be called whenever something happens (detected agent, incoming reply or incoming trap/notification)\&. Note that this could have already been done as a consequence of the node config\&. (see users\&.conf)\&.
.RE
.LP
.B
register_user_monitor(Id, Module, Data) -> ok | {error, Reason}
.br
.RS
.TP
Types
Id = term()
.br
Module = snmpm_user()
.br
Data = term()
.br
Reason = term()
.br
snmpm_user() = Module implementing the snmpm_user behaviour
.br
.RE
.RS
.LP
Register the monitored manager entity (=user) responsible for specific agent(s)\&.
.LP
The process performing the registration will be monitored\&. Which means that if that process should die, all agents registered by that user process will be unregistered\&. All outstanding requests will be canceled\&.
.LP
\fIModule\fR is the callback module (snmpm_user behaviour) which will be called whenever something happens (detected agent, incoming reply or incoming trap/notification)\&. Note that this could have already been done as a consequence of the node config\&. (see users\&.conf)\&.
.RE
.LP
.B
unregister_user(Id) -> ok | {error, Reason}
.br
.RS
.TP
Types
Id = term()
.br
.RE
.RS
.LP
Unregister the user\&.
.RE
.LP
.B
which_users() -> Users
.br
.RS
.TP
Types
Users = [UserId]
.br
UserId = term()
.br
.RE
.RS
.LP
Get a list of the identities of all registered users\&.
.RE
.LP
.B
register_agent(UserId, Addr) -> ok | {error, Reason}
.br
.B
register_agent(UserId, Addr, Port) -> ok | {error, Reason}
.br
.B
register_agent(UserId, Addr, Config) -> ok | {error, Reason}
.br
.B
register_agent(UserId, Addr, Port, Config) -> ok | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
Config = [agent_config()]
.br
agent_config() = {Item, Val}
.br
Item = target_name | community | engine_id | timeout | max_message_size | version | sec_model | sec_name | sec_level
.br
Val = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Explicitly instruct the manager to handle this agent, with \fIUserId\fR as the responsible user\&. Called to instruct the manager that this agent shall be handled\&. These functions is used when the user knows in advance which agents the manager shall handle\&. Note that there is an alternate way to do the same thing: Add the agent to the manager config files (see agents\&.conf)\&.
.LP
The type of \fIVal\fR depends on \fIItem\fR:
.LP
\fItarget_name = string() \fR
.br
\fIcommunity = string() \fR
.br
\fIengine_id = string() \fR
.br
\fItimeout = integer() | snmp_timer()\fR
.br
\fImax_message_size = integer()\fR
.br
\fIversion = v1 | v2 | v3 \fR
.br
\fIsec_model = any | v1 | v2c | usm \fR
.br
\fIsec_name = string() \fR
.br
\fIsec_level = noAuthNoPriv | authNoPriv | authPriv\fR
.LP
Note that if no \fIPort\fR is given, the agent default is used\&.
.RE
.LP
.B
unregister_agent(UserId, Addr) -> ok | {error, Reason}
.br
.B
unregister_agent(UserId, Addr, Port) -> ok | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
.RE
.RS
.LP
Unregister the agent\&.
.RE
.LP
.B
agent_info(Addr, Port, Item) -> {ok, Val} | {error, Reason}
.br
.RS
.TP
Types
Addr = ip_address()
.br
Port = integer()
.br
Item = atom()
.br
Reason = term()
.br
.RE
.RS
.LP
Retrieve agent config\&.
.RE
.LP
.B
update_agent_info(UserId, Addr, Port, Item, Val) -> ok | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
Item = atom()
.br
Val = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Update agent config\&.
.RE
.LP
.B
which_agents() -> Agents
.br
.B
which_agents(UserId) -> Agents
.br
.RS
.TP
Types
UserId = term()
.br
Agents = [{Addr, Port}]
.br
Addr = ip_address()
.br
Port = integer()
.br
.RE
.RS
.LP
Get a list of all registered agents or all agents registered by a specific user\&.
.RE
.LP
.B
register_usm_user(EngineID, UserName, Conf) -> ok | {error, Reason}
.br
.RS
.TP
Types
EngineID = string()
.br
UserName = string()
.br
Conf = [usm_config()]
.br
usm_config() = {Item, Val}
.br
Item = sec_name | auth | auth_key | priv | priv_key
.br
Val = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Explicitly instruct the manager to handle this USM user\&. Note that there is an alternate way to do the same thing: Add the usm user to the manager config files (see usm\&.conf)\&.
.LP
The type of \fIVal\fR depends on \fIItem\fR:
.LP
\fIsec_name = string(), \fR
.br
\fIauth = usmNoAuthProtocol | usmHMACMD5AuthProtocol | usmHMACSHAAuthProtocoltimeout\fR
.br
\fIauth_key = [integer()]\fR (length 16 if auth = usmHMACMD5AuthProtocol, length 20 if auth = usmHMACSHAAuthProtocol),
.br
\fIpriv = usmNoPrivProtocol | usmDESPrivProtocol | usmAesCfb128Protocol\fR,
.br
\fIpriv_key = [integer()]\fR (length is 16 if priv = usmDESPrivProtocol | usmAesCfb128Protocol)\&.
.RE
.LP
.B
unregister_usm_user(EngineID, UserName) -> ok | {error, Reason}
.br
.RS
.TP
Types
EngineID = string()
.br
UserName = string()
.br
Reason = term()
.br
.RE
.RS
.LP
Unregister this USM user\&.
.RE
.LP
.B
usm_user_info(EngineID, UserName, Item) -> {ok, Val} | {error, Reason}
.br
.RS
.TP
Types
EngineID = string()
.br
UsmName = string()
.br
Item = sec_name | auth | auth_key | priv | priv_key
.br
Reason = term()
.br
.RE
.RS
.LP
Retrieve usm user config\&.
.RE
.LP
.B
update_usm_user_info(EngineID, UserName, Item, Val) -> ok | {error, Reason}
.br
.RS
.TP
Types
EngineID = string()
.br
UsmName = string()
.br
Item = sec_name | auth | auth_key | priv | priv_key
.br
Val = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Update usm user config\&.
.RE
.LP
.B
which_usm_users() -> UsmUsers
.br
.RS
.TP
Types
UsmUsers = [{EngineID, UserName}]
.br
EngineID = string()
.br
UsmName = string()
.br
.RE
.RS
.LP
Get a list of all registered usm users\&.
.RE
.LP
.B
which_usm_users(EngineID) -> UsmUsers
.br
.RS
.TP
Types
UsmUsers = [UserName]
.br
UserName = string()
.br
.RE
.RS
.LP
Get a list of all registered usm users with engine-id \fIEngineID\fR\&.
.RE
.LP
.B
g(UserId, Addr, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, Port, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, Port, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, Port, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, Port, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
g(UserId, Addr, Port, ContextName, Oids, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
ContextName = string()
.br
Oids = [oid()]
.br
Timeout = integer()
.br
ExtraInfo = term()
.br
SnmpReply = snmp_reply()
.br
Remaining = integer()
.br
Reason = {send_failed, ReqId, R} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
.br
R = term()
.br
SecInfo = [sec_info()]
.br
sec_info() = {sec_tag(), ExpectedValue, ReceivedValue}
.br
sec_tag() = atom()
.br
ExpectedValue = ReceivedValue = term()
.br
SnmpInfo = term()
.br
.RE
.RS
.LP
Synchronous \fIget-request\fR\&.
.LP
\fIRemaining\fR is the remaining time of the given or default timeout time\&.
.LP
When \fIReason\fR is \fI{send_failed, \&.\&.\&.}\fR it means that the net_if process failed to send the message\&. This could happen because of any number of reasons, i\&.e\&. encoding error\&. \fIR\fR is the actual reason in this case\&.
.LP
\fIExtraInfo\fR is an opaque data structure passed on to the net-if process\&. The net-if process included in this application makes no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing\&.
.LP
For \fISnmpInfo\fR, see the user callback function handle_report\&.
.RE
.LP
.B
ag(UserId, Addr, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, Port, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, Port, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, Port, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, Port, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
ag(UserId, Addr, Port, ContextName, Oids, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
ContextName = string()
.br
Oids = [oid()]
.br
Expire = integer()
.br
ExtraInfo = term()
.br
ReqId = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Asynchronous \fIget-request\fR\&.
.LP
The reply, if it arrives, will be delivered to the user through a call to the snmpm_user callback function \fIhandle_pdu\fR\&.
.LP
The \fIExpire\fR time indicates for how long the request is valid (after which the manager is free to delete it)\&.
.LP
\fIExtraInfo\fR is an opaque data structure passed on to the net-if process\&. The net-if process included in this application makes no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing\&.
.RE
.LP
.B
gn(UserId, Addr, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, Port, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, Port, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, Port, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, Port, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gn(UserId, Addr, Port, ContextName, Oids, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
ContextName = string()
.br
Oids = [oid()]
.br
Timeout = integer()
.br
ExtraInfo = term()
.br
SnmpReply = snmp_reply()
.br
Remaining = integer()
.br
Reason = {send_failed, ReqId, R} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
.br
R = term()
.br
.RE
.RS
.LP
Synchronous \fIget-next-request\fR\&.
.LP
\fIRemaining\fR time of the given or default timeout time\&.
.LP
When \fIReason\fR is \fI{send_failed, \&.\&.\&.}\fR it means that the net_if process failed to send the message\&. This could happen because of any number of reasons, i\&.e\&. encoding error\&. \fIR\fR is the actual reason in this case\&.
.LP
\fIExtraInfo\fR is an opaque data structure passed on to the net-if process\&. The net-if process included in this application makes no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing\&.
.RE
.LP
.B
agn(UserId, Addr, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, Port, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, Port, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, Port, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, Port, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agn(UserId, Addr, Port, ContextName, Oids, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
ContextName = string()
.br
Oids = [oid()]
.br
Expire = integer()
.br
ExtraInfo = term()
.br
ReqId = integer()
.br
Reason = term()
.br
.RE
.RS
.LP
Asynchronous \fIget-next-request\fR\&.
.LP
The reply will be delivered to the user through a call to the snmpm_user callback function \fIhandle_pdu\fR\&.
.LP
The \fIExpire\fR time indicates for how long the request is valid (after which the manager is free to delete it)\&.
.RE
.LP
.B
s(UserId, Addr, VarsAndVals) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, Port, VarsAndVals) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, ContextName, VarsAndVals) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, VarsAndVals, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, Port, ContextName, VarsAndVals) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, Port, VarsAndVals, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, ContextName, VarsAndVals, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, Port, ContextName, VarsAndVals, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
s(UserId, Addr, Port, ContextName, VarsAndVals, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
ContextName = string()
.br
VarsAndVals = [var_and_val()]
.br
var_and_val() = {oid(), value_type(), value()} | {oid(), value()}
.br
value_type() = o (\&'OBJECT IDENTIFIER\&') | i (\&'INTEGER\&') | u (\&'Unsigned32\&') | g (\&'Unsigned32\&') | s (\&'OCTET SRING\&') | b (\&'BITS\&') | ip (\&'IpAddress\&') | op (\&'Opaque\&') | c32 (\&'Counter32\&') | c64 (\&'Counter64\&') | tt (\&'TimeTicks\&')
.br
value() = term()
.br
Timeout = integer()
.br
ExtraInfo = term()
.br
SnmpReply = snmp_reply()
.br
Remaining = integer()
.br
Reason = {send_failed, ReqId, R} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
.br
R = term()
.br
.RE
.RS
.LP
Synchronous \fIset-request\fR\&.
.LP
\fIRemaining\fR time of the given or default timeout time\&.
.LP
When \fIReason\fR is \fI{send_failed, \&.\&.\&.}\fR it means that the net_if process failed to send the message\&. This could happen because of any number of reasons, i\&.e\&. encoding error\&. \fIR\fR is the actual reason in this case\&.
.LP
When \fIvar_and_val()\fR is \fI{oid(), value()}\fR, the manager makes an educated guess based on the loaded mibs\&.
.LP
\fIExtraInfo\fR is an opaque data structure passed on to the net-if process\&. The net-if process included in this application makes no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing\&.
.RE
.LP
.B
as(UserId, Addr, VarsAndVals) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, Port, VarsAndVals) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, ContextName, VarsAndVals) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, VarsAndVals, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, Port, ContextName, VarsAndVals) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, Port, VarsAndVals, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, ContextName, VarsAndVals, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, Port, ContextName, VarsAndVals, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
as(UserId, Addr, Port, ContextName, VarsAndVals, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
VarsAndVals = [var_and_val()]
.br
var_and_val() = {oid(), value_type(), value() | {oid(), value()}
.br
value_type() = o (\&'OBJECT IDENTIFIER\&') | i (\&'INTEGER\&') | u (\&'Unsigned32\&') | g (\&'Unsigned32\&') | s (\&'OCTET SRING\&') | b (\&'BITS\&') | ip (\&'IpAddress\&') | op (\&'Opaque\&') | c32 (\&'Counter32\&') | c64 (\&'Counter64\&') | tt (\&'TimeTicks\&')
.br
value() = term()
.br
Expire = integer()
.br
ExtraInfo = term()
.br
ReqId = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Asynchronous \fIset-request\fR\&.
.LP
The reply will be delivered to the user through a call to the snmpm_user callback function \fIhandle_pdu\fR\&.
.LP
The \fIExpire\fR time indicates for how long the request is valid (after which the manager is free to delete it)\&.
.LP
When \fIvar_and_val()\fR is \fI{oid(), value()}\fR, the manager makes an educated guess based on the loaded mibs\&.
.LP
\fIExtraInfo\fR is an opaque data structure passed on to the net-if process\&. The net-if process included in this application makes no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing\&.
.RE
.LP
.B
gb(UserId, Addr, NonRep, MaxRep, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, Port, NonRep, MaxRep, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, NonRep, MaxRep, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, NonRep, MaxRep, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, Port, NonRep, MaxRep, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, Port, NonRep, MaxRep, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, NonRep, MaxRep, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, Port, NonRep, MaxRep, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.B
gb(UserId, Addr, Port, NonRep, MaxRep, ContextName, Oids, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
NonRep = integer()
.br
MaxRep = integer()
.br
ContextName = string()
.br
Oids = [oid()]
.br
Timeout = integer()
.br
ExtraInfo = term()
.br
SnmpReply = snmp_reply()
.br
Remaining = integer()
.br
Reason = {send_failed, ReqId, R} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
.br
.RE
.RS
.LP
Synchronous \fIget-bulk-request\fR (See RFC1905)\&.
.LP
\fIRemaining\fR time of the given or default timeout time\&.
.LP
When \fIReason\fR is \fI{send_failed, \&.\&.\&.}\fR it means that the net_if process failed to send the message\&. This could happen because of any number of reasons, i\&.e\&. encoding error\&. \fIR\fR is the actual reason in this case\&.
.LP
\fIExtraInfo\fR is an opaque data structure passed on to the net-if process\&. The net-if process included in this application makes no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing\&.
.RE
.LP
.B
agb(UserId, Addr, NonRep, MaxRep, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, Port, NonRep, MaxRep, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, NonRep, MaxRep, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, NonRep, MaxRep, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, Port, NonRep, MaxRep, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, Port, NonRep, MaxRep, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, NonRep, MaxRep, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, Port, NonRep, MaxRep, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
.br
.B
agb(UserId, Addr, Port, NonRep, MaxRep, ContextName, Oids, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
Addr = ip_address()
.br
Port = integer()
.br
NonRep = integer()
.br
MaxRep = integer()
.br
ContextName = string()
.br
Oids = [oid()]
.br
Expire = integer()
.br
ExtraInfo = term()
.br
ReqId = integer()
.br
Reason = term()
.br
.RE
.RS
.LP
Asynchronous \fIget-bulk-request\fR (See RFC1905)\&.
.LP
The reply will be delivered to the user through a call to the snmpm_user callback function \fIhandle_pdu\fR\&.
.LP
The \fIExpire\fR time indicates for how long the request is valid (after which the manager is free to delete it)\&.
.RE
.LP
.B
cancel_async_request(UserId, ReqId) -> ok | {error, Reason}
.br
.RS
.TP
Types
UserId = term()
.br
ReqId = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Cancel a previous asynchronous request\&.
.RE
.LP
.B
log_to_txt(LogDir, Mibs)
.br
.B
log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason}
.br
.B
log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason}
.br
.B
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason}
.br
.B
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason}
.br
.B
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason}
.br
.RS
.TP
Types
LogDir = string()
.br
Mibs = [MibName]
.br
MibName = string()
.br
OutFile = string()
.br
LogName = string()
.br
LogFile = string()
.br
Start = Stop = null | datetime() | {local_time, datetime()} | {universal_time, datetime()}
.br
Reason = disk_log_open_error() | file_open_error() | term()
.br
disk_log_open_error() = {LogName, term()}
.br
file_open_error() = {OutFile, term()}
.br
.RE
.RS
.LP
Converts an Audit Trail Log to a readable text file\&. \fIOutFile\fR defaults to "\&./snmpm_log\&.txt"\&. \fILogName\fR defaults to "snmpm_log"\&. \fILogFile\fR defaults to "snmpm\&.log"\&. See snmp:log_to_txt for more info\&.
.RE
.LP
.B
change_log_size(NewSize) -> ok | {error, Reason}
.br
.RS
.TP
Types
NewSize = {MaxBytes, MaxFiles}
.br
MaxBytes = integer()
.br
MaxFiles = integer()
.br
Reason = term()
.br
.RE
.RS
.LP
Changes the log size of the Audit Trail Log\&. The application must be configured to use the audit trail log function\&. Please refer to disk_log(3) in Kernel Reference Manual for a description of how to change the log size\&.
.LP
The change is permanent, as long as the log is not deleted\&. That means, the log size is remembered across reboots\&.
.RE
.LP
.B
set_log_type(NewType) -> {ok, OldType} | {error, Reason}
.br
.RS
.TP
Types
NewType = OldType = atl_type()
.br
Reason = term()
.br
.RE
.RS
.LP
Changes the run-time Audit Trail log type\&.
.LP
Note that this has no effect on the application configuration as defined by configuration files, so a node restart will revert the config to whatever is in those files\&.
.LP
This function is primarily useful in testing/debugging scenarios\&.
.RE
.LP
.B
load_mib(Mib) -> ok | {error, Reason}
.br
.RS
.TP
Types
Mib = MibName
.br
MibName = string()
.br
Reason = term()
.br
.RE
.RS
.LP
Load a \fIMib\fR into the manager\&. The \fIMibName\fR is the name of the Mib, including the path to where the compiled mib is found\&. For example,
.nf
Dir = code:priv_dir(my_app) ++ "/mibs/",
snmpm:load_mib(Dir ++ "MY-MIB")\&.
.fi
.RE
.LP
.B
unload_mib(Mib) -> ok | {error, Reason}
.br
.RS
.TP
Types
Mib = MibName
.br
MibName = string()
.br
Reason = term()
.br
.RE
.RS
.LP
Unload a \fIMib\fR from the manager\&. The \fIMibName\fR is the name of the Mib, including the path to where the compiled mib is found\&. For example,
.nf
Dir = code:priv_dir(my_app) ++ "/mibs/",
snmpm:unload_mib(Dir ++ "MY-MIB")\&.
.fi
.RE
.LP
.B
which_mibs() -> Mibs
.br
.RS
.TP
Types
Mibs = [{MibName, MibFile}]
.br
MibName = atom()
.br
MibFile = string()
.br
.RE
.RS
.LP
Get a list of all the mib\&'s loaded into the manager\&.
.RE
.LP
.B
name_to_oid(Name) -> {ok, Oids} | {error, Reason}
.br
.RS
.TP
Types
Name = atom()
.br
Oids = [oid()]
.br
.RE
.RS
.LP
Transform a alias-name to it\&'s oid\&.
.LP
Note that an alias-name is only unique within the mib, so when loading several mib\&'s into a manager, there might be several instances of the same aliasname\&.
.RE
.LP
.B
oid_to_name(Oid) -> {ok, Name} | {error, Reason}
.br
.RS
.TP
Types
Oid = oid()
.br
Name = atom()
.br
Reason = term()
.br
.RE
.RS
.LP
Transform a oid to it\&'s aliasname\&.
.RE
.LP
.B
backup(BackupDir) -> ok | {error, Reason}
.br
.RS
.TP
Types
BackupDir = string()
.br
.RE
.RS
.LP
Backup persistent data handled by the manager\&.
.LP
BackupDir cannot be identical to DbDir\&.
.RE
.LP
.B
info() -> [{Key, Value}]
.br
.RS
.TP
Types
Key = atom()
.br
Value = term()
.br
.RE
.RS
.LP
Returns a list (a dictionary) containing information about the manager\&. Information includes statistics counters, miscellaneous info about each process (e\&.g\&. memory allocation), and so on\&.
.RE
.LP
.B
verbosity(Ref, Verbosity) -> void()
.br
.RS
.TP
Types
Ref = server | config | net_if | note_store | all
.br
Verbosity = verbosity()
.br
verbosity() = silence | info | log | debug | trace
.br
.RE
.RS
.LP
Sets verbosity for the designated process\&. For the lowest verbosity \fIsilence\fR, nothing is printed\&. The higher the verbosity, the more is printed\&.
.RE
.LP
.B
format_reason(Reason) -> string()
.br
.B
format_reason(Prefix, Reason) -> string()
.br
.RS
.TP
Types
Reason = term()
.br
Prefix = integer() | string()
.br
.RE
.RS
.LP
This utility function is used to create a formatted (pretty printable) string of the error reason received from either:
.RS 2
.TP 2
*
The \fIReason\fR returned value if any of the sync/async get/get-next/set/get-bulk functions returns \fI{error, Reason}\fR
.TP 2
*
The \fIReason\fR parameter in the handle_error user callback function\&.
.RE
.LP
\fIPrefix\fR should either be an indention string (e\&.g\&. a list of spaces) or a positive integer (which will be used to create the indention string of that length)\&.
.RE
|