Wiki source code of Simulate the MIB in AgenPro
Version 1.1 by Frank Fock on 2024/05/25 11:30
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | This page describes how AgenPro can be used to simulate MIB modules for: |
2 | |||
3 | * verifying the design of the MIB module(s) | ||
4 | * finding out how to best manage devices implementing the simulated MIB module(s) | ||
5 | * providing a mocku-up of a real device while its implementation is not ready yet. | ||
6 | |||
7 | == How-To Simulate MIB Modules with AgenPro == | ||
8 | |||
9 | After having installed AgenPro: | ||
10 | |||
11 | 1. ((( | ||
12 | Run AgenPro (make sure that the MIB repository that comes with AgenPro is installed and if not set with File>Set Repository. | ||
13 | |||
14 | |||
15 | {{container}} | ||
16 | Reuse MIB Repository of MIB Designer | ||
17 | If you have created your own MIB module(s) with MIB Designer you can directly use the MIB Designer installation's MIB repository. Simply switch to that repository with File>Set Repository and select the repository directory used by MIB Designer. | ||
18 | {{/container}} | ||
19 | |||
20 | |||
21 | ))) | ||
22 | 1. ((( | ||
23 | Compile the MIB module(s) to simulate with File>Compile New MIBs. //Skip this step if you are reusing a MIB repository that already contains the MIB modules you want to simulate. | ||
24 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_compile_new_mibs.png?version=1&modificationDate=1459366161066&api=v2||width="500"]]// | ||
25 | |||
26 | |||
27 | AgenPro Sorts MIB Files | ||
28 | |||
29 | AgenPro and any other AGENT++ tool sorts MIB files by their import dependencies before compiling them. Sorting can be applied only on multiple MIB files. All dependencies of a MIB file compiled as single file must be available within the currently selected MIB repository. Otherwise compilation fails with an "unresolved IMPORT dependency" error. | ||
30 | |||
31 | To compile several MIB modules at once, | ||
32 | (a) open a ZIP file with MIB (text) files therein | ||
33 | (b) open a directory that contains MIB (text) files. | ||
34 | ))) | ||
35 | 1. Open the compiled MIB modules (i.e. load them into AgenPro from the repository) by using File->Open/Close MIB: Shuffle all the modules you want to simulate into the right list, in order to load them: | ||
36 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_load-mib.png?version=1&modificationDate=1459366663580&api=v2||width="500"]] | ||
37 | |||
38 | 1. Open an existing code generation project depending on the target programming language with Project->Open. | ||
39 | //If you only want to simulate MIB modules, the code generation templates you choose are not relevant and can be left empty, but you need to define a project though. | ||
40 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_open_project.png?version=1&modificationDate=1459371561399&api=v2||width="500"]]// | ||
41 | |||
42 | 1. ((( | ||
43 | Edit the project using the Project Wizard with Project->Edit. | ||
44 | For simulation of a SNMP agent, the first two steps are not relevant. | ||
45 | |||
46 | 1. In step (1) specify the root directories for template and in-/output paths (you will need those paths for being able to actually generate code) | ||
47 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_project-wizard-1.png?version=2&modificationDate=1459511581397&api=v2||width="500"]] | ||
48 | \\ | ||
49 | 1. In step (2) specify additional properties for the code generation jobs (not relevant for simulation): | ||
50 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_project-wizard-2.png?version=2&modificationDate=1459511581530&api=v2||width="500"]] | ||
51 | |||
52 | 1. In step (3) you can specify an AGENT-CAPABILITIES. Often an AGENT-CAPABILITIES statement providing a detailed description of the agent capabilitiies (i.e. support MIB modules and objects) does not exist. Only if such a statement is contained in the **loaded** MIB modules, then you cannot select such a statement and use it for defining the MIB modules/objects of the agent. The below screenshot shows the case when there is no such AGENT-CAPABILITIES statement available: | ||
53 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_project-wizard-3.png?version=1&modificationDate=1459374511315&api=v2||width="500"]] | ||
54 | 1. In step (4) you **specify the MIB modules** for which code should be generated. In addition, when running the simulation agent, **only those MIB modules will be simulated which are selected here** for processing (or by the AGENT-CAPABILITIES statement from step 3): | ||
55 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_project-wizard-4.png?version=1&modificationDate=1459374737289&api=v2||width="500"]] | ||
56 | ))) | ||
57 | 1. Configure the simulation agent parameters on the Agent tab. The minimum settings are the local IP address (0.0.0.0 should be fine in most cases) and the port: | ||
58 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_agent-parameters.png?version=1&modificationDate=1459375721001&api=v2||width="500"]] | ||
59 | 1. ((( | ||
60 | Run the simulation agent with Agent->Run Agent. | ||
61 | The Start button of the agent panel is shown as "pressed". | ||
62 | |||
63 | |||
64 | Inspect the Log panel | ||
65 | |||
66 | The Log tab shows details about the agent start. For example you can find which objects from the source modules are simulated: | ||
67 | |||
68 | [[image:https://doc.snmp.app/download/attachments/11993098/sc_tutorial_agen_agent-log.png?version=1&modificationDate=1459376139101&api=v2||width="500"]] | ||
69 | |||
70 | |||
71 | ))) |