Esempio n. 1
0
func check(checker, ip string, port int) (state steward.ServiceState,
	logs string, err error) {

	_, logs, ret, err := system.System("timeout", timeout, checker, "chk", ip,
		fmt.Sprintf("%d", port))

	state = parseState(ret)
	if state != steward.StatusUnknown {
		err = nil
	}

	return
}
Esempio n. 2
0
func get(checker, ip string, port int, cred string) (flag, logs string,
	state steward.ServiceState, err error) {

	flag, logs, ret, err := system.System("timeout", timeout, checker, "get", ip,
		fmt.Sprintf("%d", port), cred)

	state = parseState(ret)
	if state != steward.StatusUnknown {
		err = nil
	}

	flag = strings.Trim(flag, " \n")

	return
}
Esempio n. 3
0
func put(checker, ip string, port int, flag string) (cred, logs string,
	state steward.ServiceState, err error) {

	cred, logs, ret, err := system.System("timeout", timeout, checker, "put", ip,
		fmt.Sprintf("%d", port), flag)

	state = parseState(ret)
	if state != steward.StatusUnknown {
		err = nil
	}

	cred = strings.Trim(cred, " \n")

	return
}
Esempio n. 4
0
func sshCheck(host, checker, ip string, port int) (state steward.ServiceState,
	logs string, err error) {

	_, logs, ret, err := system.System("ssh",
		"-o", "ConnectTimeout="+connectTimeout,
		"-o", "ConnectionAttempts="+connectionAttempts,
		host, "timeout", timeout, checker,
		"chk", ip, fmt.Sprintf("%d", port))

	state = parseState(ret)
	if state != steward.StatusUnknown {
		err = nil
	}

	return
}
Esempio n. 5
0
func sshPut(host, checker, ip string, port int, flag string) (cred, logs string,
	state steward.ServiceState, err error) {

	cred, logs, ret, err := system.System("ssh",
		"-o", "ConnectTimeout="+connectTimeout,
		"-o", "ConnectionAttempts="+connectionAttempts,
		host, "timeout", timeout, checker,
		"put", ip, fmt.Sprintf("%d", port), flag)

	state = parseState(ret)
	if state != steward.StatusUnknown {
		err = nil
	}

	cred = strings.Trim(cred, " \n")

	return
}