Since no good tutorials are available I put together what I learnt. My approach was step by step learning and that is what I describe here. So on day 1 or step one we will see how to create a simple MIB that has only two simple read-only scalars and how to implement them in the agent. I have configured net-snmpd agentx mode to run on TCP. Check this post on how to configure that.
You should clone my git repository and follow the README which describes the changes made. I have created tags in the git repository so it is easy to reference what is done when and for what.
git clone https://github.com/jainvishal/agentx-tutorial.git git checkout step1_scalars_autogenerated git checkout step1_scalars_implement
Notes
- I used net-snmp 5.7.3 for this tutorial.
- My test MIB AGENTX-TUTORIAL-MIB is under experimental branch (.1.3.6.1.3) so my MIB branch is .1.3.6.1.3.9999.
smilint
was used to verify that MIB was syntactically correct.mib2c
was used withmib2c.scalar.conf
to compile the MIB and generate the code, makefile and agent code.
Now wait for second tutorial where I will implement a simple table using MIB-For-Dummies configuration.