Jump to content

Reboot server & monitor remotely


Stealth

Recommended Posts

Hey all,

I'm developing a small web page that will run on our PDA's so that we can do some server rebooting, deleting etc on the move ... tcadmin web interface is too in depth for a PDA and often gives up with all the javascript!

 

Luis was kind enough to provide a script to delete servers, the thing is nearing completion and to finish off i would like to be able to restart a tcadmin monitor, or the whole machine via a web page - as i mentioned above the tcadmin web panel is not ideal in this case but sadly i cannot find anything in the SDK about running a tcascript on the masterserver to reboot a remote server - the only script i can find which is included with tcadmin will reboot the machine that the script is started on.

 

Could anyone provide help? I'd really like to add this feature to do soft reboots as we dont give our staff that level of access!

 

Many Thanks in advanced!

-Paul

Link to comment
Share on other sites

This script restarts the server with the id you specify. To restart the monitor change "RestartServer" to "RestartMonitor"

 

<tcascript>
<language name="VB" />
<waitForUserAction value="false"/>

<scriptCode><![CDATA[

Imports System

Public Class RestartServer
    Public Shared Sub Main()
Dim serverid As String = "TCXXXXXXXXXXXXXXX"
       Dim serverUtil As TCAdminBase.Plugins.IGenericPlugIn = TCAdminSDK.Remote.InstanceCreator.GetPluginFromServer(serverid, "TCAdminMonitor.StandardPlugins.RemoteServers.ServerUtilities")
       If serverUtil Is Nothing Then Throw New Exception("Could not create server plugin.")
       If serverUtil.Execute(New Object() {"RestartServer"}) Then
           Console.WriteLine("The server is restarting.")
       Else
           Console.WriteLine("Error while restarting server.")
       End If
    End Sub
End Class

]]></scriptCode>

</tcascript>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use