Skip to content

Commit

Permalink
Merge pull request #26 from ernestio/ernest/300
Browse files Browse the repository at this point in the history
Fix monit listening messages
  • Loading branch information
purehyperbole authored Mar 8, 2017
2 parents 8017912 + e075565 commit daf5cc4
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 42 deletions.
6 changes: 5 additions & 1 deletion c_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

package main

import "strings"

// Bootstrap : ..
type Bootstrap struct {
}

// Handle : ..
func (n *Bootstrap) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "bootstrap.create.done", "bootstrap.create.error":
case "bootstrap.create":
lines = n.getSingleDetail(components, "Bootstrap ran")
}

Expand Down
10 changes: 7 additions & 3 deletions c_ebs_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@

package main

import "strings"

// EBSVolume : ...
type EBSVolume struct {
}

// Handle : ...
func (n *EBSVolume) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "ebs_volume.create.done", "ebs_volume.create.error":
case "ebs_volume.create":
lines = n.getSingleDetail(components, "Created EBS volume ")
case "ebs_volume.delete.done", "ebs_volume.delete.error":
case "ebs_volume.delete":
lines = n.getSingleDetail(components, "Deleted EBS volume ")
case "ebs_volume.find.done", "ebs_volume.find.error":
case "ebs_volume.find":
lines = n.getSingleDetail(components, "Found EBS volume ")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_elb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// ELB : ...
type ELB struct {
}

// Handle : ...
func (n *ELB) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "elb.create.done", "elb.create.error":
case "elb.create":
lines = n.getSingleDetail(components, "Created ELB")
case "elb.update.done", "elb.update.error":
case "elb.update":
lines = n.getSingleDetail(components, "Updated ELB")
case "elb.delete.done", "elb.delete.error":
case "elb.delete":
lines = n.getSingleDetail(components, "Deleted ELB")
case "elb.find.done", "elb.find.error":
case "elb.find":
lines = n.getSingleDetail(components, "Found ELB")

}
Expand Down
6 changes: 5 additions & 1 deletion c_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

package main

import "strings"

// Execution : ...
type Execution struct {
}

// Handle : ...
func (n *Execution) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "execution.create.done", "execution.create.error":
case "execution.create":
lines = n.getSingleDetail(components, "Ran execution")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// Firewall : ...
type Firewall struct {
}

// Handle : ...
func (n *Firewall) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "firewall.create.done", "firewall.create.error":
case "firewall.create":
lines = n.getSingleDetail(components, "Firewall created")
case "firewall.update.done", "firewall.update.error":
case "firewall.update":
lines = n.getSingleDetail(components, "Firewall updated")
case "firewall.delete.done", "firewall.delete.error":
case "firewall.delete":
lines = n.getSingleDetail(components, "Firewall deleted")
case "firewall.find.done", "firewall.find.error":
case "firewall.find":
lines = n.getSingleDetail(components, "Firewall found")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// Instance : ...
type Instance struct {
}

// Handle : ...
func (n *Instance) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "instance.create.done", "instance.create.error":
case "instance.create":
lines = n.getSingleDetail(components, "Instance created")
case "instance.update.done", "instance.update.error":
case "instance.update":
lines = n.getSingleDetail(components, "Instance udpated")
case "instance.delete.done", "instance.delete.error":
case "instance.delete":
lines = n.getSingleDetail(components, "Instance delete")
case "instance.find.done", "instance.find.error":
case "instance.find":
lines = n.getSingleDetail(components, "Instance find")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// Nat : ...
type Nat struct {
}

// Handle : ...
func (n *Nat) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "nat.create.done", "nat.create.error":
case "nat.create":
lines = n.getSingleDetail(components, "Nat created")
case "nat.update.done", "nat.update.error":
case "nat.update":
lines = n.getSingleDetail(components, "Nat updated")
case "nat.delete.done", "nat.delete.error":
case "nat.delete":
lines = n.getSingleDetail(components, "Nat deleted")
case "nat.find.done", "nat.find.error":
case "nat.find":
lines = n.getSingleDetail(components, "Nat created")
}
return lines
Expand Down
10 changes: 7 additions & 3 deletions c_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@

package main

import "strings"

// Network : ...
type Network struct {
}

// Handle : ...
func (n *Network) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "network.create.done", "network.create.error":
case "network.create":
lines = n.getSingleDetail(components, "Network created")
case "network.delete.done", "network.delete.error":
case "network.delete":
lines = n.getSingleDetail(components, "Network deleted")
case "network.find.done", "network.find.error":
case "network.find":
lines = n.getSingleDetail(components, "Network found")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_rds_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// RDSCluster : ...
type RDSCluster struct {
}

// Handle : ...
func (n *RDSCluster) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "rds_cluster.create.done", "rds_cluster.create.error":
case "rds_cluster.create":
lines = n.getSingleDetail(components, "RDS cluster created")
case "rds_cluster.update.done", "rds_cluster.update.error":
case "rds_cluster.update":
lines = n.getSingleDetail(components, "RDS cluster updated")
case "rds_cluster.delete.done", "rds_cluster.delete.error":
case "rds_cluster.delete":
lines = n.getSingleDetail(components, "RDS cluster deleted")
case "rds_cluster.find.done", "rds_cluster.find.error":
case "rds_cluster.find":
lines = n.getSingleDetail(components, "RDS cluster found")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_rds_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// RDSInstance : ...
type RDSInstance struct {
}

// Handle : ...
func (n *RDSInstance) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "rds_instance.create.done", "rds_instance.create.error":
case "rds_instance.create":
lines = n.getSingleDetail(components, "RDS instance created")
case "rds_instance.udpate.done", "rds_instance.update.error":
case "rds_instance.udpate":
lines = n.getSingleDetail(components, "RDS instance updated")
case "rds_instance.delete.done", "rds_instance.delete.error":
case "rds_instance.delete":
lines = n.getSingleDetail(components, "RDS instance deleted")
case "rds_instance.find.done", "rds_instance.find.error":
case "rds_instance.find":
lines = n.getSingleDetail(components, "RDS instance found")
}
return lines
Expand Down
8 changes: 6 additions & 2 deletions c_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@

package main

import "strings"

// Router : ...
type Router struct {
}

// Handle : ...
func (n *Router) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {

case "router.create.done", "router.create.error":
case "router.create":
lines = n.getSingleDetail(components, "Created router")
case "router.delete.done", "router.delete.error":
case "router.delete":
lines = n.getSingleDetail(components, "Deleted router")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// S3Bucket : ...
type S3Bucket struct {
}

// Handle : ...
func (n *S3Bucket) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "s3.create.done", "s3.create.error":
case "s3.create":
lines = n.getSingleDetail(components, "S3 bucket created")
case "s3.update.done", "s3.update.error":
case "s3.update":
lines = n.getSingleDetail(components, "S3 bucket updated")
case "s3.delete.done", "s3.delete.error":
case "s3.delete":
lines = n.getSingleDetail(components, "S3 bucket deleted")
case "s3.find.done", "s3.find.error":
case "s3.find":
lines = n.getSingleDetail(components, "S3 bucket imported")
}
return lines
Expand Down
12 changes: 8 additions & 4 deletions c_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@

package main

import "strings"

// Vpc : ...
type Vpc struct {
}

// Handle : ...
func (n *Vpc) Handle(subject string, components []interface{}, lines []Message) []Message {
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "vpc.create.done", "vpc.create.error":
case "vpc.create":
lines = n.getSingleDetail(components, "VPC created")
case "vpc.update.done", "vpc.update.error":
case "vpc.update":
lines = n.getSingleDetail(components, "VPC udpated")
case "vpc.delete.done", "vpc.delete.error":
case "vpc.delete":
lines = n.getSingleDetail(components, "VPC deleted")
case "vpc.find.done", "vpc.find.error":
case "vpc.find":
lines = n.getSingleDetail(components, "VPC Found")
}
return lines
Expand Down

0 comments on commit daf5cc4

Please sign in to comment.