Documentation
¶
Index ¶
- Constants
- Variables
- func TimeISO8601Z(t time.Time) string
- func WriteFakePolicyFile(policy *Policy)
- type Attribute
- type Options
- func (o *Options) GenMatchRule() string
- func (o *Options) GenTaskUpdate() Options
- func (o *Options) HasEmailRecipients() bool
- func (o *Options) HasSlackChannels() bool
- func (o *Options) InitOkStatus()
- func (o *Options) InitResponse()
- func (o *Options) InitStatus(current, desired string)
- func (o *Options) InitUpdateStatus()
- func (o *Options) IsSame(trigger Options) bool
- func (o *Options) SetCompleted()
- func (o *Options) SetError()
- type Policy
- type Response
- type Toggle
Constants ¶
View Source
const ( Triggers = "triggers" DB = "triggers" Collection = "triggers" ReqCollection = "requests" ResponsePolicyV2 = "/etc/policies/alert_resp/alert_resp2_0.yml" ISO8601Z = "2006-01-02T15:04:05+00:00" )
Variables ¶
View Source
var DefaultOptions = []Options{ { Name: "Administrative Level Notification", Description: `Configure how you are going to be notified for system events and host alerts, including levels 'warning', 'error', and 'critical'.`, Attributes: []Attribute{ { Name: "severity", Type: "string", Value: "W", Enable: true, }, { Name: "severity", Type: "string", Value: "E", Enable: true, }, { Name: "severity", Type: "string", Value: "C", Enable: true, }, { Name: "category", Type: "string", Value: "DEV", Enable: false, }, { Name: "category", Type: "string", Value: "CPU", Enable: false, }, { Name: "category", Type: "string", Value: "DSK", Enable: false, }, { Name: "category", Type: "string", Value: "MEM", Enable: false, }, { Name: "category", Type: "string", Value: "NET", Enable: false, }, { Name: "category", Type: "string", Value: "SRV", Enable: false, }, { Name: "category", Type: "string", Value: "VRT", Enable: false, }, }, Enable: false, }, { Name: "Instance Level Notification", Description: `Configure how you are going to be notified for instance alerts, including levels 'warning', and 'critical'.`, Attributes: []Attribute{ { Name: "severity", Type: "string", Value: "W", Enable: true, }, { Name: "severity", Type: "string", Value: "E", Enable: false, }, { Name: "severity", Type: "string", Value: "C", Enable: true, }, { Name: "category", Type: "string", Value: "DEV", Enable: false, }, { Name: "category", Type: "string", Value: "CPU", Enable: false, }, { Name: "category", Type: "string", Value: "DSK", Enable: false, }, { Name: "category", Type: "string", Value: "MEM", Enable: false, }, { Name: "category", Type: "string", Value: "NET", Enable: false, }, { Name: "category", Type: "string", Value: "SRV", Enable: false, }, { Name: "category", Type: "string", Value: "VRT", Enable: false, }, }, Enable: false, }, }
Functions ¶
func TimeISO8601Z ¶
func WriteFakePolicyFile ¶
func WriteFakePolicyFile(policy *Policy)
Types ¶
type Options ¶
type Options struct { Name string `json:"name" yaml:"name" bson:"name"` Description string `json:"description" yaml:"description"` Match string `json:"-" yaml:"match"` Attributes []Attribute `json:"attributes" bson:"-" yaml:"-"` Response `json:"response" yaml:"response"` Enable bool `json:"enable" yaml:"enable"` Status *status.Trigger `json:"status" yaml:"-" bson:"status"` }
func (*Options) GenMatchRule ¶
func (*Options) GenTaskUpdate ¶
func (*Options) HasEmailRecipients ¶
func (*Options) HasSlackChannels ¶
func (*Options) InitOkStatus ¶
func (o *Options) InitOkStatus()
func (*Options) InitResponse ¶
func (o *Options) InitResponse()
func (*Options) InitStatus ¶
func (*Options) InitUpdateStatus ¶
func (o *Options) InitUpdateStatus()
func (*Options) SetCompleted ¶
func (o *Options) SetCompleted()
type Policy ¶
type Policy struct { Name string `json:"name" yaml:"name"` Version float64 `json:"version" yaml:"version"` Enable bool `json:"enable" yaml:"enable"` Triggers []Options `json:"triggers" yaml:"triggers"` }
func (*Policy) AppendTrigger ¶
func (*Policy) GetTrigger ¶
func (*Policy) UpdateOrAppendTrigger ¶
Click to show internal directories.
Click to hide internal directories.