You are here

Using opsview_rest to query all hosts for check_interval not equal to 5

3 posts / 0 new
Last post
ken.edgar
ken.edgar's picture
Using opsview_rest to query all hosts for check_interval not equal to 5

Hello,

I'm not at all familiar with using a REST API and would like to understand for example how I can query for hosts that have a check_interval set to either not equal to or greater than 5.  I've tried a few different ways and am still unable to get the proper output.  Here is one of my attempts:

./opsview_rest --pretty --username=foo --password=bar GET 'config/host?rows=all&s.check_interval!=5'

With this query, I get back all hosts no matter the check_interval value is.  Ideally I'd like to get back the hostname and check_interval values so I can address those hosts that may not be configured properly.

Thanks a bunch,

Ken Edgar

ken.edgar
ken.edgar's picture
Re: Using opsview_rest to query all hosts for check_interval ...

I was able to find what I needed, but it wasn't as ideal as I would have liked it... here's my query:

 

./opsview_rest --pretty --username=foo--password=bar GET 'config/host?rows=all&cols=name,check_interval' | less

smarsh
smarsh's picture
Re: Using opsview_rest to query all hosts for check_interval ...

Hi Ken,

It looks like you are an Opsview customer - as such, you should really raise these enquiries via support.opsview.com so that one of our support engineers can assist you with creating the queries you need - or if its not available, raise a feature request on your behalf.

Best,

Sam