You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/01/13 19:15:10 UTC

[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6510: Port TO check scripts to Go

zrhoffman commented on a change in pull request #6510:
URL: https://github.com/apache/trafficcontrol/pull/6510#discussion_r784218795



##########
File path: traffic_ops/app/bin/checks/ToPingCheck.go
##########
@@ -0,0 +1,363 @@
+/*
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+   http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+/* ToPingCheck.go
+   Used for checking ILO ping,  MTU test, 10G (IPv4), and 10G6 (IPv6) pings.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"flag"
+	"log"
+	"log/syslog"
+	"os"
+	"os/exec"
+	"path/filepath"
+	"regexp"
+	"strconv"
+	"strings"
+	"time"
+
+	tc "github.com/apache/trafficcontrol/lib/go-tc"
+	toclient "github.com/apache/trafficcontrol/traffic_ops/v3-client"
+	"github.com/romana/rlog"

Review comment:
       [`github.com/apache/trafficcontrol/lib/go-log`](https://pkg.go.dev/github.com/apache/trafficcontrol/lib/go-log) is preferred for logging

##########
File path: traffic_ops/app/bin/checks/ToCheck.go
##########
@@ -0,0 +1,126 @@
+/*
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+   http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+/* ToCheck.go
+   This is a simple app that allows you to submit arbitrary
+   check data to the Traffic Ops API. You need to supply check
+   name, server ID for the check, and the check value as an
+   integer. Useful for testing.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"flag"
+	"fmt"
+	"os"
+	"path/filepath"
+	"strings"
+	"time"
+
+	tc "github.com/apache/trafficcontrol/lib/go-tc"
+	toclient "github.com/apache/trafficcontrol/traffic_ops/v3-client"
+	"github.com/romana/rlog"

Review comment:
       Is there anything special about `github.com/romana/rlog`? Any reason not to use [`github.com/apache/trafficcontrol/lib/go-log`](https://pkg.go.dev/github.com/apache/trafficcontrol/lib/go-log) for logging?

##########
File path: traffic_ops/app/bin/checks/ToFQDNCheck.go
##########
@@ -0,0 +1,350 @@
+/*
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+   http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+/* ToFQDNCheck.go
+   This app verifies that forward DNS (A/AAAA) records match what is
+   recorded in TODB for each server. Optionally, it will validate
+   reverse (PTR) records as well to ensure that they agree with
+   forward DNS.
+*/
+
+package main
+
+import (
+	"context"
+	"encoding/json"
+	"flag"
+	"log"
+	"log/syslog"
+	"net"
+	"os"
+	"path/filepath"
+	"regexp"
+	"strings"
+	"time"
+
+	tc "github.com/apache/trafficcontrol/lib/go-tc"
+	toclient "github.com/apache/trafficcontrol/traffic_ops/v3-client"
+	"github.com/romana/rlog"

Review comment:
       [`github.com/apache/trafficcontrol/lib/go-log`](https://pkg.go.dev/github.com/apache/trafficcontrol/lib/go-log) should be used for logging




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org