basic-stats Cookbook
This is a very simple cookbook around a shell script that fetches most basic system health stats and pushes them to a statsd server somewhere. I want to have a version of this on all my boxes and as they vary, the first version of the shell script decided which system it's on. This might later be changed, as the recipe can figure this out and have a slimmer script on each platform.
Requirements
The following platform families are supported:
- Debian
- Mac OS X
- FreeBSD
packages
nc
- use netcat to send the stats via UDP
Attributes
basic-stats::default
Key | Type | Description | Default |
---|---|---|---|
['basic-stats']['host'] | String | hostname or ip of the remote statsd | 127.0.0.1 |
['basic-stats']['port'] | String | port to send to | 8125 |
['basic-stats']['interface'] | String | network interface to fetch stats from | eth0 |
['basic-stats']['location'] | String | path to write the script to | /usr/local/bin |
['basic-stats']['cron']['minute'] | String | cron description for minute | * |
['basic-stats']['cron']['hour'] | String | cron description for hour | * |
['basic-stats']['cron']['day'] | String | cron description for day | * |
['basic-stats']['cron']['month'] | String | cron description for month | * |
['basic-stats']['cron']['weekday'] | String | cron description for weekday | * |
Usage
basic-stats::default
Just include basic-stats
in your node's run_list
with a configured host
:
{
"name":"my_node",
"normal": {
"basic-stats": {
"host": "logs.example.net"
}
},
"run_list": [
"recipe[basic-stats]"
]
}
Contributing
e.g.
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Authors
- Andreas Lappe
License
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.