Report on Machines Up or Down – The Next Step: Turn On Those Machines
I created an article discussing how to utilize a simple ping utility in conjunction with Task Server and Connector Solution to create a job which reports on which machines are up or down. The natural extension to this would be to attempt to "wake" or turn on those machines.
In order for the following steps to work you need to run through the steps outlined in my previous article.
The component that we will need for this exercise is (in addition to the previous article):
- ASDK 1.4 (Optional. Explained below)
The high level steps of this article are as follows:
- Create a collection of machines that are down
- Extend the Task Server job to run a WOL against this collection
To create this collection go to View-->Resources-->Computer Collections-->My Collections.
Right click on My Collections and select New-->Collection, expand Query, then select "Enter SQL Directly" and enter the following SQL:
select _ResourceGuid as [Guid] from dbo.Inv_Ping_Status where datediff(day,[Ping Date],getdate()) <= 1 and Inv_Ping_Status.[Ping Result] = N'No'
Now, what I did with this SQL was look at the custom table Inv_Ping_Status which was created when the custom data class was created in the last article. I'm looking for all machines that did not respond to the ping and the ping was taken within the last day.
That is what the line datediff(day,[Ping Date],getdate()) <= 1 is used for. You may want to change this to a value that you find sufficient. The reasoning behind this was that you don't want to start turning on machines that you're not really intending to. The results may be a week old if the Ping Job did not run recently. Again, I chose 1 day as my value.
I called this collection "Machines Not Responding to Ping in the Last Day"
Once the Collection is saved, right click on it and select Properties. Next, copy the GUID which is at the top (without the brackets). The reason for this is that we'll need the GUID of the collection in our job below.
Next, we need to update the Task Server Job called Ping Job.
What I did was clone this job and called it Ping Job with WOL. This next step is optional. What we'll do is access the ASDK to call the webservice that updates our new collection. The reason for this is that once the task for importing the ping results is done we will want our collection updated so that when we send the WOL to the powered down machines we want to ensure that we are waking the proper machines.
Edit the job and click New-->Task. If the ASDK is installed look for the UpdateCollections Task under the Server Tasks-->ASDK - NS-->CollectionManagement.
Once selected, click on the radio button on the right hand side and select "Enter Task Input Now" and enter in the GUID of the collection you created in the first step.
Finally, click on New-->Task and select the Power Control task.
... and select Wake Up (send Wake On LAN)
Next, select the radio button selection on the right hand side called "Enter task input now. In the drop down menu select "use a set value" and select your new collection.
Your job should look like the following:
And your done!












Recent comments
7 min 1 sec ago
2 hours 8 min ago
7 hours 59 min ago
11 hours 14 min ago
11 hours 59 min ago
13 hours 2 min ago
13 hours 29 min ago
14 hours 15 min ago
14 hours 15 min ago
14 hours 26 min ago