Skip to content

Commit

Permalink
Added 'uniq' in commands to add consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Carnero committed Nov 15, 2018
1 parent eba54b5 commit c312801
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion acct.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (
)

const (
acctCommand = "sacct -n -a -X -o \"JobIDRaw,JobName%%20,User%%20,Partition%%20,State%%20\" -S%02d:%02d:%02d -sBF,CA,CD,CF,F,NF,PR,RS,S,TO | grep -v 'PENDING\\|COMPLETING\\|RUNNING'"
acctCommand = "sacct -n -a -X -o \"JobIDRaw,JobName%%20,User%%20,Partition%%20,State%%20\" -S%02d:%02d:%02d -sBF,CA,CD,CF,F,NF,PR,RS,S,TO | grep -v 'PENDING\\|COMPLETING\\|RUNNING' | uniq"
)

func (sc *SlurmCollector) collectAcct(ch chan<- prometheus.Metric) {
Expand Down
2 changes: 1 addition & 1 deletion info.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
)

const (
infoCommand = "sinfo -h -o \"%20R %.5a %.15F\""
infoCommand = "sinfo -h -o \"%20R %.5a %.15F\" | uniq"
iSTATESNUMBER = 3
)

Expand Down
2 changes: 1 addition & 1 deletion queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (sc *SlurmCollector) collectQueue(ch chan<- prometheus.Metric) {
var currentCommand string

if len(sc.alreadyRegistered) > 0 {
currentCommand = fmt.Sprintf(queueCommand+" | grep -v '%s'", strings.Join(sc.alreadyRegistered, "\\|"))
currentCommand = fmt.Sprintf(queueCommand+" | grep -v '%s' | uniq", strings.Join(sc.alreadyRegistered, "\\|"))
sc.alreadyRegistered = make([]string, 0) // free memory
} else {
currentCommand = queueCommand
Expand Down

0 comments on commit c312801

Please sign in to comment.