I need to monitor a Java process using SNMP i.e if the Java process is down it should send a Trap . Need help in how to use net-snmp to monitor the java process
My queries are for net-snmp:
Do I have to create a MIB for my Java process? How does the SNMP agent receive the status? Does it runs some script to collect the status report? Where should the script be configured? If I have the MIB file will it be sufficient to use with the SNMP agent or I have to write some scripts also?
Java can give you SNMP information by itself. See SNMP Monitoring and Management.
You need to activate it using the "com.sun.management.snmp.port" system propertie and an ACL file.
The problem is that it will not send traps if it crashes, you can only get "live/running" information.
To monitor the java process itself (is it live or dead, send a trap when crashing) you have to use an external tool such as Net-SNMP configured with the proc
directive and "DisMan Event MIB". See man pages for more information.