![]() |
![]() |
Subject: | What command line can I use to obtain all properties of a specific event? |
Author: | Larry Virden |
Posted: | 2016-05-06 13:56 |
I would like to be able, from the command line, to search for an event and get back all of its TALESproperties (are there other properties than TALES).
I looked at all the *event* commands in /opt/zenoss/bin and none of them seem like something that would do that.
Subject: | Look at the "detail" API call |
Author: | [Not Specified] |
Posted: | 2016-05-07 09:59 |
Look at the "detail" API call in the EventsRouter
http://wiki.zenoss.org/Working_with_the_JSON_API#Manipulate_Events
Subject: | Thank you for the tip |
Author: | Larry Virden |
Posted: | 2016-05-09 08:10 |
Thank you very much.
This is my first time trying JSON.
Since I have no idea what the wiki is talking about yet, I decided to try an early example to see what I got, then I would play with the arguments to try and understand what they mean.
I typed:
json_api.sh movedir readme.text
$ source json_api.sh
-ksh: .: json_api.sh: cannot open [No such file or directory]
$ set -o vi
$ source ./json_api.sh
$ er query '{"limit":2000,"params":{"eventState":[0,1]}}' <
curl: (7) Failed connect to localhost:8080; Connection refused
$ zenoss_api evconsole_router EventsRouter query '{"limit":2000,"params":{"eventState":[0,1]}}'
curl: (7) Failed connect to localhost:8080; Connection refused
Is there something outside of the doc on the JSON page that one needs to do besides the source and the execution of the command
My interpretation of the query arguments is that the limit 2000 means no more than that many items should be returned, and that the eventState means return items with either 0 or 1 value - if I wanted all the values, I would put something like 0,5
Thank you for your help!
Subject: | Curiouser and curiouser |
Author: | Larry Virden |
Posted: | 2016-05-09 08:35 |
So I connected to the zenhub docker and became zenoss, then ran the zenoss_api command.
Instead of a curl error, what I got is html returned. The html page is titled Zenoss: Error, displays a hyperlinklink called "sign out" that links to /zport/dmd/logoutUser and a dash hyperlink to http://www.zenoss.com/helpversion=5.1.1
So while the original curl error is gone, now I am getting an error without a description.
Has anyone else encountered something like this
What I'm trying to accomplish isto do a query to see what events are currently accessible. Once I do that, I want to get the UUID of a specific event, and use that to get all the details of the event.
Subject: | At the very top of json_api |
Author: | [Not Specified] |
Posted: | 2016-05-09 09:01 |
At the very top of json_api.sh - there are some fields to supply Zenoss credentials.
Subject: | That did the trick! |
Author: | Larry Virden |
Posted: | 2016-05-13 07:05 |
Thank you very much - that was the bit I had missed!
< |
Previous zenhub.log message question |
Next Where would a heartbeat for something called myApplication be originating? |
> |