Mar 22, 2012 1:26 PM
TALES Device Attribute for MAC Address
-
Like (0)
I'm attempting to define a user command to run etherwake (Wake On LAN) to wake up machines through the web UI. The etherwake command requires a MAC address for execution.
The problem is I don't know the TALES device attribute for the MAC address. I have the command as (without quotes) "etherwake ${device/macaddress}", but obviously "device/macaddress" isn't correct.
Any idea what the attribute name is for a MAC address?
hmmm. Well the device deosnt technically have a mac address, the interface does. I am not sure if you can traverse relationships or not with TALES. If you could (again not sure you can), it might look something like ${device/interfaces/eth0/macaddress}
I tried ${device/interfaces/eth0/macaddress}, ${interfaces/eth0/macaddress}, and ${eth0/macaddress} with no success.
I don't have a clue as to traversing relationships.
I have Steven O'Donnell's MAC address report Zenpack installed. I rummaged through it in the /manage page, but didn't see anything immediately useful. Is there any way I can use a reference from that?
So that report leverages some python stanzas and the layer 2 catalog, not tales expressions. I am sure ther e is a way to do what your asking, but I'm struggling to come up with a way to do it with a native user command, as opposed to using a script to wrap etherwake. If you had a custom DMD script, the user command could call the DMD script which could then leverage python code and traverse the relationships, or use the layer two catalog like the report pack. Once the MAC is know you fire off etherwake. I know thats alot more complicated than you wanted to hear, but maybe someone knows of an easier.
Thanks, dpetzel. I'll look into making a DMD script.
UbuntiLocoL
You can write a python script that returns the macaddress of the device context then access it in a tales expression.
For example, ${device/getMacAddress} where the script is called getMacAddress and is a method extending ZenModel.DeviceClass.
Best,
--Shane
I'll see what I can do and get back to you.
UbuntuLoco:
Alrighty. Good luck!
Best,
--Shane
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||