Make Alloy Navigator perform Wake-on-LAN

Open discussion about our Alloy Navigator 5 application

Make Alloy Navigator perform Wake-on-LAN

Postby gsingleton@securaplane.co on Thu Oct 08, 2009 5:28 pm

I just created a function that allows you to perform a Wake-on-LAN using Alloy Navigator! I hope others in this forum will find it helpful. It took some real hunting around to get the pieces together. Here's what I did:

1) Download a freeware Wake-on-LAN command line utility. There are a number of them available on the internet; I'm using one available from GammaDyne (www.gammadyne.com).
2) Place the command-line executable in a folder without spaces, preferably on the root (C:\) of your hard drive. The external function feature of Alloy Navigator does not like paths with spaces in them.
3) The first major roadblock I hit was that Alloy stores the MAC address of computers with the colons in it
(i.e. 00:3D:23:49:A2:9F), but all of the command-line utilities want just 12 hex digits. To solve this,
I created a user-defined field to hold the MAC address without the colons. Here's how:
A) From the Alloy Navigator main menu, select Tools --> Administrative --> Administrative Settings.
B) Drill down to Asset Management and CMDB --> Computers --> Fields --> User Defined Fields.
C) Click the Add button.
D) Give it a Field Label. I called my MacAddr, since the database table is already using MAC.
E) Set the Field Type to String.
F) Set the Length to 12.
G) Click the OK button. AN will warn you that you are about to change the table structure of your
database.
H) Once you acknowledge the error, write down the value under the Field column for the field you just
added. It should be the letters UDF followed by four digits; mine was UDF0005.
I) Close Alloy Navigator and reopen.
4) Now that the custom field is added, let's get Alloy to automatically populate it based in the data it has in
the MAC field, using a Business Rule. Here's how:
A) From the Alloy Navigator main menu, select Tools --> Administrative --> Administrative Settings.
B) Drill down to Asset Management and CMDB --> Computers --> Business Rules.
C) Click the Add button.
D) For Apply this Rule When, select the first option: Before object is saved. Click Next.
E) At the Criteria screen, click Next.
F) At the Actions screen, click Add and select Update Fields.
G) Give it an Action Name. Mine is called "ParseMAC", but you can call it anything you want.
H) Under Update Fields, click Add. It will create a new line in the grid below.
I) For Field Name, select the field label you created in step 3D above.
J) For Operation, select Calculate.
K) For Value, enter this: REPLACE(%[MAC]%,':','') This is a T-SQL command that will take the data in MAC
and remove the colons from it.
L) Click OK, and then Next.
M) Give the step a name, set the Category to "Field Population", enter a description of your choice,
and make sure the "Enable Rule" box is checked. Click Finish.
N) If you get the Rules' Execution Order screen, just click OK. It doesn't really matter what order this
rule executes in.

5) In Alloy Navigator, open any computer record and save it (the Save button is not highlighted until you make a change; fortunately, you can just type a letter in the description field and delete it).
6) Go to your Custom Data screen; you will see the User Defined field you created above, and it should now
contain the MAC address of the machine - without colons!
7) Create a new External tool to generate the Wake-on-Lan. Here's how:
A) From Alloy Navigator's main menu, select Actions --> Configure External Tools.
B) Click the Add button.
C) For Caption, give it a short name; I called mine Wakeup.
D) For Executable, give it the path to the utility you downloaded in steps 1 and 2. (You can use the
folder icon to browse for it, if you prefer.)
E) For Parameters, enter the field name you wrote down in step 3H above, with percent signs on either
side. In my example, my Parameters field is set to: %UDF0005%
F) You can leave the default directory blank.
G) I prefer to check the "Keep DOS Session Open" box; it allows me to see that the command was actually
successful.
H) Click OK, and then Close the Configure external Tools box.
8) In the Computers grid, highlight the line of the computer you saved in step 6.
9) Select Actions --> External Tools --> Wakeup (or whatever you called it in step 7C above).

Ta daa! Alloy Navigator just sent a wakeup packet to that computer! Remember that this will only
work for computer records you have saved after performing these steps; the User Defined field with the
MAC address in it will not be populated until a save occurs. The good news is that if you have your PCs
set up to automatically audit (as I do), this will perform the update for you, so it won't require you
to open every record and save it.

Happy Computing!
Glen Singleton
gsingleton@securaplane.com
gsingleton@securaplane.co
Member
 
Posts: 20
Joined: Tue Mar 02, 2004 12:17 pm

Re: Make Alloy Navigator perform Wake-on-LAN

Postby tallyho on Mon Oct 12, 2009 1:01 pm

Brilliant!

Thanks for sharing.

Cheers!
tallyho
Member
 
Posts: 11
Joined: Fri Aug 07, 2009 2:39 pm

Re: Make Alloy Navigator perform Wake-on-LAN

Postby janstonselig on Fri Oct 16, 2009 5:53 pm

Bravo!! I'm going to mess with this over the weekend! Thanks Glen!

:arrow: :D
User avatar
janstonselig
Senior
 
Posts: 174
Joined: Thu Aug 30, 2007 1:12 pm

Re: Make Alloy Navigator perform Wake-on-LAN

Postby eliaslynch on Thu Oct 22, 2009 12:52 pm

I second the above posts. Nice!
--------
Elias
User avatar
eliaslynch
Senior
 
Posts: 212
Joined: Wed Jul 09, 2008 7:03 pm

Re: Make Alloy Navigator perform Wake-on-LAN

Postby janstonselig on Fri Oct 23, 2009 1:22 pm

Hey Glen, it worked great for me! Nice work once again.

The only thing I can add is to step #2.

2) Place the command-line executable in a folder without spaces, preferably on the root (C:\) of your hard drive. The external function feature of Alloy Navigator does not like paths with spaces in them.


You can use folders with spaces in their names, but you have to put the full path in quotes like this:

Code: Select all
"C:\long folder name\test.exe"
User avatar
janstonselig
Senior
 
Posts: 174
Joined: Thu Aug 30, 2007 1:12 pm


Return to Alloy Navigator 5 Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron