mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-05-06 09:17:10 +00:00
Detect kubelet and container runtime frequent crashes
This commit is contained in:
@@ -32,7 +32,7 @@ func main() {
|
||||
fedo.AddFlags(pflag.CommandLine)
|
||||
pflag.Parse()
|
||||
|
||||
counter, err := logcounter.NewKmsgLogCounter(fedo)
|
||||
counter, err := logcounter.NewJournaldLogCounter(fedo)
|
||||
if err != nil {
|
||||
fmt.Print(err)
|
||||
os.Exit(int(types.Unknown))
|
||||
|
||||
@@ -29,14 +29,21 @@ func NewLogCounterOptions() *LogCounterOptions {
|
||||
// LogCounterOptions contains frequent event detector command line and application options.
|
||||
type LogCounterOptions struct {
|
||||
// command line options. See flag descriptions for the description
|
||||
Lookback string
|
||||
Pattern string
|
||||
Count int
|
||||
JournaldSource string
|
||||
LogPath string
|
||||
Lookback string
|
||||
Delay string
|
||||
Pattern string
|
||||
Count int
|
||||
}
|
||||
|
||||
// AddFlags adds log counter command line options to pflag.
|
||||
func (fedo *LogCounterOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&fedo.JournaldSource, "journald-source", "", "The source configuration of journald, e.g., kernel, kubelet, dockerd, etc")
|
||||
fs.StringVar(&fedo.LogPath, "log-path", "", "The log path that log watcher looks up")
|
||||
fs.StringVar(&fedo.Lookback, "lookback", "", "The time log watcher looks up")
|
||||
fs.StringVar(&fedo.Delay, "delay", "",
|
||||
"The time duration log watcher delays after node boot time. This is useful when log watcher needs to wait for some time until the node is stable.")
|
||||
fs.StringVar(&fedo.Pattern, "pattern", "",
|
||||
"The regular expression to match the problem in log. The pattern must match to the end of the line.")
|
||||
fs.IntVar(&fedo.Count, "count", 1,
|
||||
|
||||
Reference in New Issue
Block a user