Discussion:
TALES Device Attribute for MAC Address
UbuntuLoco
2012-03-22 17:26:40 UTC
Permalink
UbuntuLoco [http://community.zenoss.org/people/UbuntuLoco] created the discussion

"TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65375#65375

--------------------------------------------------------------
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?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65375#65375]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-03-22 21:09:08 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65397#65397

--------------------------------------------------------------
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}
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65397#65397]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
UbuntuLoco
2012-03-22 21:41:02 UTC
Permalink
UbuntuLoco [http://community.zenoss.org/people/UbuntuLoco] created the discussion

"Re: TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65398#65398

--------------------------------------------------------------
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 http://community.zenoss.org/docs/DOC-3512 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?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65398#65398]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-03-22 23:22:12 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65400#65400

--------------------------------------------------------------
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.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65400#65400]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
UbuntuLoco
2012-03-23 13:12:08 UTC
Permalink
UbuntuLoco [http://community.zenoss.org/people/UbuntuLoco] created the discussion

"Re: TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65416#65416

--------------------------------------------------------------
Thanks, dpetzel. I'll look into making a DMD script.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65416#65416]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2012-03-23 15:02:25 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65433#65433

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65433#65433]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
UbuntuLoco
2012-03-26 13:08:01 UTC
Permalink
UbuntuLoco [http://community.zenoss.org/people/UbuntuLoco] created the discussion

"Re: TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65478#65478

--------------------------------------------------------------
I'll see what I can do and get back to you.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65478#65478]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2012-03-26 14:30:30 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: TALES Device Attribute for MAC Address"

To view the discussion, visit: http://community.zenoss.org/message/65487#65487

--------------------------------------------------------------
UbuntuLoco:

Alrighty. Good luck!

Best,
--Shane
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65487#65487]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...