RemoteAdmin

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (RemoteAdmin Commands)
(RemoteAdmin Commands)
 
(75 intermediate revisions by 18 users not shown)
Line 1: Line 1:
<div style="background-color:#ffa0a0; padding:15px">
+
{{Quicklinks}}
<b>Caution ! The RemoteAdmin feature is unsecured at this time. For testing uses only.</b>
+
</div>
+
  
== How to Setup the Remote Admin ==
+
== Introduction ==
  
=== Setup OpenSim ===
+
RemoteAdmin is an interface for simulators that allows various operations to be executed from outside the simulator.  '''Operations that relate to the simulator itself (e.g teleport user) are always available.  Those that relate to grid services (user creation and updating) are only available in standalone mode.  In grid mode, one has to use ROBUST level [[UserManipulation]] capabilities instead.'''
  
First you should enable the remote admin interface to do so just add the following lines to your OpenSim.ini file:
+
== How to Setup the Remote Admin interface ==
 +
 
 +
First you should enable the remote admin interface to do so just add the following lines to your OpenSim.ini file Port should be set to a nonzero value to have the remote admin on a different port
 +
 
 +
As of r/16843 you can limit access to remote admin to specific IP addresses by using the optional access_ip_addresses. You can list all IP's allowed to access remote admin by seperating each IP by a comma. If access_ip_addresses isn't set, then all IP addresses can access RemoteAdmin.
  
 
  [RemoteAdmin]
 
  [RemoteAdmin]
 
  enabled = true
 
  enabled = true
 
  access_password = secret
 
  access_password = secret
 +
enabled_methods = all
  
=== Example in Python ===
+
See OpenSim.ini.example in the OpenSimulator distribution for more details.
# Author  : DrScofield
+
# Source  : http://xyzzyxyzzy.net/2008/01/23/using-pythons-xmlrpclib-with-opensim/
+
# License : BSD License
+
+
#!/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′})
+
  
=== RemoteAdmin executable for Windows ===
+
=== Further options ===
  
The RemoteAdmin executable for Windows is a command line tool based on the RemoteAdmin PHP Class.
+
You can also specify a different port for the XMLRPCAdmin command listener from the default simulator HTTP port
  
Downloads and documentation on the [http://lab.newworldgrid.com/index.php/RemoteAdmin_Executable RemoteAdmin Executable webpage]
+
[RemoteAdmin]
 +
port = <port-number>
  
=== Example in PHP ===
+
== RemoteAdmin Commands ==
 +
<div style="background-color:#FFA0A0; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">
 +
'''Caution ! All commands using parameters for the uuid of a region use "region_id" as parameter. All other parameters eg. region_uuid or regionID will be removed after June 2012'''
 +
</div>
  
This example needs the RemoteAdmin PHP Class file available [http://code.google.com/p/opensimtools/wiki/RemoteAdminPHPClass here].
+
=== Agent management ===
<source lang=php>
+
*[[Remoteadmin:admin teleport agent|admin_teleport_agent]]
<?php
+
*[[Remoteadmin:admin get agents|admin_get_agents]] (post OpenSimulator 0.7.5)
  
// Author  : Olish Newman
+
=== User account management ===
// Source  : http://code.google.com/p/opensimtools/wiki/RemoteAdminPHPClass
+
*[[RemoteAdmin:admin create user|admin_create_user]]
// Licence : BSD License
+
*[[RemoteAdmin:admin create user email|admin_create_user_email]]
 +
*[[RemoteAdmin:admin exists user|admin_exists_user]]
 +
*[[RemoteAdmin:admin update user|admin_update_user]]
 +
*[[RemoteAdmin:admin authenticate user|admin_authenticate_user]] (not in 0.7.6.1)
  
// Including the RemoteAdmin PHP class. It can be downloaded from the link above.
+
=== Object management ===
include('RemoteAdmin.php');
+
  
// Instantiate the class with parameters identical to the Python example above
+
=== Parcel management ===
$myRemoteAdmin = new RemoteAdmin('127.0.0.1', 9000, 'secret');
+
  
// Invoke admin_broadcast
+
=== Region management ===
$parameters = array('message' => 'the answer is 42');
+
*[[RemoteAdmin:admin broadcast|admin_broadcast]]
$myRemoteAdmin->SendCommand('admin_broadcast', $parameters);
+
*[[RemoteAdmin:admin close region|admin_close_region]]
 +
*[[RemoteAdmin:admin create region|admin_create_region]]
 +
*[[RemoteAdmin:admin delete region|admin_delete_region]]
 +
*[[RemoteAdmin:admin modify region|admin_modify_region]]
 +
*[[RemoteAdmin:admin region query|admin_region_query]]
 +
*[[RemoteAdmin:admin restart|admin_restart]]
 +
*[[RemoteAdmin:admin shutdown|admin_shutdown]]
  
// Invoke admin_shutdown (example for use without parameters)
+
=== Region file management ===
$myRemoteAdmin->SendCommand('admin_shutdown');
+
* [[RemoteAdmin:admin load heightmap|admin_load_heightmap]]
 +
* [[RemoteAdmin:admin load oar|admin_load_oar]]
 +
* [[RemoteAdmin:admin load xml|admin_load_xml]]
 +
* [[RemoteAdmin:admin save heightmap|admin_save_heightmap]]
 +
* [[RemoteAdmin:admin save oar|admin_save_oar]]
 +
* [[RemoteAdmin:admin save xml|admin_save_xml]]
  
// Invoke admin_create_user (multiple parameters)
+
=== Region access management ===
$parameters = array('user_firstname' => 'Ruth', 'user_lastname' => 'OpenSim', 'user_password' => 'MyPassword', 'start_region_x' => '1000', 'start_region_y' => '1000');
+
* [[RemoteAdmin:admin acl list|admin_acl_list]]
$myRemoteAdmin->SendCommand('admin_create_user', $parameters);
+
* [[RemoteAdmin:admin acl clear|admin_acl_clear]]
?>
+
* [[RemoteAdmin:admin acl add|admin_acl_add]]
</source>
+
* [[RemoteAdmin:admin acl remove|admin_acl_remove]]
  
Note: This script does not appear to work for create user because it tries to pass the start region x and y as a string when the RemoteAdmin needs a string.  The class needs to be edited to pass it as a number or edit the remoteadmin source to convert the string to a unsigned int.
+
=== Estate management ===
 +
* [[RemoteAdmin:admin estate reload|admin_estate_reload]]
  
Another example in PHP5, using CURL.
+
=== Administration ===
<source lang="php">
+
* [[RemoteAdmin:admin console command|admin_console_command]]
//This is the slightly modified RPC-class of the BSD-licensed WiXTD webportal
+
<?php
+
class RemotePC {
+
  
function __construct() {
+
=== Misc (Undocumented) ===
        $this->serveruri = "http://myhost";
+
* [[RemoteAdmin:admin dialog|admin_dialog]]
        $this->serverport ="9000";
+
* [[RemoteAdmin:admin reset land|admin_reset_land]]
        $this->password ="foobar";
+
* [[RemoteAdmin:admin refresh search|admin_refresh_search]]
}
+
* [[RemoteAdmin:admin refresh map|admin_refresh_map]]
+
* [[RemoteAdmin:admin get opensim version|admin_get_opensim_version]]
function call($command,$parameters) {
+
* [[RemoteAdmin:admin get agent count|admin_get_agent_count]]
        $parameters['password'] = $this->password;
+
$request = xmlrpc_encode_request($command, $parameters);
+
$ch = curl_init();
+
curl_setopt( $ch, CURLOPT_URL, $this->serveruri);
+
curl_setopt( $ch, CURLOPT_PORT, $this->serverport]);
+
curl_setopt($ch, CURLOPT_POST, 1);
+
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1);
+
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $request);
+
curl_setopt ( $ch, CURLOPT_TIMEOUT, 5);
+
$result = curl_exec($ch);
+
curl_close($ch);
+
return xmlrpc_decode($result);
+
}
+
}
+
?>
+
</source>
+
 
+
== RemoteAdmin Commands ==
+
<table border="1" cellspacing="0" cellpadding="4">
+
<tr>
+
  <th>Name</th>
+
  <th>Status</th>
+
  <th>Description</th>
+
  <th>Parameters</th> 
+
</tr>
+
<tr>
+
  <td>[[remoteadmin:admin_create_region | admin_create_region]]</td>
+
  <td></td>
+
  <td>Create a new region</td>
+
  <td>region_name, region_master_first,
+
region_master_last, region_master_password, listen_ip, external_address</td>
+
</tr>
+
<tr>
+
  <td>[[remoteadmin:admin_delete_region | admin_delete_region]]</td>
+
  <td></td>
+
  <td>Delete a region</td>
+
  <td>region_name</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_region_query| admin_region_query]]</td>
+
<td></td>
+
<td>Query the 'health' of a region</td>
+
        <td>region_uuid or region_name</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_shutdown | admin_shutdown]]</td>
+
<td></td>
+
<td>Shut down the simulator</td>
+
        <td>''No parameter needed''</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_broadcast| admin_broadcast]]</td>
+
<td></td>
+
<td>Send a general alert</td>
+
        <td>message</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_restart| admin_restart]]</td>
+
<td></td>
+
<td>Restart Region</td>
+
        <td>regionid</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_load_heightmap| admin_load_heightmap]]</td>
+
<td></td>
+
<td>Load Height Map</td>
+
        <td>filename, regionid</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_create_user| admin_create_user]]</td>
+
<td></td>
+
<td>Create a new user</td>
+
        <td>user_firstname, user_lastname, user_password,
+
start_region_x, start_region_y</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_exists_user| admin_exists_user]]</td>
+
<td></td>
+
<td>Check whether a certain user account exists</td>
+
        <td>user_firstname, user_lastname</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_update_user| admin_update_user]]</td>
+
<td></td>
+
<td>Update the password/home of a user account</td>
+
        <td>user_firstname user_lastname user_password start_region_x start_region_y</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_load_xml| admin_load_xml]]</td>
+
<td></td>
+
<td>Execute the Load XML command</td>
+
        <td>filename region_uuid (or region_name)</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_save_xml| admin_save_xml]]</td>
+
<td></td>
+
<td>Execute the Save XML command</td>
+
        <td>filename region_uuid (or region_name)</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_load_oar| admin_load_oar]]</td>
+
<td></td>
+
<td>Load a saved OAR file into a region</td>
+
        <td>filename region_uuid (or region_name)</td>
+
</tr>
+
<tr>
+
<td>[[remoteadmin:admin_region_query| admin_region_query]]</td>
+
<td></td>
+
<td>Query the 'health' of a region</td>
+
        <td>region_uuid or region_name</td>
+
</tr>
+
</table>
+
  
== Credits ==
+
== Subcategories ==
Thanks to DrScofield for the Python Script
+
Sources : http://xyzzyxyzzy.net/2008/01/23/using-pythons-xmlrpclib-with-opensim/
+
  
 +
* [[RemoteAdmin:RemoteAdmin Examples|RemoteAdmin Examples]]
 +
* [[RemoteAdmin:RemoteAdmin Proposals|RemoteAdmin Proposals]]
 +
* [[RemoteAdmin:RemoteAdmin Standards|RemoteAdmin Standards]]
 +
* [[RemoteAdmin:RemoteAdmin Implement new command|RemoteAdmin How to implement new commands]]
 +
* [[RemoteAdmin:RemoteAdmin Class|RemoteAdmin Class]]
  
 
[[Category:Development]]
 
[[Category:Development]]
 +
[[Category:RemoteAdmin]]

Latest revision as of 12:24, 14 April 2017

Contents

[edit] Introduction

RemoteAdmin is an interface for simulators that allows various operations to be executed from outside the simulator. Operations that relate to the simulator itself (e.g teleport user) are always available. Those that relate to grid services (user creation and updating) are only available in standalone mode. In grid mode, one has to use ROBUST level UserManipulation capabilities instead.

[edit] How to Setup the Remote Admin interface

First you should enable the remote admin interface to do so just add the following lines to your OpenSim.ini file Port should be set to a nonzero value to have the remote admin on a different port

As of r/16843 you can limit access to remote admin to specific IP addresses by using the optional access_ip_addresses. You can list all IP's allowed to access remote admin by seperating each IP by a comma. If access_ip_addresses isn't set, then all IP addresses can access RemoteAdmin.

[RemoteAdmin]
enabled = true
access_password = secret
enabled_methods = all

See OpenSim.ini.example in the OpenSimulator distribution for more details.

[edit] Further options

You can also specify a different port for the XMLRPCAdmin command listener from the default simulator HTTP port

[RemoteAdmin]
port = <port-number>

[edit] RemoteAdmin Commands

Caution ! All commands using parameters for the uuid of a region use "region_id" as parameter. All other parameters eg. region_uuid or regionID will be removed after June 2012

[edit] Agent management

[edit] User account management

[edit] Object management

[edit] Parcel management

[edit] Region management

[edit] Region file management

[edit] Region access management

[edit] Estate management

[edit] Administration

[edit] Misc (Undocumented)

[edit] Subcategories

Personal tools
General
About This Wiki