Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Open Source Projects
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Other Open Source Projects
SNMP Trap Severity
Eugene Condor
Greenhorn
Posts: 2
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
How do you add a severity in SNMP trap?
I'm using SNMP4j. Code Below :
TransportMapping transport = new DefaultUdpTransportMapping(); Snmp snmp = new Snmp(transport); CommunityTarget localtarget = new CommunityTarget(); localtarget.setCommunity(new OctetString("public")); localtarget.setAddress(new UdpAddress(managerIpAdd + "/162")); localtarget.setVersion(SnmpConstants.version2c); localtarget.setRetries(3); localtarget.setTimeout(2000); PDU pdu = new PDU(); // need to specify the system up time pdu.add(new VariableBinding(SnmpConstants.sysUpTime, new OctetString(new Date().toString()))); pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID, targetOID)); pdu.add(new VariableBinding(SnmpConstants.snmpTrapAddress, new IpAddress(ApplicationUtil.getMachineIpAddress()))); // variable binding for Enterprise Specific objects, Severity (should be defined in MIB file) pdu.add(new VariableBinding(targetOID, new OctetString(message))); pdu.setType(PDU.TRAP); snmp.send(pdu, localtarget); snmp.close();
Thanks
Martijn Verburg
author
Posts: 3285
13
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Eugene and welcome to Javaranch!
I assume the SNMP4j docs/mailing list are of no help?
Cheers, Martijn,
Twitter
.
Eugene Condor
Greenhorn
Posts: 2
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Thanks for the welcome,
yes your right, theres no available docs for adding severity in SNMP4j trap.
Do you have any idea how to do it?
Thanks for the reply,
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
explain this program ?
can the cause of memory leak be detected here?
snmp4j variable bindings
snmp4j
about SNMP trap
More...