Commit Briefs

dca9442c1f Oliver Lowe

Catch all HostStates and ServiceStates

This is closer to the Icinga spec, anything greater than 2 or 3 is unknown.


e35b73d5e3 Oliver Lowe

Only log on test error

No news is good news!


0324b0fdd2 Oliver Lowe

Just panic on unlikely user test error

We're just testing, so we don't need super robust error handling code. And if any of those conditions aren't met then we have serious problems anyway.


46fe962a8b Oliver Lowe

Revert "Create a new client interface"

This reverts commit bd3b8a33c54037e66233db80fd1120eb0b6215f1. It's a bad idea. I'm writing a fake server instead so that we can use the real client code.


bd3b8a33c5 Oliver Lowe

Create a new client interface

So that testing the client doesn't involve making real HTTP requests.


d762d1d1ae Oliver Lowe

Correctly return ErrNoMatch when rescheduling a check

For some reason the API returns an internal server error status rather than a Not Found status (as in other methods in the API). We can catch the condition when results are empty and return ErrNoMatch.


46ca0f68f5 Oliver Lowe

Marshal using struct tags rather than a custom map

I was excluding some struct fields so I thought I'd need to do some custom marshalling . But you don't need to do this as you can use struct tags to optionally exclude things from being put into JSON. Now there's no longer duplicate code between struct tags and keys in a map when marshalling. Handy!


f8031e6577 Oliver Lowe

Delete unused testUser var

This was used in some old tests but is now unused.


9ffce56b80 Oliver Lowe

Properly encode spaces in filter expressions

This is a bit tricky. url.QueryEscape() encodes spaces in queries as "+", but Icinga2 wants them as "%20". A test case is included because this was kinda tricky to debug.


64e18a8d1e Oliver Lowe

Correctly return ErrNoMatch

The check was incorrect before. The HTTP status on responses is still 200 OK, but with empty results if there are no matches to the filter.


562d5c1eb8 Oliver Lowe

Store acknowledgement status of hosts, services


1646fdebff Oliver Lowe

Actually return permissions grante to the client

Before we were just returning an empty response or something non-meaningful


cb9dde9996 Oliver Lowe

Let users schedule their own checks


dd1562c064 Oliver Lowe

Always format generated code

While here document what is needed to actually run go generate.


f5fde32e94 Oliver Lowe

Handle last check result of services

Includes a test to know that we're handling the JSON properly.


7cb145ba97 Oliver Lowe

Implement checker interface for HostGroup

This also adds a test for checking all hosts in a HostGroup.


dd0af5f789 Oliver Lowe

Correctly marshal Hosts into JSON

We were missing some attributes, like not adding any groups or display names. This also adds a test which checks whether we are marshalling hosts into JSON correctly.


e2cace7fed Oliver Lowe

Document checker Check() methods


02a1a10065 Oliver Lowe

Support cascading delete of objects


da19a2fd0f Oliver Lowe

Store host state type


191337d0c3 Oliver Lowe

Add checking of services and hosts

And also add a icinga_test package that does the black-box tests i.e. tests which speak to a real icinga server.


e6fcfaf5b3 Oliver Lowe

Set accurate crud.go header comment

getopt(1) clears the value of "$@", so grab it before it's cleared


5105405ecc Oliver Lowe

deduplicate new test client code

This adds a newTestClient option so that we aren't constantly creating new http transports clients and all that


e0c2485044 Oliver Lowe

Support Icinga2 hostgroups

Tests of hostgroup operations are done in TestFilter


7aa5b05532 Oliver Lowe

doc: Keep the getting started tutorial in 1 place