monitoring J2EE application deployed in Tomcat using snmp

826 views Asked by At

I am going to write a J2EE application and application will be deployed in Tomcat. The requirement is that the server and the application must send snmp trap to external NMS. The details of my application is

  1. J2EE application
  2. Deployed in Tomcat v7
  3. The Server is Redhat Linux 6.2

We need to send trap for all the above 3 (For the application, Tomcat and the linux server).

Can we write our own agent using snmp4j for the above requirement and how will snmp agent know when to send trap to NMS?

Thanks in advance for support.

1

There are 1 answers

0
Karthik Prasad On

Yes you can for that you need to extend the logger framework. For Instance you can use logback framework. where you can extend the logging with CustomAppender where you can write snmp-agent code and forward the log as an trap. Moreoever logback has nice and easy way to format, deny log if not necessary other other feature. And you can change the tomcat logging to logback is simple steps. However I'm not sure if you can really send a trap for any issues on linux server. I believe it would be a tedious task. You might look for some syslog server monitoring feature.