bosun.org@v0.0.0-20210513094433-e25bc3e69a1f/cmd/scollector/conf/conf.go (about) 1 // Package conf contains all of the configuration structs for scollector. 2 package conf // import "bosun.org/cmd/scollector/conf" 3 4 import ( 5 "bosun.org/opentsdb" 6 ) 7 8 type Conf struct { 9 // Host is the OpenTSDB or Bosun host to send data. 10 Host string 11 // FullHost enables full hostnames: doesn't truncate to first ".". 12 FullHost bool 13 // ColDir is the external collectors directory. 14 ColDir string 15 // Tags are added to every datapoint. If a collector specifies the same tag 16 // key, this one will be overwritten. The host tag is not supported. 17 Tags opentsdb.TagSet 18 // Hostname overrides the system hostname. 19 Hostname string 20 // DisableSelf disables sending of scollector self metrics. 21 DisableSelf bool 22 // Freq is the default frequency in seconds for most collectors. 23 Freq int 24 // BatchSize is the number of metrics that will be sent in each batch. 25 BatchSize int 26 // MaxQueueLen is the number of metrics keept internally. 27 MaxQueueLen int 28 // MaxMem is the maximum number of megabytes that can be allocated 29 // before scollector panics (shuts down). Default of 500 MB. This 30 // is a saftey mechanism to protect the host from the monitoring 31 // agent 32 MaxMem uint64 33 // Filter filters collectors matching these terms. 34 Filter []string 35 // PProf is an IP:Port binding to be used for debugging with pprof and expvar package. 36 // When enabled data is exposed via http://host:port/debug/pprof or /debug/vars 37 // Examples: localhost:6060 for loopback or :6060 for all IP addresses. 38 PProf string 39 // MetricFilters takes regular expressions and includes only indicies that 40 // match those filters from being monitored 41 MetricFilters []string 42 43 // KeepalivedCommunity, if not empty, enables the Keepalived collector with 44 // the specified community. 45 KeepalivedCommunity string 46 47 //Override default network interface expression 48 IfaceExpr string 49 50 // UseNtlm specifies if HTTP requests should authenticate with NTLM. 51 UseNtlm bool 52 53 // AuthToken is an optional string that sets the X-Access-Token HTTP header 54 // which is used to authenticate against Bosun 55 AuthToken string 56 57 // UserAgentMessage is an optional message that is appended to the User Agent 58 UserAgentMessage string 59 60 // SNMPTimeout is the number of seconds to wait for SNMP responses (default 30) 61 SNMPTimeout int 62 63 // UseSWbemServicesClient specifies if the wmi package should use SWbemServices. 64 UseSWbemServicesClient bool 65 66 // MetricPrefix prepended to all metrics path 67 MetricPrefix string 68 69 HAProxy []HAProxy 70 SNMP []SNMP 71 MIBS map[string]MIB 72 ICMP []ICMP 73 Vsphere []Vsphere 74 AWS []AWS 75 AzureEA []AzureEA 76 Process []ProcessParams 77 SystemdService []ServiceParams 78 ProcessDotNet []ProcessDotNet 79 HTTPUnit []HTTPUnit 80 Riak []Riak 81 Github []Github 82 Elastic []Elastic 83 // ElasticIndexFilters takes regular expressions and excludes indicies that 84 // match those filters from being monitored for metrics in the elastic.indices 85 // namespace 86 ElasticIndexFilters []string 87 // ElasticIndexFiltersInc is like ElasticIndexFilters, but only includes indices that match 88 ElasticIndexFiltersInc []string 89 RabbitMQ []RabbitMQ 90 Nexpose []Nexpose 91 GoogleAnalytics []GoogleAnalytics 92 GoogleWebmaster []GoogleWebmaster 93 Cadvisor []Cadvisor 94 RedisCounters []RedisCounters 95 ExtraHop []ExtraHop 96 LocalListener string 97 TagOverride []TagOverride 98 HadoopHost string 99 HbaseRegions bool 100 Oracles []Oracle 101 Fastly []Fastly 102 } 103 104 type HAProxy struct { 105 User string 106 Password string 107 Instances []HAProxyInstance 108 } 109 110 type HAProxyInstance struct { 111 User string 112 Password string 113 Tier string 114 URL string 115 } 116 117 type Nexpose struct { 118 Username string 119 Password string 120 Host string 121 Insecure bool 122 } 123 124 type GoogleAnalytics struct { 125 ClientID string 126 Secret string 127 Token string 128 JSONToken string 129 Sites []GoogleAnalyticsSite 130 } 131 132 type GoogleWebmaster struct { 133 ClientID string 134 Secret string 135 Token string 136 JSONToken string 137 } 138 139 type Fastly struct { 140 Key string 141 StatusBaseAddr string 142 } 143 144 type GoogleAnalyticsSite struct { 145 Name string 146 Profile string 147 Offset int 148 Detailed bool 149 } 150 151 type ICMP struct { 152 Host string 153 } 154 155 type Vsphere struct { 156 Host string 157 User string 158 Password string 159 } 160 161 type AWS struct { 162 AccessKey string 163 SecretKey string 164 Region string 165 BillingProductCodesRegex string 166 BillingBucketName string 167 BillingBucketPath string 168 BillingPurgeDays int 169 } 170 171 type AzureEA struct { 172 EANumber uint32 173 APIKey string 174 LogBillingDetails bool 175 LogResourceDetails bool 176 LogExtraTags bool 177 } 178 179 type SNMP struct { 180 Community string 181 Host string 182 MIBs []string 183 } 184 185 type MIB struct { 186 BaseOid string 187 Metrics []MIBMetric // single key metrics 188 Trees []MIBTree // tagged array metrics 189 } 190 191 type MIBMetric struct { 192 Metric string 193 Oid string 194 Unit string // metadata unit 195 RateType string // defaults to gauge 196 Description string 197 FallbackOid string // Oid to try if main one doesn't work. Used in cisco where different models use different oids 198 Tags string // static tags to populate for this metric. "direction=in" 199 Scale float64 200 } 201 202 type MIBTag struct { 203 Key string 204 Oid string // If present will load from this oid. Use "idx" to populate with index of row instead of another oid. 205 } 206 207 type MIBTree struct { 208 BaseOid string 209 Tags []MIBTag 210 Metrics []MIBMetric 211 } 212 213 type ProcessDotNet struct { 214 Name string 215 } 216 217 type HTTPUnit struct { 218 TOML string 219 Hiera string 220 Freq string 221 } 222 223 type Riak struct { 224 URL string 225 } 226 227 type RabbitMQ struct { 228 URL string 229 } 230 231 type Github struct { 232 Repo string 233 Token string 234 } 235 236 type Cadvisor struct { 237 URL string 238 PerCpuUsage bool 239 IsRemote bool 240 } 241 242 type RedisCounters struct { 243 Server string 244 Database int 245 } 246 247 type ExtraHop struct { 248 Host string 249 APIKey string 250 FilterBy string 251 FilterPercent int 252 AdditionalMetrics []string 253 CertificateSubjectMatch string 254 CertificateActivityGroup int 255 } 256 257 type TagOverride struct { 258 CollectorExpr string 259 MatchedTags map[string]string 260 Tags map[string]string 261 } 262 263 type Oracle struct { 264 ClusterName string 265 Instances []OracleInstance 266 } 267 268 type OracleInstance struct { 269 ConnectionString string 270 Role string 271 } 272 273 // Optional Elastic instance configuration - if omitted then the defaults are used 274 // You can also define multiple instances where more than one node is running 275 type Elastic struct { 276 Host string // default is localhost 277 Port uint16 // default is 9200 278 ClusterInterval string // default is DefaultFreq 279 IndexInterval string // default is 15 mins 280 User string // default is empty 281 Password string // default is empty 282 Disable bool // default is false. 283 Name string // default is host_port 284 Scheme string // default is http 285 }