I seemed to have found the answer, what I was doing wrong was that, the RMI connxn was not being initialized correctly to the server.
Below is a small snippet which worked for me.
from java.util import Properties
from java.lang import System
from javax.naming import InitialContext
from javax.management import NotificationListener,ObjectName,MBeanInfo,MBeanAttributeInfo
print "Will it work :("
props = Properties(System.getProperties())
ctx = InitialContext(props)
adapterName = "jmx/invoker/RMIAdaptor"
server = ctx.lookup(adapterName)
name = ObjectName("jboss:service=JNDIView")
info = server.getMBeanInfo(name)
print "JNDIView Class: " + info.getClassName()
print " "
aValue = server.getAttribute(name,"HANamingService")
print "Value of HANamingService is::: " + aValue
print "It worked Bye Bye! :)"
This made the communication with the MBean server and fetched me a dummy value of the configured MBean.
This is great. I've been considering doing some similar monitoring and would rather wrap things in a single script than calling twiddle.sh over and over again. Do you have any more code you'd be willing to share and/or links to the resources you used to get this far?