func (p *PingCheck) Run() CheckResult {
	err := ping.Pinger(p.nodeConfig.Endpoint, pingTimeoutSeconds)
	if err != nil {
		log.Println(err)
		return CheckResult{
			Status:  StatusDanger,
			Message: err.Error(),
		}
	}
	return CheckResult{
		Message: MessageOK,
		Status:  StatusSuccess,
	}
}
Run method executes the check. This is invoked periodically.
package checks
import (
	"log"
	"reflect"
	"github.com/mtojek/greenwall/middleware/monitoring"
	"github.com/paulstuart/ping"
)
const (
	pingCheckName     = "ping_check"
	messageICMPFailed = "ICMP failed"
	pingTimeoutSeconds = 3
)
type PingCheck struct {
	monitoringConfiguration *monitoring.Configuration
	nodeConfig              *monitoring.Node
}
func (p *PingCheck) Initialize(monitoringConfiguration *monitoring.Configuration, nodeConfig *monitoring.Node) {
	p.monitoringConfiguration = monitoringConfiguration
	p.nodeConfig = nodeConfig
}