forked from bryanwb/chef-nagios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadata.json
38 lines (38 loc) · 14.7 KB
/
metadata.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"dependencies": {
"xinetd": ">= 0.0.0",
"build-essential": ">= 0.0.0"
},
"name": "nagios",
"maintainer_email": "[email protected]",
"attributes": {
},
"license": "Apache 2.0",
"suggestions": {
},
"platforms": {
"scientific": ">= 0.0.0",
"debian": ">= 0.0.0",
"fedora": ">= 0.0.0",
"centos": ">= 0.0.0",
"ubuntu": ">= 0.0.0",
"redhat": ">= 0.0.0"
},
"maintainer": "Bryan W. Berry",
"long_description": "Description\n===========\n\nInstalls and configures Nagios 3 for a server and for clients using Chef search capabilities.\n\nChanges\n=======\n\n## v1.0.0:\n\n* Use Chef 0.10's `node.chef_environment` instead of `node['app_environment']`.\n* source installation support on both client and server sides\n* initial RHEL/CentOS/Fedora support\n\nRequirements\n============\n\nChef\n----\n\nChef version 0.10.0+ is required for chef environment usage. See __Environments__ under __Usage__ below.\n\nA data bag named 'users' should exist, see __Data Bag__ below.\n\nThe monitoring server that uses this recipe should have a role named 'monitoring' or similar, this is settable via an attribute. See __Attributes__ below.\n\nBecause of the heavy use of search, this recipe will not work with Chef Solo, as it cannot do any searches without a server.\n\nPlatform\n--------\n\n* Debian, Ubuntu\n* RHEL, CentOS, Fedora\n\nTested on Ubuntu 10.04 and CentOS 5.5\n\nCookbooks\n---------\n\n* apache2\n* build-essential\n* php\n\n\nAttributes\n==========\n\ndefault\n-------\n\nThe following attributes are used by both client and server recipes.\n\n* `node['nagios']['user']` - nagios user, default 'nagios'.\n* `node['nagios']['group']` - nagios group, default 'nagios'.\n* `node['nagios']['plugin_dir']` - location where nagios plugins go,\n* default '/usr/lib/nagios/plugins'.\n\nclient\n------\n\nThe following attributes are used for the client NRPE checks for warning and critical levels.\n\n* `node['nagios']['client']['install_method']` - whether to install from package or source. Default chosen by platform based on known packages available for Nagios 3: debian/ubuntu 'package', redhat/centos/fedora/scientific: source\n* `node['nagios']['plugins']['url']` - url to retrieve the plugins source\n* `node['nagios']['plugins']['version']` - version of the plugins\n* `node['nagios']['plugins']['checksum']` - checksum of the plugins source tarball\n* `node['nagios']['nrpe']['home']` - home directory of nrpe, default /usr/lib/nagios\n* `node['nagios']['nrpe']['conf_dir']` - location of the nrpe configuration, default /etc/nagios\n* `node['nagios']['nrpe']['url']` - url to retrieve nrpe source\n* `node['nagios']['nrpe']['version']` - version of nrpe to download\n* `node['nagios']['nrpe']['checksum']` - checksum of the nrpe source tarball\n* `node['nagios']['checks']['memory']['critical']` - threshold of critical memory usage, default 150\n* `node['nagios']['checks']['memory']['warning']` - threshold of warning memory usage, default 250\n* `node['nagios']['checks']['load']['critical']` - threshold of critical load average, default 30,20,10\n* `node['nagios']['checks']['load']['warning']` - threshold of warning load average, default 15,10,5\n* `node['nagios']['checks']['smtp_host']` - default relayhost to check for connectivity. Default is an empty string, set via an attribute in a role.\n* `node['nagios']['server_role']` - the role that the nagios server will have in its run list that the clients can search for.\n\nclient_xinetd\n-------------\nThis recipe uses the xinet daemon to run the nagios client instead of the nagios nrpe daemon. This provides for better logging opportunities as the nrpe daemon is otherwise difficult to log. \n\nThis recipe depends on the xinetd cookbook\n\nThe client_xinetd uses the following attributes\n\n* `node['nagios']['client']['install_method']` - whether to install from package or source. Default chosen by platform based on known packages available for Nagios 3: debian/ubuntu 'package', redhat/centos/fedora/scientific: source\n* `node['nagios']['plugins']['url']` - url to retrieve the plugins source\n* `node['nagios']['plugins']['version']` - version of the plugins\n* `node['nagios']['plugins']['checksum']` - checksum of the plugins source tarball\n* `node['nagios']['nrpe']['home']` - home directory of nrpe, default /usr/lib/nagios\n* `node['nagios']['nrpe']['conf_dir']` - location of the nrpe configuration, default /etc/nagios\n* `node['nagios']['nrpe']['url']` - url to retrieve nrpe source\n* `node['nagios']['nrpe']['version']` - version of nrpe to download\n* `node['nagios']['nrpe']['checksum']` - checksum of the nrpe source tarball\n* node['nagios_server'] - the ip address of the nagios server in case there isn't a server with nagios_server in it run list, as some setups may not use chef to configure their server\n\nserver\n------\n\nDefault directory locations are based on FHS. Change to suit your preferences.\n\n* `node['nagios']['server']['install_method']` - whether to install from package or source. Default chosen by platform based on known packages available for Nagios 3: debian/ubuntu 'package', redhat/centos/fedora/scientific: source\n* `node['nagios']['server']['service_name']` - name of the service used for nagios, default chosen by platform, debian/ubuntu \"nagios3\", redhat family \"nagios\", all others, \"nagios\"\n* `node['nagios']['home']` - nagios main home directory, default \"/usr/lib/nagios3\"\n* `node['nagios']['conf_dir']` - location where main nagios config lives, default \"/etc/nagios3\"\n* `node['nagios']['config_dir']` - location where included configuration files live, default \"/etc/nagios3/conf.d\"\n* `node['nagios']['log_dir']` - location of nagios logs, default \"/var/log/nagios3\"\n* `node['nagios']['cache_dir']` - location of cached data, default \"/var/cache/nagios3\"\n* `node['nagios']['state_dir']` - nagios runtime state information, default \"/var/lib/nagios3\"\n* `node['nagios']['run_dir']` - where pidfiles are stored, default \"/var/run/nagios3\"\n* `node['nagios']['docroot']` - nagios webui docroot, default \"/usr/share/nagios3/htdocs\"\n\n* `node['nagios']['notifications_enabled']` - set to 1 to enable notification.\n* `node['nagios']['check_external_commands']`\n* `node['nagios']['default_contact_groups']`\n* `node['nagios']['sysadmin_email']` - default notification email.\n* `node['nagios']['sysadmin_sms_email']` - default notification sms.\n* `node['nagios']['server_auth_method']` - authentication with the server can be done with openid (using `apache2::mod_auth_openid`), or htauth (basic). The default is openid, any other value will use htauth (basic).\n* `node['nagios']['templates']`\n* `node['nagios']['interval_length']` - minimum interval.\n* `node['nagios']['default_host']['check_interval']`\n* `node['nagios']['default_host']['retry_interval']`\n* `node['nagios']['default_host']['max_check_attempts']`\n* `node['nagios']['default_host']['notification_interval']`\n* `node['nagios']['default_service']['check_interval']`\n* `node['nagios']['default_service']['retry_interval']`\n* `node['nagios']['default_service']['max_check_attempts']`\n* `node['nagios']['default_service']['notification_interval']`\n\nRecipes\n=======\n\ndefault\n-------\n\nIncludes the `nagios::client` recipe.\n\nclient\n------\n\nIncludes the correct client installation recipe based on platform, either `nagios::client_package` or `nagios::client_source`.\n\nThe client recipe searches for servers allowed to connect via NRPE that have a role named in the `node['nagios']['server_role']` attribute. The recipe will also install the required packages and start the NRPE service. A custom plugin for checking memory is also added.\n\nSearches are confined to the node's `chef_environment`.\n\nClient commands for NRPE can be modified by editing the nrpe.cfg.erb template.\n\nclient\\_package\n--------------\n\nInstalls the Nagios client libraries from packages. Default for Debian / Ubuntu systems.\n\nclient\\_source\n-------------\n\nInstalls the Nagios client libraries from source. Default for Red Hat / CentOS / Fedora systems as native packages of Nagios 3 are not available in the default repositories.\n\nserver\n------\n\nIncludes the correct client installation recipe based on platform, either `nagios::server_package` or `nagios::server_source`.\n\nThe server recipe sets up Apache as the web front end. The nagios::client recipe is also included. This recipe also does a number of searches to dynamically build the hostgroups to monitor, hosts that belong to them and admins to notify of events/alerts.\n\nSearches are confined to the node's `chef_environment`.\n\nThe recipe does the following:\n\n1. Searches for members of the sysadmins group by searching through 'users' data bag and adds them to a list for notification/contacts.\n2. Search all nodes for a role matching the app_environment.\n3. Search all available roles and build a list which will be the Nagios hostgroups.\n4. Search for all nodes of each role and add the hostnames to the hostgroups.\n5. Installs various packages required for the server.\n6. Sets up some configuration directories.\n7. Moves the package-installed Nagios configuration to a 'dist' directory.\n8. Disables the 000-default VirtualHost present on Debian/Ubuntu Apache2 package installations.\n9. Enables the Nagios web front end configuration.\n10. Sets up the configuration templates for services, contacts, hostgroups and hosts.\n\n*NOTE*: You will probably need to change the services.cfg.erb template for your environment.\n\nTo add custom commands for service checks, these can be done on a per-role basis by editing the 'services.cfg.erb' template. This template has some pre-configured checks that use role names used in an example infrastructure. Here's a brief description:\n\n* monitoring - check_smtp (e.g., postfix relayhost) w/ NRPE and tcp port 514 (e.g., rsyslog)\n* load\\_balancer - check_nginx with NRPE.\n* appserver - check_unicorn with NRPE, e.g. a Rails application using Unicorn.\n* database\\_master - check\\_mysql\\_server with NRPE for a MySQL database master.\n\nserver\\_package\n--------------\n\nInstalls the Nagios server libraries from packages. Default for Debian / Ubuntu systems.\n\nserver\\_source\n-------------\n\nInstalls the Nagios server libraries from source. Default for Red Hat / CentOS / Fedora systems as native packages of Nagios 3 are not available in the default repositories.\n\nData Bags\n=========\n\nCreate a `users` data bag that will contain the users that will be able to log into the Nagios webui. Each user can use htauth with a specified password, or an openid. Users that should be able to log in should be in the sysadmin group. Example user data bag item:\n\n {\n \"id\": \"nagiosadmin\",\n \"groups\": \"sysadmin\",\n \"htpasswd\": \"hashed_htpassword\",\n \"openid\": \"http://nagiosadmin.myopenid.com/\",\n \"nagios\": {\n \"pager\": \"[email protected]\",\n \"email\": \"[email protected]\"\n }\n }\n\nWhen using server_auth_method 'openid', use the openid in the data bag item. Any other value for this attribute (e.g., \"htauth\", \"htpasswd\", etc) will use the htpasswd value as the password in `/etc/nagios3/htpasswd.users`.\n\nThe openid must have the http:// and trailing /. The htpasswd must be the hashed value. Get this value with htpasswd:\n\n % htpasswd -n -s nagiosadmin\n New password:\n Re-type new password:\n nagiosadmin:{SHA}oCagzV4lMZyS7jl2Z0WlmLxEkt4=\n\nFor example use the `{SHA}oCagzV4lMZyS7jl2Z0WlmLxEkt4=` value in the data bag.\n\nRoles\n=====\n\nCreate a role to use for the monitoring server. The role name should match the value of the attribute \"nagios[:server_role]\". By default, this is 'monitoring'. For example:\n\n % cat roles/monitoring.rb\n name \"monitoring\"\n description \"Monitoring server\"\n run_list(\n \"recipe[nagios::server]\"\n )\n\n default_attributes(\n \"nagios\" => {\n \"server_auth_method\" => \"htauth\"\n }\n )\n\n % knife role from file monitoring.rb\n\nDefinitions\n===========\n\nnagios_conf\n-----------\n\nThis definition is used to drop in a configuration file in the base Nagios configuration directory's conf.d. This can be used for customized configurations for various services.\n\nLibraries\n=========\n\ndefault\n-------\n\nThe library included with the cookbook provides some helper methods used in templates.\n\n* nagios_boolean\n* nagios_interval - calculates interval based on interval length and a given number of seconds.\n* nagios_attr - retrieves a nagios attribute from the node.\n\nUsage\n=====\n\nSee below under __Environments__ for how to set up Chef 0.10 environment for use with this cookbook.\n\nFor a Nagios server, create a role named 'monitoring', and add the following recipe to the run_list:\n\n recipe[nagios::server]\n\nThis will allow client nodes to search for the server by this role and add its IP address to the allowed list for NRPE.\n\nTo install Nagios and NRPE on a client node:\n\n include_recipe \"nagios::client\"\n\nThis is a fairly complicated cookbook. For a walkthrough and example usage please see [Opscode's Nagios Quick Start](http://help.opscode.com/kb/otherhelp/nagios-quick-start).\n\nEnvironments\n------------\n\nThe searches used are confined to the node's `chef_environment`. If you do not use any environments (Chef 0.10+ feature) the `_default` environment is used, which is applied to all nodes in the Chef Server that are not in another defined role. To use environments, create them as files in your chef-repo, then upload them to the Chef Server.\n\n % cat environments/production.rb\n name \"production\"\n description \"Systems in the Production Environment\"\n\n % knife environment from file production.rb\n\nLicense and Author\n==================\n\nAuthor:: Joshua Sierles <[email protected]>\nAuthor:: Nathan Haneysmith <[email protected]>\nAuthor:: Joshua Timberman <[email protected]>\nAuthor:: Seth Chisamore <[email protected]>\n\nCopyright 2009, 37signals\nCopyright 2009-2011, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"version": "0.0.4",
"recommendations": {
},
"recipes": {
"nagios::client_xinetd": "Installs and configures a nagios client with nrpe"
},
"groupings": {
},
"conflicting": {
},
"replacing": {
},
"description": "Installs and configures nagios",
"providing": {
}
}