[]
The command-runner binary is an advanced tool tailored for system and server monitoring. At its core, it gathers data from various sources, structures it in JSON format, and pushes it to the datapushgateway. Often, it is used alongside p4prometheus.
Provided steps for installation is part of p4prometheus. However if you'd like to solo install please see here Installer Guide
`command-runner [flags]`
--debug (-d)
: Enable debug logging.--cloud
: Cloud provider (aws, gcp, azure, or onprem). Defaults to autocloud.--instance (-i)
: SDP instance commands argument for the command-runner.--log (-l)
: Path to write the log file. Defaults to the value in the schema.--output (-o)
: Path to the output JSON file. Defaults to the value in the schema.--metrics.config (-m)
: Path to the metrics configuration file. Defaults to the value in the schema.--vars
: Path to the custom vars file to source when running P4 commands. Defaults to the value in the schema.--cmd.config (-c)
: Path to the cmd_config.yaml file. Defaults to the value in the schema.Provide details on how others can contribute to this project, if open for contributions.
Specify the license here or provide a link to the license.
shell
Copy code
./command-runner --cloud=aws --instance=Instance123
This is currently a Community Supported Perforce tool.
make build
command to compile the command-runner binary for your current platform. This uses your current Git branch and revision to stamp the binary with version information.make dist
to build the binary for multiple platforms including Darwin (Mac), Linux, and Windows. The compiled binaries can be found within the bin directory. Additionally, gzipped versions for Darwin and Windows binaries are created.
- []
- # Command-runner Binary
- ## Overview
- The command-runner binary is an advanced tool tailored for system and server monitoring. At its core, it gathers data from various sources, structures it in JSON format, and pushes it to the datapushgateway. Often, it is used alongside p4prometheus.
- ### Features
- - P4 Instance File Parsing: Parses specific Perforce instance files ensuring data security.
- - AWS Token Retrieval: Safely fetches AWS tokens for authentication and authorization.
- - AWS and GCP Identity Data Collection: Collects identity documents and metadata.
- - Error Handling: Effectively logs and conserves any execution errors in a dedicated JSON file.
- ## Requirements
- - Go Language 1.18
- - Ensure the command-runner binary is installed on the target system.
- - Required permissions to execute commands on target servers or SDP/P4 instances.
- - Knowledge of main flags that determine the behavior of the binary.
- Table of Contents
- -----------------
- * [Installation](#installation)
- * [Usage](#usage)
- * [Command-Line Flags](#flags)
- * [Contribution](#contribution)
- * [License](#license)
- Installation
- ------------
- Provided steps for installation is part of p4prometheus. However if you'd like to solo install please see here
- [Installer Guide](https://github.com/perforce/command-runner/blob/master/Installer_Guide.md)
- Usage
- -----
- `command-runner [flags]`
- Command-Line Flags
- ------------------
- * `--debug (-d)`: Enable debug logging.
- * `--cloud`: Cloud provider (aws, gcp, azure, or onprem). Defaults to autocloud.
- * `--instance (-i)`: SDP instance commands argument for the command-runner.
- * `--log (-l)`: Path to write the log file. Defaults to the value in the schema.
- * `--output (-o)`: Path to the output JSON file. Defaults to the value in the schema.
- * `--metrics.config (-m)`: Path to the metrics configuration file. Defaults to the value in the schema.
- * `--vars`: Path to the custom vars file to source when running P4 commands. Defaults to the value in the schema.
- * `--cmd.config (-c)`: Path to the cmd\_config.yaml file. Defaults to the value in the schema.
- Contribution
- ------------
- Provide details on how others can contribute to this project, if open for contributions.
- License
- -------
- Specify the license here or provide a link to the license.
- shell
- Copy code
- ```./command-runner --cloud=aws --instance=Instance123 ```
- ### Data Flow & Outputs
- - Once executed, the binary assesses flags, preparing the system for data collection.
- - Data from various commands, depending on the flags, is gathered and structured into a JSON format.
- - The resultant data is then dispatched to datapushgateway.
- - You'll find the output JSON in /tmp/out.json, unless an alternative path is specified. However the file is blanked out after the command-runner has completed execution.
- - Logs provide insights into the execution process, assisting in troubleshooting.
- ### Safety & Best Practices
- - Ensure appropriate permissions before binary execution.
- - Caution is advised with flag usage, especially in production.
- - Maintain a watchful eye on logs, especially under the --debug flag.
- ## Support
- This is currently a Community Supported Perforce tool.
- ## Build/Usage
- - Standard Build:
- - Use the ```make build``` command to compile the command-runner binary for your current platform. This uses your current Git branch and revision to stamp the binary with version information.
- - Distributed Build for Multiple OS Platforms:
- - Execute ```make dist``` to build the binary for multiple platforms including Darwin (Mac), Linux, and Windows. The compiled binaries can be found within the bin directory. Additionally, gzipped versions for Darwin and Windows binaries are created.
- ## TODOs
- - sign yaml and autobot scripts/biniaries for addded security.
- - Various todos in the source and code cleanup and refactoring of redunant code.command-runner
- - The way the files are written need to be absolutely redone.
- - Write the json in memory then send it (Flag many?)
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 31315 | Will Kreitzmann |
v1.2.654. - release |
about a month ago | |
#1 | 31273 | Will Kreitzmann | placeholder | 2 months ago |