JBoss snmp-adaptor Templates

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

Moderators: Moderators, Developers

Author
Message
gturner
Posts: 5
Joined: Tue Sep 26, 2006 5:47 pm

JBoss snmp-adaptor Templates

#1 Post by gturner » Tue Sep 26, 2006 6:18 pm

JBoss 3.2 and 4.0 all configuration includes an SNMP-to-JMX bridge which makes it quite easy and efficient for Cacti to poll statistics about particular MBeans which expose int/long-type attributes.

Out of the box the configuration file server/all/snmp-adaptor.sar/attributes.xml links several MBeans to allow Cacti to poll Java Memory, Threads, and the JBoss TransactionManager (number of commits/rollbacks/etc.).

I have created a Host Template, several Data Templates, and three Graph Templates for the aforementioned attributes that come configured by default (TransactionManager is particularly interesting).

Have a look at the JBoss wiki on snmp-adaptor for documentation about how to customize the MBeans exposed to SNMP.
Attachments
Cacti-JBoss-Templates.xml
JBoss SNMP Adaptor Host Template
(39.89 KiB) Downloaded 6046 times
Cacti-JBoss.png
Screenshot of the Graph Templates
Cacti-JBoss.png (117.77 KiB) Viewed 81403 times

ddigioia
Posts: 2
Joined: Fri Oct 06, 2006 4:36 pm

#2 Post by ddigioia » Fri Oct 06, 2006 4:50 pm

The graphs you generated with your templates look like exactly what I need.

Could you please elaborate a bit on how to install it?

I have Cacti configured, and monitoring several servers via SNMP, but I am not sure what to do with the file I downloaded from your post:

cacti_jboss_templates_140.xml

Thanks,
David

gturner
Posts: 5
Joined: Tue Sep 26, 2006 5:47 pm

#3 Post by gturner » Fri Oct 06, 2006 9:03 pm

On the Cacti side, you see the following items on the console menu:

Code: Select all

Devices
----------------
Graph Templates
Host Templates
Data Templates
----------------
Import Templates
Download the cacti_jboss_templates_140.xml file from this forum, and upload it to the Import Templates for in Cacti.

This file will create 3 Graph Templates (JBoss - Active Thread Count, JBoss - Memory Utilization, and JBoss - Transaction Manager), 1 Host Template (JBoss SNMP Adaptor), and 5 Data Templates (JBoss - Active Thread Count, JBoss - Free Memory, JBoss - Max Memory, JBoss - Transaction Commit Count, etc.).

Understand that the JBoss snmp-adaptor and NET-SNMP agents are separate SNMP Agent software listening on different ports, for instance you may have NET-SNMP on a host serving stats on UDP 161 and JBoss on 1161. For this reason you have to create additional Device entries for JBoss, even if you already have ucd/net SNMP Devices for the same hosts.

Just like your existing SNMP devices, go to the Device form and Add a new device, use a Description so you can discern it from the hosts' ucd/net SNMP Device counterpart, choose Host Template = JBoss SNMP Adaptor, and SNMP Port = 1161. After saving the Device, the form should display some generic SNMP information it obtained from JBoss, stuff like Location: In The Matrix and Contact: Agent Smith, however if you see SNMP Error you'll need to work on the JBoss installation detailed below (though you may continue the Create Graphs steps). Finally, again just like existing SNMP devices, you click Create Graphs for this Host and follow those steps for enabling the 3 Graph Templates for this host (checkboxes, save, confirm...).



On the JBoss side, you need to ensure the JBoss snmp-adaptor is enabled.

Since JBoss version 3.2.2, the snmp-adaptor service has been included in the all configuration, but I think you need to be running at least 4.0.4 to be able to GET SNMP data (prior versions were only concerned with Traps). Chances are you're using the default configuration rather than all which has lots of goodies like Clustering, HA-JNDI, etc. and takes 30 seconds longer to startup! JBoss installs running the all configuration talk to eachother using multicast packets, a bit over-the-top for a vanilla J2EE stack. Irregardless, if you're running the minimal or default configuration you can still copy the snmp-adaptor files from the unused all directory tree and get it to working (I haven't tested this with snmp-adaptor, but have done similar configuration with other JBoss components).

If necessary,

Code: Select all

cd /path/to/jboss
cp -pr server/all/deploy/snmp-adaptor.sar server/default
You can test that snmp-adaptor is working from the NET-SNMP command-line tool snmpwalk:

Code: Select all

snmpwalk -v 1 -c public localhost:1161 .1.2.3.4
There is an example MIB stored in server/all/deploy/snmp-adaptor.sar/attributes.mib. This may help you understand what statistics are available from JBoss, however it isn't utilized by Cacti whatsoever.

In general you can graph any JMX Attribute visible on the JMX-console (http://localhost:8080/jmx-console/), however you have to configure the file server/all/deploy/snmp-adaptor.sar/attributes.xml to specify additional attributes than the ones defined in this template. You can also configure JBoss to emit Traps based on JMX Notifications, though that's not really a Cacti thing.

There are a few wiki pages that document snmp-adaptor:
http://wiki.jboss.org/wiki/Wiki.jsp?pag ... NMPAdapter
http://wiki.jboss.org/wiki/Wiki.jsp?pag ... rGetValues


Hope that helps :wink:

ddigioia
Posts: 2
Joined: Fri Oct 06, 2006 4:36 pm

JBoss snmp-adaptor Templates

#4 Post by ddigioia » Tue Oct 10, 2006 3:04 pm

Thank you so much!

I had not noticed Import/Export in Cacti.

This is all the information I needed. Unfortunately, we are running JBOSS 4.0.3SP1 on the servers I need to monitor with Cacti, not 4.0.4GA, so I may need to use another monitoring method.

Thanks again, for the quick, complete response.

David :D

elieaz
Posts: 3
Joined: Wed Jul 05, 2006 4:43 am

i am not able to see graphs on the new device that i created

#5 Post by elieaz » Thu May 24, 2007 4:28 am

dear all i have made all the steps that you have said about but i am not able to see graphs on the new device that i have created

i tried to run snmpwalk
snmpwalk -v 1 -c public localhost:1161 .1.2.3.4
[[email protected]_server default]$ snmpwalk -v 1 -c public localhost:1161 .1.2.3.4
Timeout: No Response from localhost:1161

and i am getting SNMP error when i am creating the device

can you help

thanks

yip623
Posts: 7
Joined: Thu Aug 30, 2007 10:08 pm

U

#6 Post by yip623 » Thu Aug 30, 2007 10:16 pm

I can get the SNMP vale by command:

[email protected] rra]# snmpwalk -v1 -c public 192.168.0.201:1261
SNMPv2-MIB::sysDescr = STRING: Central Computer
SNMPv2-MIB::sysObjectID = OID: SNMPv2-SMI::enterprises.18016.1.1.2
SNMPv2-MIB::sysUpTime = Wrong Type (should be Timeticks): Gauge32: 392652
SNMPv2-MIB::sysContact = STRING: Agent Smith
SNMPv2-MIB::sysName = STRING: [email protected]
SNMPv2-MIB::sysLocation = STRING: In The Matrix
SNMPv2-MIB::sysServices = INTEGER: 64
End of MIB


I can see Cacti showed under http://192.168.0.199/cacti/host.php?action=edit&id=1001:

[email protected] (192.168.0.201)
SNMP Information
System: Central Computer
Uptime: Wrong Type (should be Timeticks): 432316 (0 days, 0 hours, 0 minutes)
Hostname: [email protected]
Location: In The Matrix
Contact: Agent Smith


However Cacti cannot draw the graph, and return the log:
08/31/2007 11:15:05 AM - CMDPHP: Poller[0] Host[1001] SNMP: Host did not respond to SNMP

Anyone can help me? Thanks

yip623
Posts: 7
Joined: Thu Aug 30, 2007 10:08 pm

#7 Post by yip623 » Fri Aug 31, 2007 1:03 am

I have some idea, result from console command

php /opt/app/apache/httpd_2.2.4/htdocs/cacti/poller.php
....
08/31/2007 01:49:30 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /opt/app/php/bin/php, ARGS: -q /opt/app/cacti/cacti-0.8.6j/cmd.php 801 801]
Error in packet.
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .0.1
....

How can I fix

gustavosoares
Posts: 5
Joined: Wed Sep 12, 2007 4:34 pm

#8 Post by gustavosoares » Thu Sep 13, 2007 11:10 am

Hi!

I am facing the same problem. I´ve run a tcpdump to check if the packet is being sent do right port

13:04:04.868242 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto 17, length: 64) riomp06ld01.globoi.com.8349 > 10.20.x.x.1161: [bad udp cksum 7f65!] UDP, length 36
13:04:04.868614 IP (tos 0x0, ttl 64, id 679, offset 0, flags [DF], proto 17, length: 64) 10.20.132.178.1161 > xxxx.globoi.com.8349: [udp sum ok] UDP, length 36

It seems that the problem is with snmp ping test that is done while through the poller script... Any help I would also appreciate...


Just for the record... the test runs ok

[[email protected] lib]$ snmpwalk -v 1 -c public 10.20.xx.xx:1161
SNMPv2-MIB::sysDescr = STRING: Central Computer
SNMPv2-MIB::sysObjectID = OID: SNMPv2-SMI::enterprises.18016.1.1.2
SNMPv2-MIB::sysUpTime = Wrong Type (should be Timeticks): Gauge32: 7066450
SNMPv2-MIB::sysContact = STRING: Agent Smith
SNMPv2-MIB::sysName = STRING: [email protected]
SNMPv2-MIB::sysLocation = STRING: In The Matrix
SNMPv2-MIB::sysServices = INTEGER: 64
End of MIB


Cheers,
Gustavo

gustavosoares
Posts: 5
Joined: Wed Sep 12, 2007 4:34 pm

#9 Post by gustavosoares » Thu Sep 13, 2007 4:26 pm

the problem is that the ping test inside $CACTI_HOME/lib/snmp.php is done using OID=.1. However, the snmp adaptor from Jboss hasn´t any entry for this OID.

If I run snmpwalk -v 1 -c public localhost:1161 .1 the result is as follow:

End of MIB
ccitt.1 = NULL

So... I could alter jboss configurations file to add this entry, however I would have to do that to each jboss that I install.. since I don´t wanna do that, I think that it would be better to edit the function cacti_snmp_getnext in $CACTI_HOME/lib/snmp.php to check if the port received is any of the ones that can be used by jboss (1161 or 1261 or 1361 or 1461 or 4161)and then set the $oid variable to ".1.3.6.1.2.1.1"

snmpwalk -v 1 -c public localhost:1161 .1.3.6.1.2.1.1

SNMPv2-MIB::sysDescr = STRING: Central Computer
SNMPv2-MIB::sysObjectID = OID: SNMPv2-SMI::enterprises.18016.1.1.2
SNMPv2-MIB::sysUpTime = Wrong Type (should be Timeticks): Gauge32: 8915097
SNMPv2-MIB::sysContact = STRING: Agent Smith
SNMPv2-MIB::sysName = STRING: [email protected]
SNMPv2-MIB::sysLocation = STRING: In The Matrix
SNMPv2-MIB::sysServices = INTEGER: 64
End of MIB

ports 1261 through 1461 can be used when you set jboss to use the Service Binding.

I really think that this isn´t an elegant solution.. but so far it solved my problem... :D anyone has a better idea?

Cheers,
Gus

yip623
Posts: 7
Joined: Thu Aug 30, 2007 10:08 pm

#10 Post by yip623 » Fri Sep 14, 2007 3:57 am

My problem solved.

Please try port 1261:
snmpwalk -v 1 -c public 10.20.xx.xx:1261

Or restart JBoss and observe the port by netstat -nl, you may find the port created by JBoss.

I don't know why it is using port 1261, even I set META-INF/jboss-service.xml with port 1161. If any idea, please explain. Thanks

gustavosoares
Posts: 5
Joined: Wed Sep 12, 2007 4:34 pm

#11 Post by gustavosoares » Fri Sep 14, 2007 8:05 am

maybe you are a using the service binding manager in conf/jboss-service.xml...

and you should set an oid in the snmpwalk command.. the ping test used by cacti use oid=.1, if you leave it blank it will retrieve the variable under system, which is the same as snmpwalk -v 1 -c public 10.20.xx.xx:1261 system

Cheers,
Gus

User avatar
za
Posts: 29
Joined: Thu Nov 09, 2006 10:39 am

Jboss Adaptor trouble

#12 Post by za » Fri Sep 28, 2007 7:53 am

Hi all.. i've some trouble with the SNMP Adaptor, maybe some smart cacti guru can help me!

Snmpwalk command work properly from command line as you can see

Code: Select all

snmpwalk -v 1 -c read-community -On 10.**.**.**:1161 .1.2.3
.1.2.3.4.1.1 = INTEGER: 573
.1.2.3.4.1.2 = Gauge32: 564992680
.1.2.3.4.1.3 = Gauge32: 2040135680
.1.2.3.4.1.4 = INTEGER: 0
.1.2.3.4.1.5 = INTEGER: 970455
.1.2.3.4.1.6 = Gauge32: 1005181
.1.2.3.4.1.7 = Gauge32: 358
.1.2.3.4.1.8 = Gauge32: 1
End of MIB
but i cannot display any graph, 'cause it seems that cacti cannot process the data sources of jboss devices.

I've checked in the poller cache[image in the bottom].. i'm wondering why if the paths of the rrd file are corrects in the poller cache, and there are no permission error on the rra folder, there isn't any row about jboss query in the log file, and obviously .. no graph!


Thanks ..

User avatar
za
Posts: 29
Joined: Thu Nov 09, 2006 10:39 am

Image.. of poller Cache

#13 Post by za » Fri Sep 28, 2007 7:56 am

The poller cache
Attachments
PollerCache.JPG
PollerCache.JPG (26.74 KiB) Viewed 75214 times

User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

#14 Post by divagater » Thu Apr 24, 2008 1:43 pm

I realize this is an old thread but for anyone wanting to use jboss snmp as shown in these templates you can do so without having to create a separate device due to the port the jboss snmp agent listens on. Instead, if you are using net-snmp you can proxy the requests. An entry like follows in your snmp.conf will do the trick:

Code: Select all

proxy -v 1 -c public localhost:1161 .1.3.6.1.3.10.1 .1.2.3.4
Now from my Cacti host I can do:

Code: Select all

snmpwalk -v 1 -c <community> <host> .1.3.6.1.3.10.1
And the correct results are returned. The request hits the jboss host on the default port 161 and proxies the request to jboss on port 1161.

Cheers,
Billy

mortensen
Posts: 2
Joined: Fri Jun 12, 2009 11:40 am

Jboss. Empty graphs on Linux and Win

#15 Post by mortensen » Fri Jun 12, 2009 12:01 pm

Hi Everyone!
I created graphs using template and this http://forums.cacti.net/viewtopic.php?t ... ight=Jboss guide.

I created it on 3 environments Windows, Ubuntu and RedHat - anyway chart created basis on those templates are not updated. I have SNMP device and device is properly connected. I see uptime, hostname from SNMP etc.
I do not use spine - standard Windows scheduler or crontab on Linux.
Other system graps are updated but not Jboss graphs.
It seems RRDTool do not process rrd files related to JBoss. On each OS I have other version of RRDTool so it seems problem is not in version.


Please give me any buzz what could be wrong.
Regards

Post Reply