Server Management - Systems Insight Manager
cancel
Showing results for 
Search instead for 
Did you mean: 

Automated Suspend/Resume monitoring scheduled task

SOLVED
Go to solution
zarulzakuan
Advisor

Automated Suspend/Resume monitoring scheduled task

Hi,

 

Since HP SIM do not provide scheduling bulk servers for suspend/resume monitoring task, I do the task using direct command through CMD. After I ran the command, the scheduled task do appear on the All Scheduled Tasks however eventhough I set the start date/time correctly(ahead of current date/time), it shows "Run Once - Already Ran". 

 

This is how I do the Task Scheduling

 

Lets say I want to suspend SERVER1 from 21 Sept 2012 at 15:00 until  19:00 on the same day

 

1. Wrote the query for servers to resume and saved it as queryresume.xml

 

<?xml version="1.0" encoding="windows-1252"?>
<query-list>
<query name="Server resume Targets" type="DeviceViews" category-name="ToolsCollection" owner="domain\user" locked="false" application="">
<criteria name="CriteriaByName" sense="INCLUDE">
<value>SERVER1</value>
</criteria> </query> </query-list>

 2.  Wrote the query for servers to suspend and saved it as querysuspend.xml

 

<?xml version="1.0" encoding="windows-1252"?>
<query-list>
<query name="Server suspend Targets" type="DeviceViews" category-name="ToolsCollection" owner="domain\user" locked="false" application="">
        <criteria name="CriteriaByName" sense="INCLUDE">
            <value>SERVER1</value>
        </criteria>
    </query>
</query-list>

 

3. Wrote task for resuming monitoring and saved it as taskresume.xml

 

<?xml version="1.0" encoding="windows-1252"?>
<task-list>
 <task name="Server resume" type="schedule" owner="domain\user" state="enabled">
        <toolname>Suspend or Resume Monitoring</toolname>
        <queryname>Server resume Targets</queryname>
<scheduleinfo interval="ranonce" time="19:00" date="09/21/12" />
<timefilter />
        <toolparams>&lt;?xml version="1.0"?&gt;
&lt;XeObject className="com.hp.mx.core.tools.systemattributes.SnoozeTaskModel" classVersion="2.0"&gt;
&lt;Property type="superclass"&gt;
&lt;/Property&gt;
 &lt;Property name="suspendState"&gt;
  &lt;Simple&gt;0&lt;/Simple&gt;
 &lt;/Property&gt;
 &lt;Property name="strSuspendState"&gt;
  &lt;Simple&gt;off&lt;/Simple&gt;
 &lt;/Property&gt;
 &lt;Property name="language"&gt;
  &lt;Simple&gt;en&lt;/Simple&gt;
 &lt;/Property&gt;
&lt;/XeObject&gt;
</toolparams>
    </task>
</task-list>

 

4. Wrote task for resuming monitoring and saved it as tasksuspend.xml

 

<?xml version="1.0" encoding="windows-1252"?>
<task-list>
 <task name="Server suspend" type="schedule" owner="domain\user" state="enabled">
        <toolname>Suspend or Resume Monitoring</toolname>
        <queryname>Server suspend Targets</queryname>
<scheduleinfo interval="ranonce" time="15:00" date="09/21/12" />
<timefilter />
        <toolparams>&lt;?xml version="1.0"?&gt;
&lt;XeObject className="com.hp.mx.core.tools.systemattributes.SnoozeTaskModel" classVersion="2.0"&gt;
&lt;Property type="superclass"&gt;
&lt;/Property&gt;
 &lt;Property name="suspendState"&gt;
  &lt;Simple&gt;-1&lt;/Simple&gt;
 &lt;/Property&gt;
 &lt;Property name="strSuspendState"&gt;
  &lt;Simple&gt;always&lt;/Simple&gt;
 &lt;/Property&gt;
 &lt;Property name="language"&gt;
  &lt;Simple&gt;en&lt;/Simple&gt;
 &lt;/Property&gt;
&lt;/XeObject&gt;
</toolparams>
    </task>
</task-list>

 

5. And finally ran the batch script

 

mxquery -a -f querysuspend.xml
mxtask -cf tasksuspend.xml

mxquery -a -f queryresume.xml
mxtask -cf taskresume.xml

 

Am I missing something here? Thanks in advance :-)

 

4 REPLIES
Rene Nascimento
Frequent Advisor

Re: Automated Suspend/Resume monitoring scheduled task

I use SIM all the time to Schedule server(s) to suspend monitoring and a second scheduled task to take servers out of suspension mode.

zarulzakuan
Advisor

Re: Automated Suspend/Resume monitoring scheduled task

Yes I am aware about that. The thing is I want to do it automatically. I've done script to automate both task. From excel, I just have to put list of server, set the start and end date/time and run macro to run all xml files like above. However, once it completes, in "All Scheduled Tasks" shows that both tasks already run.

zarulzakuan
Advisor
Solution

Re: Automated Suspend/Resume monitoring scheduled task

turned out there was a typo in the xml. 

interval="ranonce" should be
interval="runonce"

dumb mistake :-p
tobro-home
Advisor

Re: Automated Suspend/Resume monitoring scheduled task

I had the Same issue but there is a HP SIM 6.3.1  fix you have to

links.

http://g1w0134.austin.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&taskId=110&prodSeries...

Hotfix can be downloaded here:

http://h18013.www1.hp.com/products/servers/management/hpsim/dl_windows63.html#hotfix63\

 

I made a spread that help me suspend muliple servers from excel

Here are my

     My code TXT,   How to docs and  xlsm App attached which is ZIP

let me know if need help email tonyb@mr-itpro.com

 click here to download the tool

 

video how to use the tool

http://www.screencast.com/t/vfBeBXiZ