Well for that you have to use java bindings . There is a related library 
netsnmpj that provides java api for net-snmp and it supports agent x protocol . 
I have not used it but it would be very similar and the fastest way to get it 
going is to install it and run some examples or debug them , that would help 
you understand how to extend it so that it answers your queries. 
Regards

From: [email protected]
To: [email protected]; [email protected]
Date: Mon, 13 Feb 2012 07:12:25 -0500
Subject: RE: how to use net-snmp for monitoring java processes in linux








Thanks a lot waqas for your prompt reply. Is there a way i could do the same in 
java? I am sorry i was not very clear about our limitation to only use java. 
Keeping this in mind, what will
 be my way to go?



Sent from my HTC Touch Pro2 on the Now Network from Sprint®.




From: Mohammad Waqas Athar <[email protected]>

Sent: Monday, February 13, 2012 4:52 AM

To: Zain Mirza <[email protected]>; [email protected] 
<[email protected]>

Subject: 
RE: how to use net-snmp for monitoring java processes in linux







Well it seems like you have not seen any tutorials on net-snmp.
First of all you need to create mib files for all the parameters that you want 
to monitor.Then you have to extend your snmpd agent so that it answers request 
for your parameters.For this you have to use mib2c to generate code. Follow 
examples given here http://www.net-snmp.org/docs/man/mib2c.html
Then you need to compile your code as sub agent or dynamic loadable object
http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent
http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Dynamically_Loadable_Object



Once that is done you need to configure your snmpd.conf, run your agent and 
query your parameters. This is just the guideline . Please see net-snmp 
tutorial for a detailed info 
You can integrate file reading/writing or database in the code generated by 
mib2c.For this you need to see the above tutorials.With this your agent will be 
able to interact with db or file.







Regards





From: [email protected]

To: [email protected]

Date: Sun, 12 Feb 2012 19:58:36 -0500

Subject: how to use net-snmp for monitoring java processes in linux






Hi All,
 
I am very new to net-snmp. I have many hosts with each running few java 
processes. These processes have custom statistics which we want to be reported 
back to an SNMP server  for e.g. EM7. I started off by writing a separate 
“.mib” for
 each process and its scalar statistics. Now I have following questions to 
answer:
 
1-     
How do I feed these multiple .mibs( one mib for each process on that host)  to 
snmpd on that host?   
2-     
How does snmpd get configured to respond to a get for an individual statistic 
for a process?
3-     
How does the process communicate the statistics?
(For step 3, in my mind one of the following will be needed:

  a) i have to write add extra layer in my java processes that interacts with 
snmpd agent. If so how ? code examples?
 b) can I write some generic code which can be invoked by my snmpd to read some 
data repository (a file or db etc.). If so how and how can I integrate it with 
snmpd? Code examples?
c) I have to write sub agents? Do I also have to use AgentPro necessarily to 
generate java stubs for my mib files ? if so how do I plug them in to snmpd ?
 
 
I guess I do not have one clear way of implementing a solution. A feasible 
solution recommendation would really help me get around this. Since I have been
reading information in pieces but so far found no clear example on “how to 
monitor custom statistics of java processes on ” etc. to explain all the pieces.
 
Your prompt response will really help me in my endeavor and probably I can 
write that example for the rest of us with your help.
 
 



------------------------------------------------------------------------------ 
Try before you buy = See our experts in action! The most comprehensive online 
learning library for Microsoft developers is just $99.99! Visual Studio, 
SharePoint, SQL - plus HTML5,
 CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe 
now! http://p.sf.net/sfu/learndevnow-dev2

_______________________________________________ Net-snmp-users mailing list 
[email protected] Please see the following page to 
unsubscribe or change other options: 
https://lists.sourceforge.net/lists/listinfo/net-snmp-users







                                          
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to