I had to pass through some hell in order to enable some SNMP Oracle functionality (Oracle 10g for Linux).
This post tries to give instructions for configuring Oracle SNMP features; it might be very boring (even for technical hardcore people), I post it mainly for spreading the knowledge. ("emsubagent" gives ~70 results in Google!)
Oracle SNMP architecture (very shortly)
There are two relevant components:
- Master Agent: handles SNMP queries (receives and replies) and sends traps.
As far as I understand it could be the Linux native snmpd.
- Sub Agent: helps the master agent to get info from specific instances. Comes as a part of Oracle database and maybe other Oracle products.
So, it probably looks like this:
Some SNMP Client sends SNMP GET to master agent -> master agent queries a relevant subagent -> subagent replies to the master agent -> master agent replies the SNMP client.
Real info can be found here.
Running the subagent
It should be quite simple in theory:
> emctl start subagent
Yes, but subagent doesn't really start
running "emctl start subagent" would print "subagent started" no matter if it had succeded or failed! This is really lame, no return value checking. Use emctl status subagent or ps -fade | grep emsubagent for check ing if subagent is up.
Steps I've taken to make subagent work:
- Install the latest patchset. In 10.2.0.1 the emsubagent binary was forgotten, apparently (!!!)
- If $ORACLE_HOME/product/10.2.0/db_1/network/admin/sqlnet.ora doesn't exist, create an empty one; they promised to fix that on 10.2.0.4 though.
- Make sure that snmpd (the native Linux net-snmp) is running and is well-configured. I had to add the following lines to enable SNMP MUX (port 199) and allow oracle to use it. It doesn't look too secure though:
But this is not the end..
I still miss some important knowledge. Currently we're having troubles getting SNMP traps from Oracle on errors; on some cases it doesn't send them until we restart the server.
Update: traps are sent from an inner component called OMS (Oracle Management Serv[ice|ver]?); it works regardless of whether the subagent is running or not.
Update 2: This is probably the best official reference: