Request: JDK scripts

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Request: JDK scripts

Post by benton2006 »

OS:Windows 2K Server
JAVA;JDK 1.5
I want to monitor cpu threads of Java processes. But in my system there have two java processed and both of them I need monitor . I have found its OID ( .1.3.6.1.4.1.311.1.1.3.1.1.7.1.14.4.106.97.118.97 ) . I use snmpwalk to query its data and it'll return three kinds of value ,one is 0 ,the other two are what I require(Every time I run snmpwalk,then get one value,for example First run snmpwalk and it get 0,the second and it get 1, the third it'll be 2). I have created a template but it always returns one value(not 0). How can I write this template? Thanks
Attachments
cacti_graph_template_xmlrpc_java_cpu_threads2.xml
(15.17 KiB) Downloaded 167 times
Last edited by benton2006 on Sat Oct 27, 2007 6:58 pm, edited 1 time in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

If only graphing a single (or two single) OIDs, please find help at http://docs.cacti.net/node/200
For a script returning more than one output, please refer to http://docs.cacti.net/node/203 instead
Reinhard
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Post by benton2006 »

Would you like to give me a method how to get rid of 0 and gain other two values ( using snmpwalk it will get one value ,but every time it is different and total three results). Thanks a lot
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Ok, so the OID may be part of an SNMP table. In this case, we need the unique index of that table. Please post the relevant part of the MIB for this OID to let me check the details. In this case, I need the "textual representation" that holds the descriptions I need for understanding.
Reinhard
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Post by benton2006 »

I installed SNMP4W2K.
Attachments
PERFMIB.rar
(24.23 KiB) Downloaded 178 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Oh, please no rar. (g)zip would be fine. And I only need the requested part, not the whole mib
Reinhard
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Post by benton2006 »

processThreadCount OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION
"The number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread."
::= { processprocessEntry 14 }
Attachments
Process-mib.TXT
(13.99 KiB) Downloaded 154 times
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Post by benton2006 »

Anybody can give me a hand ? so urgent
Thanks
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Post by benton2006 »

Thanks
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please perform an snmpwalk against

Code: Select all

.1.3.6.1.4.1.311.1.1.3.1.1.7.1.14
and return the whole result. Please repeat several times to see, if the index (everything following .1.3.6.1.4.1.311.1.1.3.1.1.7.1.14 on the OID) is always the same
Reinhard
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Post by benton2006 »

snmpwalk -v 1 *.*.*.* -c public .1.3.6.1.4.1.311.1.1.3.1.1.7.1.14
SNMPv2-SMI::enterprises.311.1.1.3.1.1.7.1.14.4.73.100.108.101 = INTEGER: 4
SNMPv2-SMI::enterprises.311.1.1.3.1.1.7.1.14.6.83.121.115.116.101.109 = INTEGER: 67

I tried many times and get one or two results. .1.3.6.1.4.1.311.1.1.3.1.1.7.1.14.4.106.97.118.97 isn't included . It should be no MIB in net-snmp. But it don't impact query by OID.
benton2006
Cacti User
Posts: 50
Joined: Sun Apr 01, 2007 12:47 am

Post by benton2006 »

I really appreciate your help.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

benton2006 wrote:snmpwalk -v 1 *.*.*.* -c public .1.3.6.1.4.1.311.1.1.3.1.1.7.1.14
SNMPv2-SMI::enterprises.311.1.1.3.1.1.7.1.14.4.73.100.108.101 = INTEGER: 4
SNMPv2-SMI::enterprises.311.1.1.3.1.1.7.1.14.6.83.121.115.116.101.109 = INTEGER: 67

I tried many times and get one or two results. .1.3.6.1.4.1.311.1.1.3.1.1.7.1.14.4.106.97.118.97 isn't included . It should be no MIB in net-snmp. But it don't impact query by OID.
If the snmpwalk does not give other results, even cacti won't see them. So if your waiting for .1.3.6.1.4.1.311.1.1.3.1.1.7.1.14.4.106.97.118.97 and it doen't come up, I have no clue
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest