Skip to content

Commit

Permalink
MON-129 get ip hoster in constant
Browse files Browse the repository at this point in the history
  • Loading branch information
xp-1000 committed Jun 2, 2018
1 parent 61ed9e6 commit 400b743
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions zabbix-aws-deregister.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ type Configuration struct {
Password string
}

// ZabbixHostDisable value corresponding to zabbix host disabled
const ZabbixHostDisable = 1

// Config Global configuration structure
var Config Configuration

Expand Down Expand Up @@ -133,7 +130,8 @@ func init() {

// HandleRequest hot start lambda function start point
func HandleRequest(snsEvents events.SNSEvent) (string, error) {

const zabbixHostDisable = 1
const getIP = "http://ip.clara.net"
var err error

log.WithFields(log.Fields{
Expand Down Expand Up @@ -180,7 +178,7 @@ func HandleRequest(snsEvents events.SNSEvent) (string, error) {
searchInventory["alias"] = autoscalingEvent.InstanceID

if log.GetLevel() == log.DebugLevel {
resp, err := http.Get("http://ip.clara.net")
resp, err := http.Get(getIP)
if err != nil {
log.WithFields(log.Fields{
"stage": "info",
Expand Down Expand Up @@ -291,7 +289,7 @@ func HandleRequest(snsEvents events.SNSEvent) (string, error) {
"host": name,
"name": name,
"description": string(descriptionJSON),
"status": ZabbixHostDisable,
"status": zabbixHostDisable,
})
if err != nil {
log.WithFields(log.Fields{
Expand Down

0 comments on commit 400b743

Please sign in to comment.