Skip to content

Commit

Permalink
fix cmd inject (#3809)
Browse files Browse the repository at this point in the history
Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
bobz965 authored Mar 11, 2024
1 parent a2977e4 commit be6cc86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ovnmonitor/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func (e *Exporter) getOvnStatus() map[string]int {
result["ovsdb-server-southbound"] = parseDbStatus(string(output))

// get ovn-northd status
pid, err := os.ReadFile("/var/run/ovn/ovn-northd.pid")
pid, err := os.ReadFile(e.Client.Service.Northd.File.Pid.Path)
if err != nil {
klog.Errorf("read ovn-northd pid failed, err %v", err)
result["ovn-northd"] = 0
} else {
cmdstr := "ovs-appctl -t /var/run/ovn/ovn-northd." + strings.Trim(string(pid), "\n") + ".ctl status"
cmdstr := fmt.Sprintf("ovs-appctl -t /var/run/ovn/ovn-northd.%s.ctl status", strings.Trim(string(pid), "\n"))
klog.V(3).Infof("cmd is %v", cmdstr)
cmd := exec.Command("sh", "-c", cmdstr)
output, err := cmd.CombinedOutput()
Expand Down

0 comments on commit be6cc86

Please sign in to comment.