forked from kovetskiy/zabbixctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add latest data columns into triggers table
- Loading branch information
Showing
9 changed files
with
205 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package main | ||
|
||
type Function struct { | ||
ID string `json:"functionid"` | ||
ItemID string `json:"itemid"` | ||
TriggerID string `json:"triggerid"` | ||
Name string `json:"function"` | ||
Parameter string `json:"parameter"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"strconv" | ||
"time" | ||
) | ||
|
||
type HistoryValue interface{} | ||
|
||
type History struct { | ||
ItemID string `json:"itemid"` | ||
Value HistoryValue `json:"value"` | ||
Clock string `json:"clock"` | ||
} | ||
|
||
type ItemHistory struct { | ||
Item Item | ||
History History | ||
} | ||
|
||
func (history *History) String() string { | ||
return fmt.Sprint(history.Value) | ||
} | ||
|
||
func (history *History) date() time.Time { | ||
date, _ := strconv.ParseInt(history.Clock, 10, 64) | ||
return time.Unix(date, 0) | ||
} | ||
|
||
func (history *History) DateTime() string { | ||
return history.date().Format("2006-01-02 15:04:05") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters