Skip to content

Commit

Permalink
fix globalvariable missing if monit multiple mysql instance
Browse files Browse the repository at this point in the history
  • Loading branch information
arstercz committed Sep 8, 2022
1 parent e1102de commit 10c850b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/inputs/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ func (m *Mysql) Gather(acc telegraf.Accumulator) error {
}

wg.Wait()
m.lastT = time.Now() // maybe multiple instance

return nil
}

Expand Down Expand Up @@ -502,7 +504,6 @@ func (m *Mysql) gatherServer(serv string, acc telegraf.Accumulator) error {
if err != nil {
return err
}
m.lastT = time.Now()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/telegraf-discover
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ sub disc_mysql {
## Some queries we may want to run less often (such as SHOW GLOBAL VARIABLES)
## example: interval_slow = "30m"
interval_slow = "1m"
interval_slow = "3m"
TEMP_END

return _replace_mysql($temp, $items);
Expand Down

0 comments on commit 10c850b

Please sign in to comment.