Discussion:
Referencing Event attributes in user command
Sean Shergill
2012-01-20 18:52:49 UTC
Permalink
Sean Shergill [http://community.zenoss.org/people/sean] created the discussion

"Referencing Event attributes in user command"

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

--------------------------------------------------------------
I've made some progress with setting up user commands. When I reference Device attributes, all works well, however when referencing Event attributes such as evid etc, I keep getting an exception, it doesn't like 'event' or 'evt'. According to the docs, under User Commands, event or evt should work. I'm on Zenoss 3.2.1. Its pretty frustrating because I can't figure out what I'm doing wrong, however I'm sure its something really simple and I'll end up feeling retarted once someone points it out to me.

Here's a sample command I've created:

send_to_IA.sh ${device/id} ${device/manageIp} ${event/evid}

The Device attributes work, event ones don't.

Here's what I get:

Exception while performing command for 10.1.1.144
Type: Value: 'event'


Thanks,
Sean
--------------------------------------------------------------

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

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-01-20 20:38:37 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: Referencing Event attributes in user command"

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

--------------------------------------------------------------
I was just playing with this now based on your post, and I concur it doesnt seem to work. Based on the documentation in that section, Im getting the impression that "User Commands" are limited in scope devices.
In a TALES expression, ‘here’ is the object against which the expression is executed. Some TALES expressions
in the system have other variables (such as evt for event, and dev or device for the device).
At first I read it the same as you, but after a re-read, I think its a more general statement about context and is actually just misleading. The "in the system" makes me feel like the comment is not specific to user commands.

I could be wrong, but at the very least, I'll confirm I also have your same issue.
--------------------------------------------------------------

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

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]
jcurry
2012-01-23 18:31:20 UTC
Permalink
jcurry [http://community.zenoss.org/people/jcurry] created the discussion

"Re: Referencing Event attributes in user command"

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

--------------------------------------------------------------
Hmm.  I have attributes from both dev and evt (and I use evt, not event) in my 3.2 system.  I have just copied the same command to 3.2.1 and I don't get ANYTHING in my output file!

Loading Image... Loading Image...
zenactions.log appears to show that all the attributes ARE being written to /tmp/cmdoutput but nothing ever shows up there (and I have tested that zenoss can write to that file).

Have you tried turning up the debugging on zenactions.log to Debug.  What do you see in there?

Cheers,
Jane
--------------------------------------------------------------

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

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-01-23 18:33:33 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: Referencing Event attributes in user command"

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

--------------------------------------------------------------
This is an example of an event command, as opposed to a user command though right? I believe both contexts are available in event commands, but event context is not available in user commands (An unconfirmed theory)
--------------------------------------------------------------

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

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]
jcurry
2012-01-23 18:58:33 UTC
Permalink
jcurry [http://community.zenoss.org/people/jcurry] created the discussion

"Re: Referencing Event attributes in user command"

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

--------------------------------------------------------------
Sorry - my confusion. yes - I was talking about event commands.
Cheers,
Jane
--------------------------------------------------------------

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

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