using python's xmlrpclib with OpenSim

this morning ansi and i were wondering how we could do XmlRpc calls to OpenSim. well, this is what we found out:

to have a reasonable XmlRpc experience™ you should enable the remote admin interface, to do so just add the following lines to your OpenSim.ini file:

        [RemoteAdmin]
        enabled = true
        access_password = secret

next open up your-editor-of-choice™1 and use the following piece of python code2

[python]
#!/usr/bin/python
import xmlrpclib

# XML-RPC URL (http_listener_port)
gridServerURL = 'http://127.0.0.1:9000'

# instantiate server object
gridServer = xmlrpclib.Server(gridServerURL)

# invoke admin_alert: requires password and message
gridServer.admin_broadcast({'password': 'secret', 
                         'message': 'the answer is 42'})
[/python]

run and you should see on OpenSim’s region console:

[RADMIN] [01-23 04:17:10] Broadcasting: the answer is 42

and, of course, an alert popup in your SL viewer:

message from god


  1. yep, found the “™” key combination for my keyboard ;-) 

  2. i’m using a standalone OpenSim installation.