v0.6.1 优化CSS、服务报警、服务状态展示

This commit is contained in:
naiba
2021-04-19 23:11:00 +08:00
parent 114f47cb0f
commit d3c3e55c88
9 changed files with 87 additions and 46 deletions

View File

@@ -10,6 +10,7 @@ import (
"os/exec"
"time"
"github.com/genkiroid/cert"
"github.com/go-ping/ping"
"github.com/naiba/nezha/pkg/utils"
"github.com/shirou/gopsutil/v3/cpu"
@@ -20,8 +21,8 @@ import (
func main() {
// icmp()
// tcpping()
// httpWithSSLInfo()
sysinfo()
httpWithSSLInfo()
// sysinfo()
// cmdExec()
}
@@ -72,11 +73,12 @@ func httpWithSSLInfo() {
httpClient := &http.Client{Transport: transCfg, CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}}
resp, err := httpClient.Get("http://mail.nai.ba")
fmt.Println(err, resp.StatusCode)
url := "https://ops.naibahq.com"
resp, err := httpClient.Get(url)
fmt.Println(err, resp)
// SSL 证书信息获取
// c := cert.NewCert("expired-ecc-dv.ssl.com")
// fmt.Println(c.Error)
c := cert.NewCert(url[8:])
fmt.Println(c.Error)
}
func icmp() {