Creating a MIB for a Sun Management Center Module

Here is a quick tutorial on how to create an SNMP MIB for a Sun Management Center Module. This process helps when you already have a Sun Management Center Module running on the agent and you want to expose the ASN.1 MIB interface for this module.

Load Module
Load the module into an agent on a development system. Make sure that this agent can be stopped and restarted. Hence I am suggesting the use of a development system than a production system. Loading the module can be done from Sun Management Center Console, using the host details window of the agent.

Start Agent in Interactive Mode

Now, as superuser, stop the agent and start it in interactive mode. The agent interactive mode presents an interactive command shell that lets you navigate thru the objects within the agent.

bash-3.00# pwd
bash-3.00# /opt/SUNWsymon/sbin/es-stop -a
Stopping agent component
bash-3.00# /opt/SUNWsymon/sbin/es-start -ai
info Oct 12 21:34:57 agent Sun Management Center Version: 3.6.1, Build: 12, H491, (c) 2003 Sun Microsystems, Oct 12 21:34:57 agent registering import actions
info Oct 12 21:34:57 agent loading standard services
info Oct 12 21:34:57 agent standard services load complete
info Oct 12 21:34:57 agent agent host and port: agent007:2161
info Oct 12 21:34:57 agent trap handler destination host and port: agent007:162
info Oct 12 21:34:57 agent event trap destination host and port: agent007:163

Once the agent comes up in interactive mode, you need to wait for a few seconds until your module is loaded into the agent. If you know the location where your module is loaded, you can navigate there in the object tree hierarchy and ensure that the module is loaded.

agent:> cd .iso*demo
agent:demo> ls

Export MIB

After your module is loaded, you need to execute a mibExport command, with your module name as the argument. For example, if your module’s *-m.x file name is mydemo-m.x, then you run the command mibExport mydemo. At this point, the agent generates a *-mib.txt file (in this case, mydemo-mib.txt) in the /var/opt/SUNWsymon/cfg/ directory.

At this point, you may exit the agent interactive mode and run the agent in the default daemon mode.

agent:demo> mibExport mydemo
agent:demo> exit
syslog�� Oct 12 21:41:49 agent�������� *** terminating execution ***
bash-3.00# /opt/SUNWsymon/sbin/es-start -a
ls -altr
Agent started successfully.
bash-3.00# ls -altr /var/opt/SUNWsymon/cfg/mydemo-mib.txt
-rw-r–r–�� 1 root���� root������� 2650 Oct 12 21:40 /var/opt/SUNWsymon/cfg/mydemo-mib.txt
bash-3.00# tail /var/opt/SUNWsymon/cfg/mydemo-mib.txt
::= { myDemoEntry 5 }

myDemoMounted OBJECT-TYPE
SYNTAX����� DisplayString
MAX-ACCESS� read-only
STATUS����� current
“Character string value”
::= { myDemoEntry 6 }

Additional Notes:

  1. The above examples assume that you installed Sun Management Center product with /opt as the BASE_DIR. If you used some other directory (e.g. /myvol/opt) then replace /opt with that directory in the above examples.
  2. The MIB variable names will be same as the node names you have given in the Sun Management Center module. To make these variable names look more ASN.1 like, you may need to edit the generated MIB text file.
  3. You may want to edit the MIB file so that you add the necessary import definitions for MIBs.
  4. The Description fields for MIB variables are genrated using the mediumDesc of the module nodes. You may want to add elaborate descriptions for MIB variables.

By Raju Alluri

Blogging on my personal site since 2006, I try to cover both personal and work related events and thoughts in this blog. You can reach me on Instagram, Facebook or Twitter.


  1. Hi Raju,
    I would like to know , how to add hosts in Sun management Center and configure alarms for certain threshholds in case of failures.

Comments are closed.