User:Gimisa

From OpenSimulator

Revision as of 15:46, 24 October 2015 by Gimisa (Talk | contribs)

Jump to: navigation, search

I am opensim user and simulator operator sharing my notes so its usefull to others.  :


VOCABULARY: my understanding of the following terms.

   AIML: Artificial Intelligence Markup Language  is a specialised xml  with defined tag for conversational bot.
   ARC:  Avatar Rendering Cost, a relative figure that provide indication as to the load an avatar represent. 
   Child Avatar: A number of mirror avatar creates in adjacent region. This is the mechanism by which the viewer is aware of the other adjacent regions.     
   GRID: One ore more simulator (SIM) supported by one or more robust.exe instance. 
   MOP Media on prim: the possibility to present a web page content on the face of a prim. 
   OAR: Archiving file for region. 
   PARCEL a subdivision of a region minimum size is 4mx4m= 16 meter square
   REGION a 256mx256m = 65,536 meters square area in opensim
   REZ DATE: the day you register a new avatar in a grid. 
   SIMULATOR: also call SIM one opensim.exe instance running supporting one ore more region(s).
   STANDALONE: The simulator and the supporting  services are all run from one instance of opensim.exe 
   VARREGION: a region with variable dimension. At time of writing limited to square values of multiples of regions (ex. 4x4 = 16 region area) .  
   XENGINE: The opensim module responsible for of the script LSL / OSL  language use in scripting inworld with opensim.  


OAR.

I advocate the use of OAR for backup similarly to any other software file extension. I believe that creators in opensim shall be able to save their work as easily within their region as creating a document in word. For now you can do that with an object inworld and a opensim script command call osConsoleCommand(string command). That script command is high treat level as define in by opensim. Therefor it has to be authorize by simulator operator for parcel owner in the region simulator as follow: Allow_osConsoleCommand = PARCEL_OWNER or UUID You can also use the UUID of the simulator operator to enforce treat level and rez the object yourself for your guess to use. This script will automatically save an oar when the prim count change by more then 10 . OAR saving can also be initiated by touch. Here is an exemple of the script for such an object. :
   //gimisa@yahoo.fr 130502
   //oar saver rez on region you are owner 
   //see read.me for instruction
   //130502 add interaction with hud
   //gimisa@yahoo.fr 130120
   
   integer setup=FALSE;//Chnage to false to complete setup
   string dir="/home/gimisa/Bureau/oar/gimisa/";//the location where to sa ve the oar so your user can access it.
   //_________________________________
   key id = "598c76d4-a9d0-2fd6-0a81-fc72dca068b5";//default key 
   string idName="gimisa";
   key dtc;//detected avatar
   string region;//region name
   string cmd;//command
   integer ok;//status
   integer pcount;//number of prim cunt
   integer ppcount;//previous prim count
   integer flag=FALSE;//save oar flag
   
   //_________________________________
   integer dbug=FALSE;
   
   saveOAR(){
         region=llGetRegionName();
         ok=osConsoleCommand("change region "+ region);
         string tme=llGetTimestamp();
         llSay(0,"Region: "+ region);
         llInstantMessage(id,"saving oar " +dir+region + "."+tme + ".tgz" );  
         llSay(0, "please wait a few minutes to complete");  
         if(!setup) ok=osConsoleCommand("save oar " +dir+region + "."+ tme + ".tgz"); 
         osMakeNotecard(dir+region + "."+ tme + ".tgz","");//storgage is done by notecard name
         llSetObjectDesc((string)pcount);//count is store in object description  
   }
   
   sayPrimCount(){   
       llSay(PUBLIC_CHANNEL,
           "There are " + primCountThisParcel(PARCEL_COUNT_TOTAL) + " total prims on this parcel."); 
       llSay(PUBLIC_CHANNEL,
           primCountThisParcel(PARCEL_COUNT_OWNER) + " prims are owned by the parcel owner.");
       llSay(PUBLIC_CHANNEL,
           primCountThisParcel(PARCEL_COUNT_GROUP) + " prims set to or owned by the parcel's group.");
       llSay(PUBLIC_CHANNEL,
           primCountThisParcel(PARCEL_COUNT_OTHER) + " prims that are not set to the parcel group or owned by the parcel owner."); 
       llSay(PUBLIC_CHANNEL,
           primCountThisParcel(PARCEL_COUNT_SELECTED) + " prims are selected."); 
       llSay(PUBLIC_CHANNEL,
           primCountThisParcel(PARCEL_COUNT_TEMP) + " prims are temp-on-rez.");
       }
   string primCountThisParcel(integer flag)
   {
       vector currentPosition = llGetPos();
       pcount=llGetParcelPrimCount(currentPosition, PARCEL_COUNT_TOTAL, FALSE); 
       return
       (string)llGetParcelPrimCount(currentPosition, flag, FALSE);
   }
   
   default
   { state_entry(){
       id=llGetLandOwnerAt(llGetPos());
       idName=llKey2Name(id);
       llSetTouchText(idName);
       llSetSitText("-");
       llSetTimerEvent(1.);
    }
   
    
   touch_start(integer num_detected)
   {  dtc=llDetectedKey(0);
      if ( !(dtc==id | dtc ==llGetOwner())) {
      llSay(0, "sorry but only "+ idName + " can use this");
      return;} 
            
   sayPrimCount();//say in open chat prim counts of the sim 
   saveOAR();//save oar
   state wait;
  }
  timer(){
     llSetTimerEvent(1800.);
     ppcount=(integer) llGetObjectDesc();
     primCountThisParcel(PARCEL_COUNT_TOTAL); 
     if(pcount==0) return;
     if(ppcount==0){ ppcount=pcount;llSetObjectDesc((string)pcount); }
     if((pcount-ppcount>10 | pcount-ppcount<-10) && !flag){flag=TRUE; llSetTimerEvent(60.*15.);return;}
     flag=FALSE;
     llSetTimerEvent(3600.);
     if(!(pcount-ppcount>10 | pcount-ppcount<-10) )return;
     sayPrimCount();//say in open chat prim counts of the sim 
     saveOAR();//save oar  
     }
   }
   
   state wait {
        state_entry(){ llSetTimerEvent(5.0*60.);}
   
   timer(){ llSay(0,"will appear on FTP when complete");
        llSetTimerEvent(0.);
        llLoadURL(dtc, "OAR FTP SITE", "ftp://where.to.access.the.oar.file"); 
        llResetScript();}
   }


You can find a free copy along with a tutorial about oars and the object oarsaver in the little grid I operate for testing purpose call gimisaOS. You can reach it via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000

MOP.

Media on prim can be very interesting. The way to add a media on the face of a prim is straightforward selecting a prim face in the build tool and then activating the media of choice in the texture tab media selector ( varies with viewer). Se tutorial in gimisa5 tutorial area for more detail and picture. You should display a picture of some kind ( you can use the same prim by texturing it) as default texture to illustrate to your visitor that you are using media on prim. Most viewer disable the auto play of media prim forcing user to seek them for display. The advantage of Media on prim is that it has no impact server side since the viewer is handling the request via its internal browser. Please note that the view is asynchronous. Specially if video it meaning that what you see is not what other will see or hear on the same prim face. Just like if you are visiting the page by yourself on the web. The web browser in viewer is Mozilla compatible with QTWebKit. Therefor it has NONE of the HTML5 capabilities.
I am using MOP to overcome the sound limit in OpenSim. A sound file play in world is limited to 10 sec per file. One Technic use to overcome that limit is to cut a longer sound file in 10 sec sections and to piggy back the set with a proper script . That has a detrimental effect on your region cause of the bandwidth required to send the sound file in this way. The advantage is that the sound is heard by all avatar in the vicinity.
The way I use to do that is via MOP. The sound file can be built from any mixer software you like and can have any length. The trick is to convert it to swf (flash) so it can be compatible with any operating system (mac, window, linux ) . There is a number of online converter that will be fine for the job. The file need to be accessible to the web. That is a serious limitation to causal users unfortunately comment on the later as to how to do that direcly in opensim would be nice. Then you need a wrapper in the form of a standard web page with the following embed tag. <embed src="http://locationOfYourSoundFile/Here.swf" width="100%" height="100%" type="application/x-shockwave-flash" loop="false" autostart="true" > Sorry your viewer does not support flash (swf) </embed>
As a useful alternate in case your user viewer does not support swf is to provide a hyperlink giver on touch of the prim pointing to the same web page. In this way a HTML5 code wrapper can be use in your web page as follow:
<audio controls autoplay> <source. src="myOriginalFile.mp3" type="audio/mpeg"> <embed src="http://locationOfYourSoundFile/Here.swf" width="100%" height="100%" type="application/x-shockwave-flash" loop="false" autostart="true" > Sorry your viewer does not support flash (swf) </embed> </audio>
You can get a demo of the effect of this trick by hypergrid visiting 3d.gimisa.ca:9000 and search for gimisa4 region in map.



ARC.

ARC, Avatar Rendering Cost is an information the user should be sensitive too for a pleasant grid or hypergrid travel


The load an avatar represent in being rendered is an interesting figure to be considered by user. For local or hypergrid traveling the impact of the integration of avatar in the region scene is more or less loosely represented by that figure. This relative amount can be use comparatively as a guide for the amount represented by the avatar in rendering effort. In general the travelers should pack the avatar with as little as is needed to make a personality to minimise the load the region they are visiting. This is as much to have a pleasant experience for themselves as to help the experience of other by the same principles . They can put in their suitcase the travel avatar and the regular flashy model for convenience so they could switch while they traveling if they are in need to go to something more .
A good tool to judge the weight of one avatar is to use the avatar rendering cost display available in viewers. When activated with shortcut key ctl-alt-sht-C you are displayed a number over your head as well as avatar surrounding you . When green the avatar is good to travel. Yellow is limited while RED is no no. Its an interesting experience to make to remove part of an your avatar outfit and see the impact on that display. Good outfit part does show not only by the look they provide but also by the weight they represent for that results.
People should think about how much a traveling avatar has to transfer to the other grid (HG travel) server and how much information the region server has to handle to render the result they and other in the vicinity sees. This is all their texture, mesh and prim to be added to their scripts compiled. The few second required to render see a lot of activity both in the robust server and the region servers. This time is spent to acquiring that information (prim scultp mesh shapes , textures, compiled scripts) . The result is use to create the rendering information for the avatar and its numerous child avatars in the region and adjacent regions for the new arrival (max of 9).
More about avatar rendering cost calculation and detail can be read on "http://wiki.secondlife.com/wiki/Avatar_Rendering_Cost"



CHAT_BOT.

I use a number of way to interact with visitor. Making the visit more interactive can be a challenge to try to make the visit more interesting. Scripting provides the tool to do that and touch is the perfect function to trigger interactivity while not causing annoyance. Its also low on lag so this is my interactive function of choice. AIML is the language to give brain to your chat bot. Its interest is in the apparent two way communication it provide much like natural languages. There is script to do that inworld in lslWiki but scripting memory is too limited to do a good job so external service is required. I have tried that and will come back to it later.
What I found more intuitive and accessible using the dialogue blue box tool also offered with scripting . It is possible to construct with it a rather easy two way communication in the form of multiple choice discussion. That way is less interactive then a true conversational discussion but can be as attractive as a story book where you are the Hero. Using OSL notecard feature one can rig a notecard to provide for extensive exchange with the visitor. The line length of the OSL card is 1024 bytes ample for supporting multiple choices and trends in the discussion. The visitor reads the story line and make one choice out for the continuation. I use three choices the story direction can take but that is an arbitrary limit. And while at it why stopping to chat lines. The same tool can be use to hand out interactively LandMark, Object texture notecard and the like by refering to them in the story notecard. Add to it sound wave files of story and choice recording and you have a voice reader to accompany you visitor. Put that in a NPC (more about that in AIML) and you have the perfect guide to your exhibit. And top it with choice of language and you have a rather interesting interactive feature pack. A demo and code of that way of using interaction in opensim is available in gimisaOS my little test grid.
gimisaOS landing welcome have two demo Brat at the gimisaOS welcome sign and Joe at the OAR loader both you cant miss them. Joe has also voice in addition to the dialogue blue box both french / english .


I have considered AIML as stated above. There is an old script in lslwiki about AIML decoding done inworld. This methode is presented in ALICE chat bot web site http://www.alicebot.org/about.html. It was also integrated in Radegast text viewer . To my knowledge it never took ground in opensim/SL . I guess its cause the feasability is not there to search notecard bank having a few 100M typical for a bot to be somehow smart . You will find in opensim a well know bar tender bot using pandora bot.( http://www.pandorabots.com/) That bot can be easly configured to use an account you would create in pandora. But unfortunately the terms of service of pandora prevent you from doing so in the following terms:
5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Pandorabots, unless you have been specifically allowed to do so in a separate agreement with Pandorabots. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services.


What I did therefor is implement an external server. Unfortunately that make it not an application that can be easly implement by causual user compare to the pandora bot solution. The server use pyAiml a python aiml interpreter that is interrogated by the inworld bot to reply to visitor. I have added to it a personalisation notecard that overide the request to the external server for specific such as gimisaOS grid. Asking about the grid bypass the external request and get the reply from the notecard. You will find walking NPC all around the few region of my test grid . For instance, the dancer in welcome first floor , the lady around pise tower in gimisa5 the firewoman , the paramedic and the two astronaut in gimisa8 nasa exibit.
I dont know if explaining how the server is implemented is something of interest to opensim user platform but certainly an email asking for that information is something I would be glad to reply to.
You can reach the demos via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000 .

SCALING.

Scale a mesh can be rather spectacular at time. Any attempt will litteraly explode out the object and fill you screen with a mess.
Any builders know how to scale a prim. You select the build scale tool grap the guides and expend or contract the prim as you like. An other way is to change the x,y,z size of the object in the prim size data block just bellow position. In opensim the prim upper size limit is set in opensim.ini configuration file. The default size is 256m. But its possible to rez object that are already sized bigger then that. Naturaly scaling them after rezzing will cause the limit to be applied. Similarly scaling down is also limited. The opensim built in limit is 0.01m. That means that any attempt to change a prim x,y,z size to lower then 0.01 will fail and the scale change will not be applied . When you try to scale that low with the guides the scaling down stop and block at that point.
Now if the prim is part of a link set the discussion above also applies and that link will limit the scaling of the whole object when one of it child prims reach either the upper or lower limit imposed. To change the upper limit is rather simple if you have access to your opensim.ini. I have successfully use 512m and 1024m as upper prim size limits. But there is no way to change the lower size limit pass 0.01. There is trick to "see" smaller prim size by using partial transparencies. But when it comes to scaling an object down any prim that one of its dimension falls below 0.01 will block that scaling downward for the whole object so proportionality is maintained.
A mesh is imported as an object of a certain size.The imported size might be far different then its creation size in the 3d software. Regardless the above discussion applies. As long as there is no attempt to scale the mesh object simulator limits applicable are NOT imposed. A simple inspection of a linked set mesh will show that some of its links might contain element that are over the upper limit and or under the 0.01 lower limit. When trying to scale the object system limits will be enforced and if the mesh contain mesh link having smaller dimensions then 0.01 the size of the object will IMMEDIATLY be resized to fit the limit. I have seen case where the a mesh link original size is 0.001 for one of its dimension x,y, or z. This kind of situation will be leading to litteraly explode out the object with 10x scaling. and fill you screen with a mess.
The solution is easy. Inspect each element for size and correct any value lower then 0.01 up to at least that. Well that is nice for a mesh object with one to few links but what if we talking about few hundreds ( yes opensim can accept a lot of links no limit unless enforce in opensim.ini) . So the justification for a tool I did . The tool is a prim that you add to you link set. Then clic /touch. It will inspect each element of the linkset for size and correct any value lower then 0.01 up to at least that. The tool will confirm complete. You can then scale down. Unlink that tool and done .
You can get this tool via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000 .

XENGINE.

A strange situation happen to me on one region of my test grid. All scripts stop responding for two days. You can stop a script or a whole simulator script set from running by issuing a >> scripts stop command in sim console. This will stop all script and give you a list in console . A very useful debugging feature to know if you have offending script to pin point (more on that in following article) . You can also disable scripts in the debug tab of the estate manager window . These are perfectly normal way to have script not responding in region. That will be indicated by the missing run mark in the check box on the lower corner of the script edition window of any script in the simulator.
But that was not my problem , and I had no idea why it was acting like this . Yes I have added a few scripts more in the late days before that happen. But nothing that could explain a complete failure of xengine in my humble opinion. There was no log entry either to point me in the right direction. So here is what I tried.
1) in console script stop / script start
2) in estate window make sure script is enable
3) restart region from console
4) save oar of region and reload
5) search the net and mantis for xengine trouble

In all these case the script would run for a bit then would stop responding without warning nor indication at script level of not running state. Putty amazing is it.
In the trouble region the script will save normally with save script message appearing in both script window and blue warning. Running tag is normal on script window but no response from script and that is for any script in the region.
The main trouble to me is not a failure but mainly the lack of indication of what is happening in failure mode, at least with something in log or in console window.
I had backups I could roll back but the idea of experimenting is to take the opportunity of a failure to improve and learn so her was my solution for your benefit:

The solution is somewhere in http://opensimulator.org/wiki/XEngine

6)  ; How many threads to start at maximum load
MaxThreads = 100
XEngine will not start more than this many scripts, even if that means blocking script execution


I had 15 for maxThreads value which seem to be the default of opensim install.
Changing it to 100 prove to be a bit on the high side as I had region crash on low memory.
Trying 50 these days and it seem to hold ok.

A few facts should you be interested in details:

A)3d.gimisa.ca:9000 is the a 10 regions grid running under robust stable 0.8.1.
B)Robust and simulators are all served from same machine ubuntu 14.04.
C)Simulator are running from same set of files using alternate config ini.
D)Except for gimisa5 the trouble region , anything else is running normaly.
E)gimisa5 is the only region on its simulator.



SCRIPT PROBLEM.

Debuging and mainly finding offending scripts might be hard on users. An impossible task if one dont have console access. Window / Linux provides monitoring means of reporting CPU and/or memory usage. The TASK MANAGER for window and TOP for linux are well know ones among them.

So using such a tool , I notice on one of my simulator a high CPU rate while no one was on any region. Thinking it was a script running wild I used the inworld estate manager debug window to see if it could point me to the problem. It did had a script listing and I try it to disable the few mentionned. But it did not cure my problem. Still using estate manager I disable all the scripts. That had the expected effect of dropping CPU confirming script was the cause of the situation. But which one. I was left clueless. How could I possibly find and investigate the 1600+ scripts of my simulator . Searching google left me with a lot of links but no answers.

What I found useful in that case is to use the console script stop command. Yes it stop all script just like the estate manager disable. But more over it provides a listing of all script in the region. Its easy to copy that list and paste it in a spreadsheet. Then, and that is where it become interesting, its an other easy step to modify that spreasheet to add the script start console command prefix to each individual script entries and to save that file. Next, using the command-script console command, pointing to that file just created, run that file and restart ALL script . But more over one can fine tune, individually via prefix to each line of the speadsheet , which script to start, and stop.

Armed with that tool and using a well know iterative technic by trial an error, each time narrowing the number of scripts. I found the single script among the 1600 that had my CPU jump by 60% and correct it.


AGE - STAT

We are all getting older , really and virtual. Virtually you have a rez date , that is a date you created you avatar in a grid. That rez date for that grid derive your age measured in days and show up in your profile. The other day , in my little test grid , I had a new born HG visitor. This attracted my attention cause it peculiarly young to be hg jumping when first register into a grid. If you new to opensim even if former SL resident , HG jump is not something that come natural. Your first days in a new grid will usually be devoted to getting around and installed in your new world . So it intrigued me as to what is the age distribution of my visitors. I have a 30 days rolling graphic presentation of the number of visitor per day and daily tally time done with osl draw functions that you can check and grab in gimisa5 hypergrid dome . So I though why not add a plot of age distribution on it.

On grid that have profile activated in opensim.ini / robust.ini (see this for more detail http://opensimulator.org/wiki/UserProfiles) right clic on the avatar and asking for profile will give you avatar name including ,home grid url with port and born date and age in days and general profil data via profil tabs. To gather statistics you need to have access to those figures in scripts. For local user a script can access the born date via llRequestAgentData(key, DATA_BORN) ref: http://wiki.secondlife.com/wiki/LlRequestAgentData .

The problem is that no command exist that will provide you with that data for HG visitor. All the scripts can provide about HG visitors is the name with llDetectedName() script or llKey2Name or oslGetAgent(). It is possible from the name information to get the url of the avatar home location. With a bit more gymnastic using a xml_rpc request to the home server of the visitor you will finaly get the born date of the visitor coded as unix time stamp. That time can be translated using LlGetUnixTime into age in days. TADA!!! A demo of that solution is available in gimisa3 welcome.Just touch the age cube.

The problem in implementing this alternative solution is to obtain the port of the HG visitor home grid. That information existed a while back but has been obscured for reason of tag clarity. There does not seem to exist anymore any ways to obtain that information elegantly via any of the osl lsl scripting function. The information is only available via a database sql query of the user table as presented in the demo cube. But that solution cannot be implemented into the stat gathering graph as its not accessible to casual users.

PERFORMANCE

I know you probably know this . As you witness with experimented hoster for opensim they usually restart their region at frequent intervals. But how much important this practice is . Using linux top command I was able to obtain the following data after 24 days of opensim uninterupted operation of my little grid. top - 08:04:34 up 24 days, 2:54, 1 user, load average: 6.48, 5.68, 5.27

What does this mean. Well load average three numbers are for 1min 5min and 15min average of the load on the machine, The number themselves means the number of CPU cycle necessary to process the items in queue. So is 6.48 CPU cycles bad. No if you have 12 CPU to handle the task they will team up to take only 1 clock tick. But this is very bad if you only have 2 CPUs teaming as in my case . It translate into sluggish server response on teleporting to region and rezzing object. Script processing is also painfull.

Now what is happening after restarting the 4 simulator running on my computer. top - 12:00:04 up 24 days, 6:49, 1 user, load average: 1.36, 1.49, 1.66. Yes this is the same load, gimisaOS grid. Same 4 simulator with same content now takes up 1.66 15min average load a very acceptable value on a 2 CPU chips.

To restart you region you can use the estate manager window and on the debug tab you can hit the restart button. This function is accessible to any estate manager. For server system operator the console command region restart bluebox restart 15sec 15 will do a restart in the next 15 second. But these method will require your attention everytime you want to restart you region.

For an automated method one can use remote console command. This feature has to be enable in the opensim.ini . [RemoteAdmin] enabled = true port = 221 (select a port that in NOT open to external) access_password = "passwd" enabled_methods = all . I do this setup for my 5 simulators, from port 221 to port 225. Next you need a program to run the required command. I am using python as follows :
# Author : gimisa


#!/usr/bin/python 
import xmlrpclib 
import sys
#this is the UUID list of the region to restart

g1='c794b362-fb61-4bff-90b2-5fc273df7df8'
g2='30bb9b86-bae5-425b-8c55-02d788858953'
g3='772c0b5e-bf67-4ace-8b34-735f102f1aff'
g4='9b5c28de-5a07-4cd6-b3a6-c353d988b929'
g5='1285196d-4288-4ebc-a312-cbff001a6165'
g6='9d2d5dbe-2714-4df5-bfde-b2ad81505e06'
g7='1285196d-4288-4ebc-a312-cbff001a6167'
g8='1285196d-4288-4ebc-a312-cbff001a6168'
g9='d87ad5db-08eb-4c91-8004-3a057574aaa9'
gr='d87ad5db-08eb-4c91-8004-3a057574aaaa'


# XML-RPC URL (http_listener_port) 
simulatorUrl = "http://127.0.0.1:"+str(sys.argv[1])
# instantiate server object 
simulator = xmlrpclib.Server(simulatorUrl) 
#I am using port 221 to 225 for the 5 simulator
#for simulator 221 there is 4 regions for the others one simulator one region
if str(sys.argv[1])== "221" :
	simulator.admin_restart({'password': 'pass1', 'region_id': g1})
	simulator.admin_restart({'password': 'pass1', 'region_id': g7})
	simulator.admin_restart({'password': 'pass1', 'region_id': g8})
	simulator.admin_restart({'password': 'pass1', 'region_id': gr})
elif str(sys.argv[1])== "222" :
	print simulator.admin_restart({'password': 'pass2', 'region_id': g2})
elif str(sys.argv[1])== "223" :
	print simulator.admin_restart({'password': 'pass3', 'region_id': g3})
elif str(sys.argv[1])== "224" :
	print simulator.admin_restart({'password': 'pass4', 'region_id': g4})
elif str(sys.argv[1])== "225" :
	print simulator.admin_restart({'password': 'pass5', 'region_id': g5})



Next is to schedule that task. In my linux case this is through cron. Here is the cron file I am using to start this task every weekday as follows. 1 is monday ....5 is friday .

1 1 * * 1 root /home/gimisa/Bureau/python/remoteResart.py 221
2 1 * * 2 root /home/gimisa/Bureau/python/remoteResart.py 222
3 1 * * 3 root /home/gimisa/Bureau/python/remoteResart.py 223
4 1 * * 4 root /home/gimisa/Bureau/python/remoteResart.py 224
5 1 * * 5 root /home/gimisa/Bureau/python/remoteResart.py 225

Hope it helps 151019 gimisa@yahoo.fr

Personal tools
General
About This Wiki