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
|
.TH snmpa 3 "snmp 4.11" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
snmpa \- Interface Functions to the SNMP toolkit agent
.SH DESCRIPTION
.LP
The module \fIsnmpa\fR contains interface functions to the SNMP agent\&.
.SH DATA TYPES
.nf
oid() = [byte()]
atl_type() = read | write | read_write
notification_delivery_info() = #snmpa_notification_delivery_info{}
.fi
.LP
The \fIoid()\fR type is used to represent an ASN\&.1 OBJECT IDENTIFIER\&.
.LP
The record \fIsnmpa_notification_delivery_info\fR contains the following fields:
.RS 2
.TP 4
.B
\fItag = term()\fR:
A user defined identity representing this notification send operation\&.
.TP 4
.B
\fImod = module()\fR:
A module implementing the snmpa_notification_delivery_info_receiver behaviour\&. The info functions of this module will be called at various stages of delivery\&.
.TP 4
.B
\fIextra = term()\fR:
This is any extra info the user wants to have supplied when the functions in the callback module is called\&.
.RE
.SH EXPORTS
.LP
.B
add_agent_caps(SysORID, SysORDescr) -> SysORIndex
.br
.RS
.TP
Types
SysORID = oid()
.br
SysORDescr = string()
.br
SysORIndex = integer()
.br
.RE
.RS
.LP
This function can be used to add an AGENT-CAPABILITY statement to the sysORTable in the agent\&. The table is defined in the SNMPv2-MIB\&.
.RE
.LP
.B
del_agent_caps(SysORIndex) -> void()
.br
.RS
.TP
Types
SysORIndex = integer()
.br
.RE
.RS
.LP
This function can be used to delete an AGENT-CAPABILITY statement to the sysORTable in the agent\&. This table is defined in the SNMPv2-MIB\&.
.RE
.LP
.B
get_agent_caps() -> [[SysORIndex, SysORID, SysORDescr, SysORUpTime]]
.br
.RS
.TP
Types
SysORIndex = integer()
.br
SysORId = oid()
.br
SysORDescr = string()
.br
SysORUpTime = integer()
.br
.RE
.RS
.LP
Returns all AGENT-CAPABILITY statements in the sysORTable in the agent\&. This table is defined in the SNMPv2-MIB\&.
.RE
.LP
.B
get(Agent, Vars) -> Values | {error, Reason}
.br
.B
get(Agent, Vars, Context) -> Values | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Vars = [oid()]
.br
Context = string()
.br
Values = [term()]
.br
Reason = {atom(), oid()}
.br
.RE
.RS
.LP
Performs a GET operation on the agent\&. All loaded MIB objects are visible in this operation\&. The agent calls the corresponding instrumentation functions just as if it was a GET request coming from a manager\&.
.LP
Note that the request specific parameters (such as current_request_id) are not accessible for the instrumentation functions if this function is used\&.
.RE
.LP
.B
get_next(Agent, Vars) -> Values | {error, Reason}
.br
.B
get_next(Agent, Vars, Context) -> Values | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Vars = [oid()]
.br
Context = string()
.br
Values = [{oid(), term()}]
.br
Reason = {atom(), oid()}
.br
.RE
.RS
.LP
Performs a GET-NEXT operation on the agent\&. All loaded MIB objects are visible in this operation\&. The agent calls the corresponding instrumentation functions just as if it was a GET request coming from a manager\&.
.LP
Note that the request specific parameters (such as \fIsnmpa:current_request_id/0\fR are not accessible for the instrumentation functions if this function is used\&.
.RE
.LP
.B
backup(BackupDir) -> ok | {error, Reason}
.br
.B
backup(Agent, BackupDir) -> ok | {error, Reason}
.br
.RS
.TP
Types
BackupDir = string()
.br
Agent = pid() | atom()
.br
.RE
.RS
.LP
Backup persistent/permanent data handled by the agent (such as local-db, mib-data and vacm)\&.
.LP
Data stored by mnesia is not handled\&.
.LP
BackupDir cannot be identical to DbDir\&.
.RE
.LP
.B
info() -> [{Key, Value}]
.br
.B
info(Agent) -> [{Key, Value}]
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
.RE
.RS
.LP
Returns a list (a dictionary) containing information about the agent\&. Information includes loaded MIBs, registered sub-agents, some information about the memory allocation\&.
.LP
As of version 4\&.4 the format of the info has been changed\&. To convert the info to the old format, call the old_info_format function\&.
.RE
.LP
.B
old_info_format(NewInfo) -> OldInfo
.br
.RS
.TP
Types
OldInfo = NewInfo = [{Key, Value}]
.br
.RE
.RS
.LP
As of version 4\&.4 the format of the info has been changed\&. This function is used to convert to the old (pre-4\&.4) info format\&.
.RE
.LP
.B
load_mibs(Mibs) -> ok | {error, Reason}
.br
.B
load_mibs(Agent,Mibs) -> ok | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Mibs = [MibName]
.br
MibName = string()
.br
Reason = term()
.br
.RE
.RS
.LP
Loads \fIMibs\fR into an agent\&. If the agent cannot load all MIBs, it will indicate where loading was aborted\&. 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/",
snmpa:load_mibs(snmp_master_agent, [Dir ++ "MY-MIB"])\&.
.fi
.RE
.LP
.B
unload_mibs(Mibs) -> ok | {error, Reason}
.br
.B
unload_mibs(Agent,Mibs) -> ok | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Mibs = [MibName]
.br
MibName = string()
.br
.RE
.RS
.LP
Unloads MIBs into an agent\&. If it cannot unload all MIBs, it will indicate where unloading was aborted\&.
.RE
.LP
.B
which_mibs() -> Mibs
.br
.B
which_mibs(Agent) -> Mibs
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Mibs = [{MibName, MibFile}]
.br
MibName = atom()
.br
MibFile = string()
.br
.RE
.RS
.LP
Retrieve the list of all the mibs loaded into this agent\&. Default is the master agent\&.
.RE
.LP
.B
whereis_mib(MibName) -> {ok, MibFile} | {error, Reason}
.br
.B
whereis_mib(Agent, MibName) -> {ok, MibFile} | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
MibName = atom()
.br
MibFile = string()
.br
Reason = term()
.br
.RE
.RS
.LP
Get the full path to the (compiled) mib-file\&.
.RE
.LP
.B
current_request_id() -> {value, RequestId} | false
.br
.B
current_context() -> {value, Context} | false
.br
.B
current_community() -> {value, Community} | false
.br
.B
current_address() -> {value, Address} | false
.br
.RS
.TP
Types
RequestId = integer()
.br
Context = string()
.br
Community = string()
.br
Address = term()
.br
.RE
.RS
.LP
Get the request-id, context, community and address of the request currently being processed by the agent\&.
.LP
Note that these functions is intended to be called by the instrumentation functions and \fIonly\fR if they are executed in the context of the agent process (e\&.g\&. it does not work if called from a spawned process)\&.
.RE
.LP
.B
enum_to_int(Name, Enum) -> {value, Int} | false
.br
.B
enum_to_int(Db, Name, Enum) -> {value, Int} | false
.br
.RS
.TP
Types
Db = term()
.br
Name = atom()
.br
Enum = atom()
.br
Int = int()
.br
.RE
.RS
.LP
Converts the symbolic value \fIEnum\fR to the corresponding integer of the enumerated object or type \fIName\fR in a MIB\&. The MIB must be loaded\&.
.LP
\fIfalse\fR is returned if the object or type is not defined in any loaded MIB, or if it does not define the symbolic value as enumerated\&.
.LP
\fIDb\fR is a reference to the symbolic store database (retrieved by a call to \fIget_symbolic_store_db/0\fR)\&.
.RE
.LP
.B
int_to_enum(Name, Int) -> {value, Enum} | false
.br
.B
int_to_enum(Db, Name, Int) -> {value, Enum} | false
.br
.RS
.TP
Types
Db = term()
.br
Name = atom()
.br
Int = int()
.br
Enum = atom()
.br
.RE
.RS
.LP
Converts the integer \fIInt\fR to the corresponding symbolic value of the enumerated object or type \fIName\fR in a MIB\&. The MIB must be loaded\&.
.LP
\fIfalse\fR is returned if the object or type is not defined in any loaded MIB, or if it does not define the symbolic value as enumerated\&.
.LP
\fIDb\fR is a reference to the symbolic store database (retrieved by a call to \fIget_symbolic_store_db/0\fR)\&.
.RE
.LP
.B
name_to_oid(Name) -> {value, oid()} | false
.br
.B
name_to_oid(Db, Name) -> {value, oid()} | false
.br
.RS
.TP
Types
Db = term()
.br
Name = atom()
.br
.RE
.RS
.LP
Looks up the OBJECT IDENTIFIER of a MIB object, given the symbolic name\&. Note, the OBJECT IDENTIFIER is given for the object, not for an instance\&.
.LP
\fIfalse\fR is returned if the object is not defined in any loaded MIB\&.
.LP
\fIDb\fR is a reference to the symbolic store database (retrieved by a call to \fIget_symbolic_store_db/0\fR)\&.
.RE
.LP
.B
oid_to_name(OID) -> {value, Name} | false
.br
.B
oid_to_name(Db, OID) -> {value, Name} | false
.br
.RS
.TP
Types
Db = term()
.br
OID = oid()
.br
Name = atom()
.br
.RE
.RS
.LP
Looks up the symbolic name of a MIB object, given OBJECT IDENTIFIER\&.
.LP
\fIfalse\fR is returned if the object is not defined in any loaded MIB\&.
.LP
\fIDb\fR is a reference to the symbolic store database (retrieved by a call to \fIget_symbolic_store_db/0\fR)\&.
.RE
.LP
.B
which_aliasnames() -> Result
.br
.RS
.TP
Types
Result = [atom()]
.br
.RE
.RS
.LP
Retrieve all alias-names known to the agent\&.
.RE
.LP
.B
which_tables() -> Result
.br
.RS
.TP
Types
Result = [atom()]
.br
.RE
.RS
.LP
Retrieve all tables known to the agent\&.
.RE
.LP
.B
which_variables() -> Result
.br
.RS
.TP
Types
Result = [atom()]
.br
.RE
.RS
.LP
Retrieve all variables known to the agent\&.
.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 "\&./snmpa_log\&.txt"\&. \fILogName\fR defaults to "snmpa_log"\&. \fILogFile\fR defaults to "snmpa\&.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
.B
set_log_type(Agent, NewType) -> {ok, OldType} | {error, Reason}
.br
.RS
.TP
Types
NewType = OldType = atl_type()
.br
Agent = pid() | atom()
.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
mib_of(Oid) -> {ok, MibName} | {error, Reason}
.br
.B
mib_of(Agent, Oid) -> {ok, MibName} | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Oid = oid()
.br
MibName = atom()
.br
Reason = term()
.br
.RE
.RS
.LP
Finds the mib corresponding to the \fIOid\fR\&. If it is a variable, the Oid must be <Oid for var>\&.0 and if it is a table, Oid must be <table>\&.<entry>\&.<col>\&.<any>
.RE
.LP
.B
me_of(Oid) -> {ok, Me} | {error, Reason}
.br
.B
me_of(Agent, Oid) -> {ok, Me} | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Oid = oid()
.br
Me = #me{}
.br
Reason = term()
.br
.RE
.RS
.LP
Finds the mib entry corresponding to the \fIOid\fR\&. If it is a variable, the Oid must be <Oid for var>\&.0 and if it is a table, Oid must be <table>\&.<entry>\&.<col>\&.<any>
.RE
.LP
.B
register_notification_filter(Id, Mod, Data) -> ok | {error, Reason}
.br
.B
register_notification_filter(Agent, Id, Mod, Data) -> ok | {error, Reason}
.br
.B
register_notification_filter(Id, Mod, Data, Where) -> ok | {error, Reason}
.br
.B
register_notification_filter(Agent, Id, Mod, Data, Where) -> ok | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Id = filter_id()
.br
filter_id() = term()
.br
Mod = atom()
.br
Data = term()
.br
Where = filter_position()
.br
Reason = term()
.br
filter_position() = first | last | {insert_before, filter_id()} | {insert_after, filter_id()}
.br
.RE
.RS
.LP
Registers a notification filter\&.
.LP
\fIMod\fR is a module implementing the \fIsnmpa_notification_filter\fR behaviour\&.
.LP
\fIData\fR will be passed on to the filter when calling the functions of the behaviour\&.
.RE
.LP
.B
unregister_notification_filter(Id) -> ok | {error, Reason}
.br
.B
unregister_notification_filter(Agent, Id) -> ok | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Id = filter_id()
.br
filter_id() = term()
.br
.RE
.RS
.LP
Unregister a notification filter\&.
.RE
.LP
.B
which_notification_filter() -> Filters
.br
.B
which_notification_filter(Agent) -> Filters
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Filters = [filter_id()]
.br
filter_id() = term()
.br
.RE
.RS
.LP
List all notification filters in an agent\&.
.RE
.LP
.B
set_request_limit(NewLimit) -> {ok, OldLimit} | {error, Reason}
.br
.B
set_request_limit(Agent, NewLimit) -> {ok, OldLimit} | {error, Reason}
.br
.RS
.TP
Types
NewLimit = OldLimit = infinity | integer() >= 0
.br
Agent = pid() | atom()
.br
Reason = term()
.br
.RE
.RS
.LP
Changes the request limit\&.
.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 load regulation scenarios\&.
.RE
.LP
.B
register_subagent(Agent, SubTreeOid, Subagent) -> ok | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
SubTreeOid = oid()
.br
SubAgent = pid()
.br
.RE
.RS
.LP
Registers a sub-agent under a sub-tree of another agent\&.
.LP
It is easy to make mistakes when registering sub-agents and this activity should be done carefully\&. For example, a strange behaviour would result from the following configuration:
.nf
snmp_agent:register_subagent(MAPid,[1,2,3,4],SA1),
snmp_agent:register_subagent(SA1,[1,2,3], SA2)\&.
.fi
.LP
\fISA2\fR will not get requests starting with object identifier \fI[1, 2, 3]\fR since \fISA1\fR does not\&.
.RE
.LP
.B
unregister_subagent(Agent, SubagentOidOrPid) -> ok | {ok, SubAgentPid} | {error, Reason}
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
SubTreeOidorPid = oid() | pid()
.br
.RE
.RS
.LP
Unregister a sub-agent\&. If the second argument is a pid, then that sub-agent will be unregistered from all trees in \fIAgent\fR\&.
.RE
.LP
.B
send_notification(Agent, Notification, Receiver)
.br
.B
send_notification(Agent, Notification, Receiver, Varbinds)
.br
.B
send_notification(Agent, Notification, Receiver, NotifyName, Varbinds)
.br
.B
send_notification(Agent, Notification, Receiver, NotifyName, ContextName, Varbinds) -> void()
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Notification = atom()
.br
Receiver = no_receiver | {Tag, Recv} | notification_delivery_info()
.br
Tag = term()
.br
Recv = receiver()
.br
receiver() = pid() | atom() | {Mod, Func, Args}
.br
Mod = atom()
.br
Func = atom()
.br
Args = list()
.br
NotifyName = string()
.br
ContextName = string()
.br
Varbinds = varbinds()
.br
varbinds() = [varbind()]
.br
varbind() = {Variable, Value} | {Column, RowIndex, Value} | {OID, Value}
.br
Variable = atom()
.br
Column = atom()
.br
OID = oid()
.br
Value = term()
.br
RowIndex = [int()]
.br
.RE
.RS
.LP
Sends the notification \fINotification\fR to the management targets defined for \fINotifyName\fR in the \fIsnmpNotifyTable\fR in SNMP-NOTIFICATION-MIB from the specified context\&. If no \fINotifyName\fR is specified (or if it is \fI""\fR), the notification is sent to all management targets (\fIAddresses\fR below)\&. If no \fIContextName\fR is specified, the default \fI""\fR context is used\&.
.LP
The parameter \fIReceiver\fR specifies where information about delivery of Inform-Requests should be sent\&. The agent sends Inform-Requests and waits for acknowledgments from the managers\&. \fIReceiver\fR can have three values:
.RS 2
.TP 2
*
\fIno_receiver\fR - No information is delivered\&.
.TP 2
*
\fI{Tag, Recv}\fR - The information is delivered either via messages or via a function call according to the value of \fIRecv\fR\&.
.TP 2
*
\fInotification_delivery_info()\fR - The information is delivered via a function call according to this data\&. See the DATA TYPES section above for details\&.
.RE
.LP
If \fIReceiver\fR has the value \fI{Tag, Recv}\fR, the delivery is done according to \fIRecv\fR:
.RS 2
.TP 2
*
\fIpid() | atom()\fR - The info will be delivered in the following messages:
.RS 2
.LP
.RS 2
.TP 2
-
\fI{snmp_targets, Tag, Addresses}\fR
.RS 2
.LP
.LP
This inform the user which target addresses the notification was sent to\&.
.RE
.TP 2
-
\fI{snmp_notification, Tag, {got_response, Address}}\fR
.RS 2
.LP
.LP
This informs the user that this target address acknowledged the notification\&.
.RE
.TP 2
-
\fI{snmp_notification, Tag, {no_response, Address}}\fR
.RS 2
.LP
.LP
This informs the user that this target address did not acknowledge notification\&.
.RE
.RE
.LP
.LP
The notification is sent as an Inform-Request to each target address in \fIAddresses\fR and if there are no targets for which an Inform-Request is sent, \fIAddresses\fR is the empty list \fI[]\fR\&.
.LP
.LP
The \fIreceiver\fR will first be sent the \fIsnmp_targets\fR message, and then for each address in \fIAddresses\fR list, one of the two \fIsnmp_notification\fR messages\&.
.RE
.TP 2
*
\fI{Mod, Func, Args}\fR - The info will be delivered via the function call:
.RS 2
.LP
.LP
\fIMod:Func([Msg | Args])\fR
.LP
.LP
where \fIMsg\fR has the same content and purpose as the messages descrived above\&.
.RE
.RE
.LP
\fIAddress\fR is a management target address and \fIAddresses\fR is a list of management target addresses\&. They are defined as followes:
.nf
Addresses = [address()]
Address = address()
address() = v1_address() | v3_address()
v1_address() = {TDomain, TAddress}
v3_address() = {{TDomain, TAddress}, V3MsgData}
TDomain = tdoamin()
TAddress = taddress()
tdomain() = The oid of snmpUDPDomain
This is the only supported transport domain\&.
taddress() = [A1, A2, A3, A4, P1, P3]
The 4 first bytes makes up the IP-address and the last 2,
the UDP-port number\&.
V3MsgData = v3_msg_data()
v3_msg_data() = term()
.fi
.LP
If \fIReceiver\fR is a \fInotification_delivery_info()\fR record, then the information about the notification delivery will be delivered to the \fIreceiver\fR via the callback functions defined by the snmpa_notification_delivery_info_receiver behaviour according to the content of the \fInotification_delivery_info()\fR record\&.
.LP
The optional argument \fIVarbinds\fR defines values for the objects in the notification\&. If no value is given for an object, the \fIAgent\fR performs a get-operation to retrieve the value\&.
.LP
\fIVarbinds\fR is a list of \fIVarbind\fR, where each \fIVarbind\fR is one of:
.RS 2
.TP 2
*
\fI{Variable, Value}\fR, where \fIVariable\fR is the symbolic name of a scalar variable referred to in the notification specification\&.
.TP 2
*
\fI{Column, RowIndex, Value}\fR, where \fIColumn\fR is the symbolic name of a column variable\&. \fIRowIndex\fR is a list of indices for the specified element\&. If this is the case, the OBJECT IDENTIFIER sent in the notification is the \fIRowIndex\fR appended to the OBJECT IDENTIFIER for the table column\&. This is the OBJECT IDENTIFIER which specifies the element\&.
.TP 2
*
\fI{OID, Value}\fR, where \fIOID\fR is the OBJECT IDENTIFIER for an instance of an object, scalar variable, or column variable\&.
.RE
.LP
For example, to specify that \fIsysLocation\fR should have the value \fI"upstairs"\fR in the notification, we could use one of:
.RS 2
.TP 2
*
\fI{sysLocation, "upstairs"}\fR or
.TP 2
*
\fI{[1, 3, 6, 1, 2, 1, 1, 6, 0], "upstairs"}\fR or
.TP 2
*
\fI{?sysLocation_instance, "upstairs"}\fR (provided that the generated \fI\&.hrl\fR file is included)
.RE
.LP
If a variable in the notification is a table element, the \fIRowIndex\fR for the element must be given in the \fIVarbinds\fR list\&. In this case, the OBJECT IDENTIFIER sent in the notification is the OBJECT IDENTIFIER that identifies this element\&. This OBJECT IDENTIFIER could be used in a get operation later\&.
.LP
This function is asynchronous, and does not return any information\&. If an error occurs, \fIuser_err/2\fR of the error report module is called and the notification is discarded\&.
.RE
.LP
.B
send_trap(Agent,Trap,Community)
.br
.B
send_trap(Agent,Trap,Community,Varbinds) -> void()
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
Trap = atom()
.br
Community = string()
.br
Varbinds = [Varbind]
.br
Varbind = {Variable, Value} | {Column, RowIndex, Value} | {OID, Value}
.br
Variable = atom()
.br
Column = atom()
.br
OID = oid()
.br
Value = term()
.br
RowIndex = [int()]
.br
.RE
.RS
.LP
Note! This function is only kept for backwards compatibility reasons\&. Use \fIsend_notification\fR instead\&.
.LP
Sends the trap \fITrap\fR to the managers defined for \fICommunity\fR in the \fIintTrapDestTable\fR in OTP-SNMPEA-MIB\&. The optional argument \fIVarbinds\fR defines values for the objects in the trap\&. If no value is given for an object, the \fIAgent\fR performs a get-operation to retrieve the value\&.
.LP
\fIVarbinds\fR is a list of \fIVarbind\fR, where each \fIVarbind\fR is one of:
.RS 2
.TP 2
*
\fI{Variable, Value}\fR, where \fIVariable\fR is the symbolic name of a scalar variable referred to in the trap specification\&.
.TP 2
*
\fI{Column, RowIndex, Value}\fR, where \fIColumn\fR is the symbolic name of a column variable\&. \fIRowIndex\fR is a list of indices for the specified element\&. If this is the case, the OBJECT IDENTIFIER sent in the trap is the \fIRowIndex\fR appended to the OBJECT IDENTIFIER for the table column\&. This is the OBJECT IDENTIFIER which specifies the element\&.
.TP 2
*
\fI{OID, Value}\fR, where \fIOID\fR is the OBJECT IDENTIFIER for an instance of an object, scalar variable, or column variable\&.
.RE
.LP
For example, to specify that \fIsysLocation\fR should have the value \fI"upstairs"\fR in the trap, we could use one of:
.RS 2
.TP 2
*
\fI{sysLocation, "upstairs"}\fR or
.TP 2
*
\fI{[1, 3, 6, 1, 2, 1, 1, 6, 0], "upstairs"}\fR or
.TP 2
*
\fI{?sysLocation_instance, "upstairs"}\fR (provided that the generated \fI\&.hrl\fR file is included)
.RE
.LP
If a variable in the trap is a table element, the \fIRowIndex\fR for the element must be given in the \fIVarbinds\fR list\&. In this case, the OBJECT IDENTIFIER sent in the trap is the OBJECT IDENTIFIER that identifies this element\&. This OBJECT IDENTIFIER could be used in a get operation later\&.
.LP
This function is asynchronous, and does not return any information\&. If an error occurs, \fIsnmp_error:user_err/2\fR is called and the trap is discarded\&.
.RE
.LP
.B
convert_config(OldConfig) -> AgentConfig
.br
.RS
.TP
Types
OldConfig = list()
.br
AgentConfig = list()
.br
.RE
.RS
.LP
This off-line utility function can be used to convert the old snmp application config (pre snmp-4\&.0) to the new snmp agent config (as of snmp-4\&.0)\&.
.LP
For information about the old config (\fIOldConfig\fR) see the OTP R9C documentation\&.
.LP
For information about the current agent config (\fIAgentConfig\fR), see either the SNMP application part of the reference manual or the Configuring the application chapter of the SNMP user\&'s guide\&.
.RE
.LP
.B
restart_worker() -> void()
.br
.B
restart_worker(Agent) -> void()
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
.RE
.RS
.LP
Restart the worker process of a multi-threaded agent\&.
.LP
This is a utility function, that can be usefull when e\&.g\&. debugging instrumentation functions\&.
.RE
.LP
.B
restart_set_worker() -> void()
.br
.B
restart_set_worker(Agent) -> void()
.br
.RS
.TP
Types
Agent = pid() | atom()
.br
.RE
.RS
.LP
Restart the set worker process of a multi-threaded agent\&.
.LP
This is a utility function, that can be usefull when e\&.g\&. debugging instrumentation functions\&.
.RE
.LP
.B
verbosity(Ref,Verbosity) -> void()
.br
.RS
.TP
Types
Ref = pid() | sub_agents | master_agent | net_if | mib_server | symbolic_store | note_store | local_db
.br
Verbosity = verbosity() | {subagents, 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
.SH SEE ALSO
.LP
calendar(3), erlc(1)
|