ZenPacks and JSON API

1.  JSON event query less then or greater than

Posted 05-18-2017 02:00 PM
Edited by Brian Schimmoller 05-18-2017 02:24 PM
I am trying to use zenoss_api to query for specific events. I have the query working, but I need to check if the count is greater than 3. Here's my working query without the count parameter:

zenoss_api evconsole_router EventsRouter query '{"limit":5000,"params":{"eventState":[0],"prodState":"1000","severity":4,"eventClass":"/Win/EventLog","summary":"The log shipping primary database"}}'

I've tried adding in the "count" parameter and it does work if I specifiy the count:

zenoss_api evconsole_router EventsRouter query '{"limit":5000,"params":{"eventState":[0],"prodState":"1000","severity":4,"eventClass":"/Win/EventLog","summary":"The log shipping primary database","count":[3,4,5]}}'

Any thoughts?

Edit: Removed my last example.


2.  RE: JSON event query less then or greater than

Posted 05-18-2017 02:26 PM
What is the error that is returned?

------------------------------
Tim Caiazza
CompanyName
------------------------------



3.  RE: JSON event query less then or greater than

Posted 05-18-2017 02:38 PM
No error, but I want to create an event if the count is greater than 2. I'm not sure how to do greater than or less than instead of specifying the count.


4.  RE: JSON event query less then or greater than

Posted 05-22-2017 02:02 PM
The createEventFilter method is defined in  $ZENHOME/Products/Zuul/facades/zepfacade.py - see the count_range attribute. count can either be a number or a range (in either list or tuple format) - but those are your only options on the filter itself' eg. --count 3,20000 would pull all events with counts between 3 and 20000.
Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------



5.  RE: JSON event query less then or greater than

Posted 05-22-2017 02:45 PM
I was afraid that would be the only option. Thanks for the reply!