forked from grafana/agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update windows defaults to use upstream defaults except for enabled c…
…ollectors. (grafana#5832) Fix grafana#5831 and use the defaults from windows.
- Loading branch information
1 parent
0c4d737
commit 9ddd939
Showing
7 changed files
with
174 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package windows | ||
|
||
import ( | ||
windows_integration "github.com/grafana/agent/pkg/integrations/windows_exporter" | ||
col "github.com/prometheus-community/windows_exporter/pkg/collector" | ||
"strings" | ||
) | ||
|
||
// DefaultArguments holds non-zero default options for Arguments when it is | ||
// unmarshaled from YAML. | ||
var DefaultArguments = Arguments{ | ||
EnabledCollectors: strings.Split(windows_integration.DefaultConfig.EnabledCollectors, ","), | ||
Dfsr: DfsrConfig{ | ||
SourcesEnabled: strings.Split(col.ConfigDefaults.Dfsr.DfsrEnabledCollectors, ","), | ||
}, | ||
Exchange: ExchangeConfig{ | ||
EnabledList: strings.Split(col.ConfigDefaults.Exchange.CollectorsEnabled, ","), | ||
}, | ||
IIS: IISConfig{ | ||
AppBlackList: col.ConfigDefaults.Iis.AppExclude, | ||
AppWhiteList: col.ConfigDefaults.Iis.AppInclude, | ||
SiteBlackList: col.ConfigDefaults.Iis.SiteExclude, | ||
SiteWhiteList: col.ConfigDefaults.Iis.SiteInclude, | ||
AppInclude: col.ConfigDefaults.Iis.AppInclude, | ||
AppExclude: col.ConfigDefaults.Iis.AppExclude, | ||
SiteInclude: col.ConfigDefaults.Iis.SiteInclude, | ||
SiteExclude: col.ConfigDefaults.Iis.SiteExclude, | ||
}, | ||
LogicalDisk: LogicalDiskConfig{ | ||
BlackList: col.ConfigDefaults.LogicalDisk.VolumeExclude, | ||
WhiteList: col.ConfigDefaults.LogicalDisk.VolumeInclude, | ||
Include: col.ConfigDefaults.LogicalDisk.VolumeInclude, | ||
Exclude: col.ConfigDefaults.LogicalDisk.VolumeExclude, | ||
}, | ||
MSMQ: MSMQConfig{ | ||
Where: col.ConfigDefaults.Msmq.QueryWhereClause, | ||
}, | ||
MSSQL: MSSQLConfig{ | ||
EnabledClasses: strings.Split(col.ConfigDefaults.Mssql.EnabledCollectors, ","), | ||
}, | ||
Network: NetworkConfig{ | ||
BlackList: col.ConfigDefaults.Net.NicExclude, | ||
WhiteList: col.ConfigDefaults.Net.NicInclude, | ||
Include: col.ConfigDefaults.Net.NicInclude, | ||
Exclude: col.ConfigDefaults.Net.NicExclude, | ||
}, | ||
Process: ProcessConfig{ | ||
BlackList: col.ConfigDefaults.Process.ProcessExclude, | ||
WhiteList: col.ConfigDefaults.Process.ProcessInclude, | ||
Include: col.ConfigDefaults.Process.ProcessInclude, | ||
Exclude: col.ConfigDefaults.Process.ProcessExclude, | ||
}, | ||
ScheduledTask: ScheduledTaskConfig{ | ||
Include: col.ConfigDefaults.ScheduledTask.TaskInclude, | ||
Exclude: col.ConfigDefaults.ScheduledTask.TaskExclude, | ||
}, | ||
Service: ServiceConfig{ | ||
UseApi: "false", | ||
Where: col.ConfigDefaults.Service.ServiceWhereClause, | ||
}, | ||
SMTP: SMTPConfig{ | ||
BlackList: col.ConfigDefaults.Smtp.ServerExclude, | ||
WhiteList: col.ConfigDefaults.Smtp.ServerInclude, | ||
Include: col.ConfigDefaults.Smtp.ServerInclude, | ||
Exclude: col.ConfigDefaults.Smtp.ServerExclude, | ||
}, | ||
TextFile: TextFileConfig{ | ||
TextFileDirectory: col.ConfigDefaults.Textfile.TextFileDirectories, | ||
}, | ||
} | ||
|
||
// SetToDefault implements river.Defaulter. | ||
func (a *Arguments) SetToDefault() { | ||
*a = DefaultArguments | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.