I cannot add SNMP legacy agent to SunMC
Hi there,
I have problems with adding my SNMP legacy agent to SunMC, I would appreciate any suggestions/solutions.
I wrote a SNMP agent using SNMP4j. It works well when stand alone. Then I try to add it to SunMC as a legacy agent. I followed the steps listed in the document "Sun Management Center 3.6.1 Installation and configuration Guide":
1, I modify the file "/var/opt/SUNWsymon/cfg/subagent-registry-d.x"; the main part that I I added is,
type= legacy
persist= false
snmpPort= "4650"
startCommand= "java -cp /profilium/SNMP4j/lib/log4j-1.2.9.jar:/profilium/SNMP4j/target/classes:/profili um/snmp-exercise snmpexercise.SnmpSend"
pollInterval= 60
pollHoldoff= 60
oidTrees= 1.3.6.1.4.1.23460
snmpVersi= SNMPv2c
securityLevel = noauth
securityName= public
I think in the modification, the tricky part is the 'startCommand'. I use the java command to start my agent, as it works at the Unix command line.
2, then I stop and restart Sun MC to make the changes effective.
The SunMC doesn't complain anything when I restart it.~But~, after I reopen the SunMC console, I don't see anything added there. Everything looks the same as before.
Is there anything wrong with what I did? Or, I have to configure more things in the SunMC?
Thank you for advices.
Xinxin
# 1
Hi Brian,
> The SunMC doesn't complain anything when I restart
> it.~But~, after I reopen the SunMC console, I
> don't see anything added there. Everything looks the
> same as before.
>
> Is there anything wrong with what I did? Or, I have
> to configure more things in the SunMC?
When you add a subagent to SunMC, it's really only a convenience that allows you to use a single port. Instead of of your Java agent and SunMC running in parallel on different ports, SunMC receives all the requests on its port and only forwards the OIDs it's not responsible for to your process.
Attaching subagents like you're doing won't alter what you see in the SunMC Console. For that you have to build a "module"... and that new module can query your SNMP4j process to get data and display it in SunMC (or your module could get it's data from anywhere else you'd like).
http://www.sun.com/software/products/sunmanagementcenter/developers/
Regards,
Mike.Kirk@HalcyonInc.com
http://www.HalcyonInc.com
# 2
Hi Mike,
Thank you very much. Your link is helpful. but I still have problems with the Developer Environment.
I followed the example in the
/opt/SUNWsymon/sdk/docs/index.html file to build a new module called 'TrapGen'The steps are:
% mkdir ~/de_examples
% cp -r /opt/SUNWsymon/sdk/examples ~/de_examples
% cd ~/de_examples/examples/modules/TrapGen
% make
% cd package
% su
# pkgadd -d . DEMOtrgen
# /opt/SUNWsymon/sbin/es-stop -a
# /opt/SUNWsymon/sbin/es-start -a
Afterward, I loaded this new module on the console, then I can see the Trap Generation module is loaded under Local Applications.
Trap One is supposed to generate the enterprise trap, and the Trap Two node issues a refreshValueAndTrap on "set".
My questions are : where to check the enterprise trap? and how to "set" Trap TWo node to make it generate a refreshValueAndTrap? I checked the Alarms, the LogView on the console, could not find anything new there.
Thanks for your answer
Brian
Mike wrote:
=========================================
Hi Brian,
When you add a subagent to SunMC, it's really only a convenience that allows you to use a single port. Instead of of your Java agent and SunMC running in parallel on different ports, SunMC receives all the requests on its port and only forwards the OIDs it's not responsible for to your process.
Attaching subagents like you're doing won't alter what you see in the SunMC Console. For that you have to build a "module"... and that new module can query your SNMP4j process to get data and display it in SunMC (or your module could get it's data from anywhere else you'd like).
http://www.sun.com/software/products/sunmanagementcenter/developers/
Regards,
Mike.Kirk@HalcyonInc.com
# 3
Hi Mike,
If I want to integrate my application into SunMC, ie get/set SNMP parameters and receive traps, do I need to hardcode all OID in the module?
Ideally, I would write a module that would proxy all SNMP traffic to the manager server which would then make it available to the console. This only information I would give the module is the port number to connect to and the port number to receive traps. Is this possible?
Thanks,
N
# 4
> If I want to integrate my application into SunMC, ie
> get/set SNMP parameters and receive traps, do I need
> to hardcode all OID in the module?
> Ideally, I would write a module that would proxy all
> SNMP traffic to the manager server which would then
> make it available to the console. This only
> information I would give the module is the port
> number to connect to and the port number to receive
> traps. Is this possible?
It doesn't quite work like that. Even if you have SunMC proxy snmp requests for your other snmp process... it won't be displayed in the Console. Basically all you're gaining is the ability to send all snmp traffic to a single port (SunMC's) and it passes along those requests on your behalf. I'd say that's not too popular a solution.
A better way to do things is to write a "module" for SunMC, and that module would know the OIDs in your manager that you're interested in. That way your data would show up properly in the Console, and you'd get access to all of SunMC's other features for "free" (i.e. setting alarms on thresholds, sending email, running scripts when bad things happen, a history of alarms in the SunMC database, and the ability to graph/report your values over time from the SunMC PRM addon).
A module is the official way of registering your other snmp process. So it depends on what you want to do... do you want SunMC to just manage the SNMP traffic for you... or do you want all the alarming/trending/graphing GUI features as well?
If you're not too sure about building a module you can have Halcyon build that part for you (we probably only need the MIB for your SNMP program/device). We're very good at it since we've been building SunMC modules for years :)
http://www.halcyoninc.com/products/a-z.php
Regards,
Mike.Kirk@HalcyonInc.com
http://www.HalcyonInc.com
