Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
add latest command to aggregates [check]
Browse files Browse the repository at this point in the history
  • Loading branch information
hico-horiuchi committed Sep 1, 2015
1 parent 4d34872 commit 8a92c49
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ohgi/aggregates.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ func DeleteAggregatesCheck(api *sensu.API, check string) string {
func GetAggregatesCheckIssued(api *sensu.API, check string, issued string, results bool) string {
var print []byte

if issued == "latest" {
issues, err := api.GetAggregatesCheck(check, -1)
checkError(err)

if len(issues) == 0 {
return "No aggregates\n"
}
issued = strconv.FormatInt(issues[0], 10)
}

i, err := strconv.ParseInt(issued, 10, 64)
checkError(err)

Expand Down

0 comments on commit 8a92c49

Please sign in to comment.