Skip to content

Commit

Permalink
Add options
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Plourde <[email protected]>
  • Loading branch information
palourde committed Feb 5, 2020
1 parent 5c71f32 commit db24cc8
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import (
// Handler represents the sensu-puppet-handler plugin
type Handler struct {
sensu.PluginConfig
endpoint string
endpoint string
keystoreFile string
keystorePassword string
truststoreFile string
truststorePassword string
httpProxy string
timeout int
}

var (
Expand All @@ -30,10 +36,51 @@ var (
Env: "PUPPET_ENDPOINT",
Argument: "endpoint",
Shorthand: "e",
Default: "",
Usage: "The PuppetDB API endpoint (URL). If an API path is not specified, /pdb/query/v4/nodes/ will be used",
Usage: "the PuppetDB API endpoint (URL). If an API path is not specified, /pdb/query/v4/nodes/ will be used",
Value: &handler.endpoint,
},
&sensu.PluginConfigOption{
Path: "keystore_file",
Env: "PUPPET_KEYSTORE_FILE",
Argument: "keystore_file",
Usage: "the file path for the SSL certificate keystore",
Value: &handler.keystoreFile,
},
&sensu.PluginConfigOption{
Path: "keystore_password",
Env: "PUPPET_KEYSTORE_PASSWORD",
Argument: "keystore_password",
Usage: "the SSL certificate keystore password",
Value: &handler.keystorePassword,
},
&sensu.PluginConfigOption{
Path: "truststore_file",
Env: "PUPPET_TRUSTSTORE_FILE",
Argument: "truststore_file",
Usage: "the file path for the SSL certificate truststore",
Value: &handler.truststoreFile,
},
&sensu.PluginConfigOption{
Path: "truststore_password",
Env: "PUPPET_TRUSTSTORE_PASSWORD",
Argument: "truststore_password",
Usage: "the SSL certificate truststore password",
Value: &handler.truststorePassword,
},
&sensu.PluginConfigOption{
Path: "http_proxy",
Env: "PUPPET_HTTP_PROXY",
Argument: "http_proxy",
Usage: "the URL of a proxy to be used for HTTP requests",
Value: &handler.httpProxy,
},
&sensu.PluginConfigOption{
Path: "timeout",
Env: "PUPPET_TIMEOUT",
Argument: "timeout",
Usage: "the handler execution duration timeout in seconds (hard stop)",
Value: &handler.httpProxy,
},
}
)

Expand Down

0 comments on commit db24cc8

Please sign in to comment.