You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.7 KiB
62 lines
1.7 KiB
探测url的ssl证书过期时间 并发微信告警
|
|
|
|
## build on arm64
|
|
```bash
|
|
cd /root
|
|
rm -rf remoteMonitor
|
|
git clone https://git.sre.ink/go/remoteMonitor.git
|
|
cd remoteMonitor
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go get github.com/shirou/gopsutil/v3/cpu@v3.21.12
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go get github.com/shirou/gopsutil/v3/disk@v3.21.12
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go mod tidy
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -v -a -o rtm main.go
|
|
chmod +x rtm
|
|
rm -rf /usr/bin/rtm
|
|
mv rtm /usr/bin/
|
|
rtm
|
|
```
|
|
## build amd64 oracle
|
|
```bash
|
|
cd /root
|
|
rm -rf remoteMonitor
|
|
git clone https://git.sre.ink/go/remoteMonitor.git
|
|
cd remoteMonitor
|
|
go get github.com/shirou/gopsutil/v3/cpu@v3.21.12
|
|
go get github.com/shirou/gopsutil/v3/disk@v3.21.12
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -v -a -o rtm main.go
|
|
chmod +x rtm
|
|
/bin/cp -arf rtm /usr/bin/rtm
|
|
/usr/bin/rtm
|
|
```
|
|
|
|
|
|
## build amd64 cn
|
|
```bash
|
|
cd /root
|
|
rm -rf remoteMonitor
|
|
git clone https://git.sre.ink/go/remoteMonitor.git
|
|
cd remoteMonitor
|
|
GOPROXY="https://goproxy.cn,direct" go get github.com/shirou/gopsutil/v3/cpu@v3.21.12
|
|
GOPROXY="https://goproxy.cn,direct" go get github.com/shirou/gopsutil/v3/disk@v3.21.12
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on GOPROXY="https://goproxy.cn,direct" go build -v -a -o rtm main.go
|
|
chmod +x rtm
|
|
rm -rf /usr/bin/rtm
|
|
mv rtm /usr/bin/
|
|
```
|
|
|
|
|
|
## crontab
|
|
```bash
|
|
*/1 * * * * /usr/bin/rtm
|
|
```
|
|
|
|
## usage
|
|
```bash
|
|
chmod +x /usr/bin/rtm
|
|
rtm
|
|
```
|
|
|
|
## build for arm64
|
|
```bash
|
|
CGO_ENABLED=0 GOARM=7 GOOS=linux GOARCH=arm64 GO111MODULE=on GOPROXY="https://goproxy.cn,direct" go build -v -a -o certmonitor main.go
|
|
``` |