Kaseya Community

Server Maintenance Script Failing

  • Normal 0 false false false EN-US X-NONE X-NONE

    We are having a problem with a particular script not running correctly.  We have the sample procedure entitled “2 – Server Maintenance” running on a server every Saturday at 4:00 A.M.  It’s been failing and we haven’t been able to isolate why.  We’ve given it a reboot.  We’ve removed the procedure and re-applied it at the same time.  We’ve removed it and re-applied at a different time as well.  I’ve looked through the code in the script itself, and it’s really basic and the code is fine.  It simply calls and runs three separate procedures and then finishes.  The error we’re getting is “FAILED in processing THEN step 1, Execute Script, with error Script Not Found”.  Any ideas?

     

    P.S. The script is as follows:

    <?xml version="1.0" encoding="utf-8"?>
    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">
      <Procedure name="2 - Server Maintenance" treePres="3" id="1401" folderId="44217722597144146571961452">
        <Body description="This is a master procedure that runs several procedures for servers. Use this procedure as part of your Servers SLA. This should be the only procedure that you schedule for your servers. If you want to include more executions of additional tasks add a step to this procedure.">
          <If description="This is a master procedure that runs several procedures for servers. Use this procedure as part of your Servers SLA. This should be the only procedure that you schedule for your servers. If you want to include more executions of additional tasks add a step to this procedure.">
            <Condition name="True" />
            <Then>
              <Statement name="ExecuteScript" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="ScriptID" value="1435" />
                <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
              </Statement>
              <Statement name="ExecuteScript" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="ScriptID" value="1414" />
                <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
              </Statement>
              <Statement name="ExecuteScript" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="ScriptID" value="1457" />
                <Parameter xsi:type="StringParameter" name="ScriptName" value="Set Time Server" />
                <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
              </Statement>
              <Statement name="WriteScriptLogEntry" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Comment" value="Server maintenance procedure completed successfully." />
              </Statement>
            </Then>
          </If>
        </Body>
      </Procedure>
    </ScriptExport>

  • The error is telling you that the first procedure called - titled 1435 above is not there.  I'd edit the procedure and check the that one being called is there.  I'd also try running that procedure on it's own to see if it works.

  • I figured that was the case.  The first two scripts in this procedure are identified by number and no name.  If you look at the third script called, there is a "scriptname" variable that is assigned "Set Time Server".  This looks just fine in my Kaseya procedure window.  The first two are just identified with an ID, however.  There is no name that is assigned to them, so as far as I can tell there is no way to identify the first two scripts that are called to even see if they will run or are broken.  I feel like I could assing that scriptname variable myself and fix it if I knew which scripts it was trying to call.  Is there any way to figure out the name with just the script ID that is listed for the first two scripts?

  • Does this help?

    <?xml version="1.0" encoding="UTF-8"?>

    -<ScriptExport xmlns="www.kaseya.com/.../Scripting" xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance"> -<Procedure folderId="22211261191322385232519214" id="1401" treePres="3" name="2 - Server Maintenance"> -<Body description="This is a master procedure that runs several procedures for servers. Use this procedure as part of your Servers SLA. This should be the only procedure that you schedule for your servers. If you want to include more executions of additional tasks add a step to this procedure."> -<If description="This is a master procedure that runs several procedures for servers. Use this procedure as part of your Servers SLA. This should be the only procedure that you schedule for your servers. If you want to include more executions of additional tasks add a step to this procedure."> <Condition name="True"/> -<Then> -<Statement name="ExecuteScript" continueOnFail="false"> <Parameter name="ScriptID" value="1435" xsi:type="StringParameter"/> <Parameter name="ScriptName" value="Flush DNS" xsi:type="StringParameter"/> <Parameter name="TimeDelay" value="" xsi:type="StringParameter"/> <Parameter name="TimeUnit" value="Immediate" xsi:type="EnumParameter"/> </Statement> -<Statement name="ExecuteScript" continueOnFail="false"> <Parameter name="ScriptID" value="1414" xsi:type="StringParameter"/> <Parameter name="ScriptName" value="Verify Exchange database size" xsi:type="StringParameter"/> <Parameter name="TimeDelay" value="" xsi:type="StringParameter"/> <Parameter name="TimeUnit" value="Immediate" xsi:type="EnumParameter"/> </Statement> -<Statement name="ExecuteScript" continueOnFail="false"> <Parameter name="ScriptID" value="1457" xsi:type="StringParameter"/> <Parameter name="ScriptName" value="Set Time Server" xsi:type="StringParameter"/> <Parameter name="TimeDelay" value="" xsi:type="StringParameter"/> <Parameter name="TimeUnit" value="Immediate" xsi:type="EnumParameter"/> </Statement> -<Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter name="Comment" value="Server maintenance procedure completed successfully." xsi:type="StringParameter"/> </Statement> </Then> </If> </Body> </Procedure> </ScriptExport>



    [edited by: zippo at 1:06 PM (GMT -7) on 5-21-2012] Fix
  • Try this...

    <?xml version="1.0" encoding="UTF-8"?>

    -<ScriptExport xmlns="www.kaseya.com/.../Scripting" xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance"> -<Procedure folderId="22211261191322385232519214" id="1401" treePres="3" name="2 - Server Maintenance"> -<Body description="This is a master procedure that runs several procedures for servers. Use this procedure as part of your Servers SLA. This should be the only procedure that you schedule for your servers. If you want to include more executions of additional tasks add a step to this procedure."> -<If description="This is a master procedure that runs several procedures for servers. Use this procedure as part of your Servers SLA. This should be the only procedure that you schedule for your servers. If you want to include more executions of additional tasks add a step to this procedure."> <Condition name="True"/> -<Then> -<Statement name="ExecuteScript" continueOnFail="false"> <Parameter name="ScriptID" value="1435" xsi:type="StringParameter"/> <Parameter name="ScriptName" value="Flush DNS" xsi:type="StringParameter"/> <Parameter name="TimeDelay" value="" xsi:type="StringParameter"/> <Parameter name="TimeUnit" value="Immediate" xsi:type="EnumParameter"/> </Statement> -<Statement name="ExecuteScript" continueOnFail="false"> <Parameter name="ScriptID" value="1414" xsi:type="StringParameter"/> <Parameter name="ScriptName" value="Verify Exchange database size" xsi:type="StringParameter"/> <Parameter name="TimeDelay" value="" xsi:type="StringParameter"/> <Parameter name="TimeUnit" value="Immediate" xsi:type="EnumParameter"/> </Statement> -<Statement name="ExecuteScript" continueOnFail="false"> <Parameter name="ScriptID" value="1457" xsi:type="StringParameter"/> <Parameter name="ScriptName" value="Set Time Server" xsi:type="StringParameter"/> <Parameter name="TimeDelay" value="" xsi:type="StringParameter"/> <Parameter name="TimeUnit" value="Immediate" xsi:type="EnumParameter"/> </Statement> -<Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter name="Comment" value="Server maintenance procedure completed successfully." xsi:type="StringParameter"/> </Statement> </Then> </If> </Body> </Procedure> </ScriptExport>

  •  

    Sorry. I can't seem to get the post monster to let me format that procedure correctly. The first script is named "Flush DNS" and the second script is "Verify Exchange database size". Hope that helps.

     



    [edited by: zippo at 1:14 PM (GMT -7) on 5-21-2012] Fix it
  • It's all good.  That is awesome.  That's exactly what I needed!  I had to export the script, edit it, and re-import because it was a sample script so I couldn't edit it directly, but it's done and we'll see if it works.  Thanks a million!

  • Use the "Use rich formatting" option and put your code in between "code" and "/code" code formatting switches and encapsulate them using the "[" & "]" brackets then you will get something like this;


    Put Your Code here!

  • Thanks for the tip, HardKnoX. I'll give that a try the next time I do battle with "The Monster"...