Announcement

Collapse
No announcement yet.

VrayDR (start/stop) utility

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #91
    Can you start a command prompt, and type:
    replacing the render1 with a name of a system you are trying to edit.

    Code:
    C:\>psservice \\render1 stop "VraySpawner 2009"
    
    PsService v2.21 - Service information and configuration utility
    Copyright (C) 2001-2006 Mark Russinovich
    Sysinternals - www.sysinternals.com
    
    SERVICE_NAME: VraySpawner 2009
    DISPLAY_NAME: VRaySpawner 2009
    (null)
            TYPE              : 10 WIN32_OWN_PROCESS
            STATE             : 3  STOP_PENDING
                                   (STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
            WIN32_EXIT_CODE   : 0  (0x0)
            SERVICE_EXIT_CODE : 0  (0x0)
            CHECKPOINT        : 0x0
            WAIT_HINT         : 0x0
    Thats really all the app does, is replace the \\computername with your selected comp from the list for various different somewhat useful command lines. So if it works from the command line, but not from the app, then thats a different issue from not working altogether.
    Dave Buchhofer. // Vsaiwrk

    Comment


    • #92
      Originally posted by dbuchhofer View Post
      so what i did was launch it instead by
      Code:
      psexec -u DOMAIN\Login -p password -i -d cmd.exe /c start "c:\program files\Realvnc\winvnc\winvnc.exe" "c:\program files\Realvnc\winvnc\winvnc.exe"
      so it used the login and pass to launch the remote cmd.exe, but then used the local system privileges with the start command.. allowing it to have full network and desktop interaction privileges.

      that i think does pretty much the same thing your batch file does.. So maybe we can just adjust the command line a little and have our mapped drives back! yay!
      Hello dave,

      I tried to type that line of command directly from my pc:
      Code:
      psexec \\render20 -u  login -p password -i -d cmd.exe /c start "net use n: \\pathtomap pwd /user:login" "C:\Program Files (x86)\Autodesk\Backburner\server.exe"
      It actually launches the server distantly but doesn't have the mapped drive.
      My distant .bat does exactly the same thing but it keeps the cmd window opened distantly while server is running (so maybe that is why the drive letter STAYS mapped?)
      So maybe i did something wrong

      Comment


      • #93
        I seem t have got this working on 5 of our 8 render slaves, but the last 3 are giving me problems. Odd, as they are all essentially the same spec with identical installations. When I manually run:-

        C:\windows\psservice \\192.168.0.208 stop "VraySpawner 2009"

        from the command line one one of these offending machines (IP address as above) I get:

        Unable to connect to \\192.168.0.208:
        Access is denied.

        What should I be looking for to enable access (assunming this is the problem)?

        ------------------------
        Also, the other two tools that would be useful to get working are the Shutdown and Reboot tools. Unfortunatly, they don't seem to work and I just get the command line window open up and hang with the PcShutdown v2.41 title in it. Any ideas on this as well?
        Last edited by tricky; 03-12-2008, 04:30 AM.
        Kind Regards,
        Richard Birket
        ----------------------------------->
        http://www.blinkimage.com

        ----------------------------------->

        Comment


        • #94
          smax, I'd search online for the 'start dos' command, and play with that locally until it replicated the batchfile if you want to do it that way.. I dont re-attach my network drives so I haven't run into that problem, its just been mapped for the past few years!

          or just adjust the vbscript to launch the batchfile for your case since should be as easy as replacing the "-i -d server.exe" string with the "-i -d \\path\to\batchfile.bat" in the Sub StartMaxNetProcess in the hta. edit: i should qualify, that the batchfile needs to be reachable from the slave machine, as its run ON that machine.

          Tricky, I'm not sure about that, I haven't run across that one before, except for possibly the simple file sharing problem that someone talked about earlier in the thread?

          You may also try starting the service with a login permission
          Code:
          C:\windows\psservice \\192.168.0.208 -u Domain\Login -p password stop "VraySpawner 2009"
          to see if its a permissions issue..

          also check to see if the Windows Management Instrumentation service is started on the problem remote machines.
          Last edited by dbuchhofer; 03-12-2008, 09:28 AM. Reason: clarify.
          Dave Buchhofer. // Vsaiwrk

          Comment


          • #95
            Hello Dave,

            I got a present for you.
            I modified your code to enable a clean display of the computers list:
            Your computers.ini should now look like this:
            Code:
            #Manager
            computer1
            #RenderFarm
            computer2
            computer3
            #Workstations
            workstation2
            workstation3
            Any "#" introduces a group of machines, resulting in a cleaner display.

            Here is the code that i modified in the .hta (starts around line 52)
            Code:
            '*** Check computers available.. if no file, create file
            
                Set objFSO = CreateObject("Scripting.FileSystemObject")
                if objFSO.FileExists(strComputersFile) Then
            	    Set objFile = objFSO.OpenTextFile(strComputersFile, ForReading)
                	dim dadElt
                	Do Until objFile.AtEndOfStream
                		
                		'**set oGroup = document.createElement("optgroup")
                    	strLine = objFile.ReadLine
                    	if(InStr(strLine,"#") <> 0) then
                    		set dadElt = document.createElement("optgroup")
            						dadElt.label = strLine
            						AvailableComputers.appendChild(dadElt)     	
                    	Else
            		        Set objOption = Document.createElement("OPTION")
            		        objOption.Text = strLine
            		        objOption.Value = strLine
            		        AvailableComputers.Add(objOption)
            	        End If		      
            	    Loop
            	    objFile.Close
            	Else
                        '*** what's after is the same
            Hope you'll like it.

            Now it's a very useful tool, although one big important feature is missing:
            - Monitoring of the servers and spawners (current state)
            (like a green icon next to the computername when the process is running etc...)

            First of all , does pstools offer that possibility ? Secondly would it be long to code ? (i can try)

            This would become a great freeware ! (i would donate through paypal ! )
            Thank you very much,

            Marc (SMaX)

            Comment


            • #96
              It seems to work when I put in the domain/user/password etc stuff in there from a command line. The odd thing is, all the 8 machines have the same domain/user/password, so why it doesn't work on these three machines is strange.

              How should I modify the code to allow this to work on them all?

              Thanks again BTW!
              Kind Regards,
              Richard Birket
              ----------------------------------->
              http://www.blinkimage.com

              ----------------------------------->

              Comment


              • #97
                Originally posted by smax View Post
                I modified your code to enable a clean display of the computers list:
                Code:
                 -- code!
                Hope you'll like it.
                Thanks Marc! that's pretty useful, easier to select everything now

                Originally posted by smax View Post
                - Monitoring of the servers and spawners (current state)
                (like a green icon next to the computername when the process is running etc...)

                First of all , does pstools offer that possibility ? Secondly would it be long to code ? (i can try)
                I experimented on how to work that out and just decided it wasn't worth the effort at the time. its possible to check whether a process is *running* with a little dos trickery (pslist | find "server" > temp.txt) and checking the contents of temp.txt

                The problem is, and the one I'd rather have, is there's no easy way to check whether a process is running at a certain %age (IE: how to check whether you are rendering) without installing something on the slave machine that tracks that, as in with the ReFaMo app. which revelation got me more interested in programming and scripting and less in killing time in vbscript

                you can check if a process is running with a little vbs function to read from the remote WMI:
                Code:
                Function IsProcessRunning( strServer, strProcess )
                    Dim Process, strObject
                    IsProcessRunning = False
                    strObject   = "winmgmts://" & strServer
                    For Each Process in GetObject( strObject ).InstancesOf( "win32_process" )
                	If UCase( Process.name ) = UCase( strProcess ) Then
                            IsProcessRunning = True
                            Exit Function
                        End If
                    Next
                End Function
                what i dont know how to do is set it up so it runs on a timer, and its also dealing with timeouts from not being able to connect to wmi is painful, so you then have to work out a ping script to see if the machine you want to connect to via wmi is even online
                have code from a cscript, but unsure whats needed to convert that to work with a basic hta or exe application
                Code:
                'pings a server, saves results to a temp file, and reads file looking for replys
                Function Reachable(HostName)
                     Dim wshShell, fso, tfolder, tname, TempFile, results, retString, ts
                     Const ForReading = 1, TemporaryFolder = 2
                     Reachable = false
                
                     Set wshShell = wscript.createobject("wscript.shell")
                     Set fso = CreateObject("Scripting.FileSystemObject")
                     Set tfolder = fso.GetSpecialFolder(TemporaryFolder)
                     tname = fso.GetTempName
                     TempFile = tfolder & tname
                     wshShell.run "cmd /c ping -n 3 -w 1000 " & HostName & ">" & TempFile,0,true
                     Set results = fso.GetFile(TempFile)
                     Set ts = results.OpenAsTextStream(ForReading)
                     Do While ts.AtEndOfStream <> True
                          retString = ts.ReadLine
                          If instr(retString, "Reply") > 0 Then
                          	WScript.Echo(HostName & " --- Ping reply: " & retString)
                               Reachable = true
                               Exit Do
                          End If
                     Loop
                     ts.Close
                     results.delete
                
                     Set ts = Nothing
                     Set results = Nothing
                     Set tfolder = Nothing
                     Set fso = Nothing
                     Set wshShell = Nothing
                End Function

                Back to the 'Is the machine rendering' problem, I opted to just create a callback script that's in each machines startup directory that outputs a blank text file with that machines name to a certain network directory.. That way when a machine is rendering, if its running in a slave mode, and its settings has distributed rendering checked, then it creates a temp file in that directory.

                Code:
                --adjust the //fileserv/dmg/frames/DR_SERVER_STATUS/ string to be not my server if you wish to use this ;)
                
                callbacks.removescripts id:#DRRenderStatus
                
                txt = "statuspath = \"//fileserv/dmg/frames/DR_SERVER_STATUS/\" \n"
                txt += "filename = sysinfo.computername \n"
                txt += "try(deletefile (statuspath + filename + \".txt\"))catch() \n"
                
                callbacks.addscript #postRender txt id:#DRRenderStatus
                
                txt += "statuspath = \"//fileserv/dmg/frames/DR_SERVER_STATUS/\" \n"
                txt += "filename = sysinfo.computername \n"
                txt += "dr_status_file = createfile (statuspath + filename + \".txt\") \n"
                txt += "format \"Job Started at: %\" localtime to:dr_status_file \n"
                txt += "close dr_status_file \n"
                
                callbacks.addscript #prerender txt id:#DRRenderStatus
                I never added that into the slave utilities though as I'm really cut and paste proficient with vb

                I do have a maxscript that'll check that stuff to let me know which workstation is rendering and which machines are in use for DR though
                Last edited by dbuchhofer; 03-12-2008, 12:41 PM.
                Dave Buchhofer. // Vsaiwrk

                Comment


                • #98
                  I also have interest in a couple people to test out a MAXScript version of the tool that i had created a few months back before I do a general release.. if you want to give it a try email me at dbuchhofer@gmail.com
                  Dave Buchhofer. // Vsaiwrk

                  Comment


                  • #99
                    Well, here's the info for the script above if anyone cares to try it out. similar to the HTA, just a bit easier to maintain.

                    This handles the services perfectly for me here, I’m doing a little more work on it to support using the server.exe and vrayspawner exe versions as well, but that wont be finished for a while as its a spare time project. I’m really looking for feedback in terms of platforms you’re looking to use it on, and what features would be nice to see in addition.


                    Click here to Download

                    Install is pretty straightforward, simply unzip into your Scripts directory.. after a bit more testing for various people I’ll throw together an installer, but for now its slightly manual.

                    after you unzip it, assuming your max is installed in say, C:\3dsmax08\ you should see several files

                    Maxscript files: Access them as Maxscript Pulldown, Run Script.
                    C:\3dsMax08\server_tool_lite_05.mcr — Run this to install the script into the Customize UI, under category dbScripts.
                    C:\3dsMax08\ServerUtilities\server_tool_lite_05.ms — Run this to try out the tool without installing it into the Customize ui..

                    C:\3dsMax08\ServerUtilities\… There will be a few other exe’s in this directory, mostly commandline utilities that the script calls to batch modify things.

                    After you run the script the first time, it will create a file C:\3dsMax08\ServerUtilities\ServerToolLite.ini which will save your settings. In the script, it might be easier for you to add 1 server, and then browse to the ServerToolLite.ini file and manually add the other 19 servers in notepad.

                    Cheers,
                    Dave
                    Dave Buchhofer. // Vsaiwrk

                    Comment


                    • Hi Dave -

                      Just giving your script a try, but haven't used any of the other versions before. I've tried adding just one node but I'm getting 'access denied' everytime I try and hit the spawner service. Do I need anything special installed or opened up on the slave nodes?

                      I literally followed the few directions you gave for your script, but have done nothing else. I am not sure how much of the previous 10 pages apply to this version

                      In any case, it looks like a cool tool - thanks very much for sharing it!!

                      b
                      Brett Simms

                      www.heavyartillery.com
                      e: brett@heavyartillery.com

                      Comment


                      • I should point out that I can access the machines in VNC through your script - so they are accessible from within the interface, it just won't let me do anything else.

                        Thanks,
                        b
                        Brett Simms

                        www.heavyartillery.com
                        e: brett@heavyartillery.com

                        Comment


                        • Add Start System Button

                          Hi Dave, i like your Hta version of this script and i was playing around with the code to add more functionality....exactly a StartSystem Button using the wol.exe cmd utility (http://gammadyne.com/cmdline.htm#wol). It must be copied in windows root directory like the rest of pstools. If i create MAC.ini file and HTA with only StartSystem Button , in left column the MACs beeing displyed the code works... Here is the sample

                          Code:
                          ForReading = 1
                              ForWriting = 2
                              strMACFile="Mac.ini"
                          
                          
                              Set objFSO = CreateObject("Scripting.FileSystemObject")
                          	Set objFile = objFSO.OpenTextFile(strMACFile, ForReading)
                              	   Do Until objFile.AtEndOfStream
                                  	strLine = objFile.ReadLine
                          	        Set objOption = Document.createElement("OPTION")
                          	        objOption.Text = strLine
                          	        objOption.Value = strLine
                          		AvailableMAC.Add(objOption)
                          	    Loop
                          	    objFile.Close
                          
                          
                          Sub StartSystems
                          For i = 0 to (AvailableMac.Options.Length - 1)
                                  If (AvailableMac.Options(i).Selected) Then
                                  	strMAC = AvailableMAC.Options(i).Value
                          
                          		Set objShell = CreateObject("Wscript.Shell")
                          objShell.Run _
                              ("%comspec% /k title WIndows Start |wol " & strMAC & " "), _
                                  1, TRUE
                          ****Change /k with /c when the final version of the script is working to close the cmd windows  after execution.Use /k to see if the packet was sent
                          ****The MAC.ini must contain the mac adress without "-", eg.0B508db2e5d8
                                  End If
                          Next
                          End Sub

                          I wanna do this without creating another column in the script with MACs.I was thinking about creating a computer.ini file with 2 items on each lines(IP,MAC) and then spliting the information using array

                          e.g
                          Code:
                                          strLine = objFile.ReadLine
                          		MyArray = Split(strLine, ",")
                          		set strComputers=MyArray(0)
                          		set strMAC=MyArray(1)
                          But i'm new to vbs and i'm stuck.Can u integrate this in this in the hta version of the script?

                          Comment


                          • Hi Dave,

                            I've been trying out your script on our farm and have had success using it to stop processes and services, however I cannot get it to start either DR or Backburner Server.

                            We're running Windows XP 64 and Max 2008. When I try to start the services on 127.0.0.1 it works great, however when I try to access any other machine on the network it won't work. The error message given in the DosBox (before it quickly dissapears) says that

                            "PSExec could not start C:\Progra~1\Autodesk\3dsMax~1\vrayspawner90.exe on HKG-FARM01: The parameter is incorrect."

                            However when i type in this command into DosBox on one of the farm machines it does run Vrayspawner:

                            "psexec \\Compname -i -d -u DOMAIN\Login -p password c:\progra~1\3dsmax~1\vrayspawner90.exe"

                            (obviously with the correct farm name and username/password)

                            It's all a bit confusing. Any ideas?

                            Comment


                            • Dave

                              Hi

                              running the MCR file crashes MAX (2009 64bit WinXP 64)
                              Tried several times .


                              Nir
                              3ds Max 2016/2021 (Vray 5.005), Windows 10 64bit , AMD 32/64 Cores, 128 gigs RAM , 2X GTX1070 8GB RAM

                              Comment


                              • Here's a little update to the maxscript version of the tool, nothing too fancy, i just found myself wanting the vrayRTspawner service in the list, so here are the main changes:

                                http://www.scriptspot.com/3ds-max/server-utilities

                                Code:
                                -- .75 - added vrayRT service
                                -- .75 - convert to simpler doscommand style execution
                                -- .75 - added an optional pause to the end of the commandline based tools
                                -- .75 - fixed the invert button in server selection
                                -- .75 - prints the commandline to the listener
                                -- .75 - Added installer and uninstaller
                                Can't say as I've touched the hta/vb version in a long while, i know its a bit out of date in terms of which directories and services it defaults to, if anyones still using it regularly i can take a peek at it.
                                Last edited by dbuchhofer; 04-12-2009, 05:29 AM.
                                Dave Buchhofer. // Vsaiwrk

                                Comment

                                Working...
                                X