Discussion:
zensendevent called twice
sadat khan
2012-12-15 07:51:19 UTC
Permalink
sadat khan [http://community.zenoss.org/people/sadat.ali.khan] created the discussion

"zensendevent called twice"

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

--------------------------------------------------------------
hi,
   i have a small shell script which simply calls zensendevent with some test message , key and component. I have configured the script as a command to be run from zenoss. The script goes like the following

############
zensendevent -d <device name> -i <ip> -y test_key -p test_component -c /Perf/Snmp/Brocade -s Warn some test message

echo "it is done"
exit 5
############

the script is being called successfully. The strange thing is the event count increments by 2 for each run of the script. that is 2 for the first run , 4 for the second run etc...
   any pointers ?

regards

Sadat Ali Khan
--------------------------------------------------------------

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

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]
sadat khan
2012-12-17 12:17:14 UTC
Permalink
sadat khan [http://community.zenoss.org/people/sadat.ali.khan] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
1./ to add to the above, if i use just the echo statement to send a message to zenoss , it appears , as expected just once per run.
2./ also with zensendevent in the script , it runs as expected when run by hand ( rather than bein called by zenoss )

regards

Sadat Ali Khan
--------------------------------------------------------------

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

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-12-17 21:36:23 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
sadat:

How are you calling it from ZenOSS?

--Shane Scott (Hackman238)
--------------------------------------------------------------

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

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]
sadat khan
2012-12-17 21:38:44 UTC
Permalink
sadat khan [http://community.zenoss.org/people/sadat.ali.khan] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
hi Shane,
             through a command data source ( with the ssh disabled )

regards

Sadat Ali Khan
--------------------------------------------------------------

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

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-12-17 21:41:56 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
sadat:

I'm thinking that possibly two events are being created- one by zencommand from the exit code and one  by zensendevent. Why are you running this as a command datasource?

--Shane Scott (Hackman238)
--------------------------------------------------------------

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

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]
sadat khan
2012-12-17 21:47:12 UTC
Permalink
sadat khan [http://community.zenoss.org/people/sadat.ali.khan] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
1./ thing is i have to monitor brocade devices through snmp polling and to monitor stuff like port and sensor status , individual OIDs will have to be added as data sources. The script will be intelligent enough to get all data through snmpwalk , parse output and create events through sensendevent.

2./ the strange thing is there is a separate event that gets created for the message corresponding to exit code. So in all there are 3 message counts - 1 corresponding to exit code message and 2 corresponding to zensendevent. Calling from zenoss creates problems though, as i already mentioned. Running by hand iss just fine.

regards

Sadat Ali Khan
--------------------------------------------------------------

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

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-12-17 21:50:51 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
sadat:

Ah okay. Your best bet would be to write a modeler and component tests for this use case so zenoss can test natively. Having a seperate script doing the work won't scale well.

As a test, remove the echo line and set the exit code to 0. Close the open events and let's see what it does.

--Shane
--------------------------------------------------------------

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

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]
sadat khan
2012-12-17 22:04:56 UTC
Permalink
sadat khan [http://community.zenoss.org/people/sadat.ali.khan] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
same story except now we have the "no data returned for command" for the corresponding echo that is commented. The event through zensendevent keeps incrementing by 2.

regards

Sadat Ali Khan
--------------------------------------------------------------

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

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-12-17 22:07:49 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
sadat:

That's really bizarre. I'm honestly not sure. I'd highly recommend to code a native solution for zenoss rather than script the brocade tests though.

--Shane
--------------------------------------------------------------

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

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]
sadat khan
2012-12-17 22:11:15 UTC
Permalink
sadat khan [http://community.zenoss.org/people/sadat.ali.khan] created the discussion

"Re: zensendevent called twice"

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

--------------------------------------------------------------
yes , it is extremely bizzare... native zenoss implementation would involve lot of manual work and this scripting solution is more intelligent. Anways thanks a lot for your inputs , Shane.

P.S. - just can't understand as to where the second count os coming from, And that too 5-10 secs. after the first os created.

regards

Sadat Ali Khan
--------------------------------------------------------------

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

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