Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

cacti (7) Versions 0.6.0

Cookbook for installing/configuring Cacti

Berkshelf/Librarian
Policyfile
Knife
cookbook 'cacti', '~> 0.6.0'
cookbook 'cacti', '~> 0.6.0', :supermarket
knife cookbook site install cacti
knife cookbook site download cacti
README
Dependencies
Changelog
Quality

chef-cacti Build Status

Description

Install/configures Cacti and optionally Spine.

Requirements

Chef

  • Chef 11 (for 0.3.0+ of cookbook)

Platforms

  • CentOS 6
  • Fedora 19, 20
  • PLD Linux Th (Experimental)
  • Red Hat Enterprise Linux 6

Databases

  • MySQL

Cookbooks

  • apache2
  • apt
  • build-essentials
  • cron
  • database
  • mysql
  • yum-epel

Attributes

These attributes are under the node['cacti'] namespace.

Attribute Description Type Default
cacti_dir Directory for Cacti installation String /usr/share/cacti
cron_minute Schedule to pass to cron String */5
db_file Database configuration file for Cacti String auto-detected (see attributes/default.rb)
group Group to own Cacti files String apache2
packages Packages for Cacti installation Array auto-detected (see attributes/default.rb)
poller_cmd Poller command to run String auto-detected (see attributes/default.rb)
poller_file Poller file for Cacti String auto-detected (see attributes/default.rb)
user Username to own Cacti files String cacti
version Version of Cacti to install or installed String auto-detected (see attributes/default.rb)

Admin Attributes

These attributes are under the node['cacti']['admin'] namespace.

Attribute Description Type Default
password Local administrator password String changeit

Apache2 Attributes

These attributes are under the node['cacti']['apache2'] namespace.

Attribute Description Type Default
doc_root VirtualHost DocumentRoot String /var/www/html
server_aliases VirtualHost ServerAliases Array of Strings [ node['hostname'] ]
server_name VirtualHost ServerName String node['fqdn']

These attributes are under the node['cacti']['apache2']['ssl'] namespace.

Attribute Description Type Default
certificate_file mod_ssl CertificateFile String /etc/pki/tls/certs/localhost.crt
chain_file mod_ssl CertificateChainFile String ""
enabled Support HTTPS Boolean true
force Force HTTPS Boolean false
key_file mod_ssl CertificateKeyFile String /etc/pki/tls/private/localhost.key

Database Attributes

All of these node['cacti']['database'] attributes are overridden by cacti/server encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists

Attribute Description Type Default
host FQDN or "localhost" (localhost automatically installs ['database']['type'] server) String localhost
name Cacti database name String cacti
password Cacti database user password String changeit
port Cacti database port Fixnum 3306
type Cacti database type - "mysql" only String mysql
user Cacti database user String cacti

rrdtool Attributes

These attributes are under the node['cacti']['rrdtool'] namespace.

Attribute Description Type Default
version major.minor version of rrdtool installed - "1.3" or "1.4" String auto-detected (see attributes/default.rb)

Spine Attributes

These attributes are under the node['cacti']['spine'] namespace.

Attribute Description Type Default
checksum Checksum for Spine String auto-detected (see attributes/default.rb)
packages Packages for Spine installation Array auto-detected (see attributes/default.rb)
url URL for Spine installation String http://www.cacti.net/downloads/spine/cacti-spine-#{node['cacti']['spine']['version']}.tar.gz
version Version of Spine to install String node['cacti']['version']

Recipes

  • recipe[cacti] Installs/configures Cacti
  • recipe[cacti::apache2] Installs/configures Apache 2 and PHP for Cacti
  • recipe[cacti::configuration] Configures Cacti configuration files
  • recipe[cacti::cron] Installs Cacti polling cron entry
  • recipe[cacti::database] Installs/configures Cacti MySQL server
  • recipe[cacti::package] Installs Cacti via packages
  • recipe[cacti::spine] Install Spine for Cacti

LWRPs

  • cacti_device: Creating Devices
  • cacti_graph: Creating Draphs
  • cacti_tree: Adding entries to Tree
  • cacti_data_query: Adding data_queries to a Device

Currently only Creating and Adding is supported.

See full documentation for each LWRP and action below for more information.

cacti_device

Only action supported is :create, which is the default.

Attribute Description Type Default
description The name that will be displayed by Cacti in the graphs String nil
ip Self explanatory (can also be a FQDN) String nil
template Specify Host Template: default Graph Templates and Data Queries will associated with the Host String nil
notes Optional general information about this host String nil
disable Add this host but to disable checks Boolean false
avail Method used by Cacti to determine if a host is available for polling (none, ping, snmp, pingsnmp) String pingsnmp
ping_method Ping method if avail uses ping (icmp, tcp, udp). NOTE: ICMP on Linux/UNIX requires root privileges. String tcp
ping_port TCP or UDP port to attempt connection (1-65534) Integer nil
ping_retries After an initial failure, the number of ping retries Cacti will attempt before failing Integer 2
community SNMP community string for SNMP v1 and SNMP v2 String nil
version SNMP version when avail check uses SNMP (1, 2, 3) Integer 1
port UDP port number to use for SNMP Integer 161
timeout The maximum number of milliseconds Cacti will wait for an SNMP response Integer 500
max_oids Number of OIDs that can be obtained in a single SNMP Get request (1-60) String 10
username SNMP username for SNMP v3 String nil
password SNMP password for SNMP v3 String nil
authproto SNMP authentication protocol for SNMP v3 String nil
privpass SNMP privacy passphrase for SNMP v3 String nil
privproto SNMP privacy protocol for SNMP v3 String nil
context SNMP context for SNMP v3 String nil

cacti_graph

Only action supported is :create, which is the default.

Attribute Description Type Default
graph_template_id Graph Template to apply to this graph String nil
host_id The Host that this graph belongs to String nil
graph_type cg graphs are for things like CPU temp/fan speed, while ds graphs are for data-source based graphs (interface stats etc.) String cg
graph_title Graph Title. If unspecified, defaults to what ever is in the graph template/data-source template String nil
input_fields Input Fields for cg type graphs Hash nil
snmp_query_id ds graph: name of data query String nil
snmp_query_type_id ds graph: SNMP Query Type ID String nil
snmp_field ds graph: SNMP Field String nil
snmp_value ds graph: SNMP Value String nil
reindex_method ds graph: The reindex method to be used for that data query. None = no reindexing, Uptime = Uptime goes Backwards, Index = Index Count Changed, Fields = Verify all Fields String None

cacti_tree

Only action supported is :create, which is the default.

Attribute Description Type Default
name A useful name for the graph tree. String nil
type Type: One of tree or node String nil
sort_method Tree sort order (manual, alpha, natural, numeric) String nil
node_type Node type (header, host, graph) String nil
tree_id Node option String nil
parent_node Choose the parent for the header/graph. String nil
host_id Host node: Choose a host to add it to the tree String nil
host_group_style Host node: How graphs are grouped when drawn for this particular host on the tree (Graph Template, Data Query Index) String nil
graph_id Graph node: Choose a graph to add it to the tree String nil
rra_id Graph node: Choose a round robin archive to control how Graph Thumbnails are displayed when using Tree Export String nil

cacti_data_query

Only action supported is :create, which is the default.

Attribute Description Type Default
host_id The Host to what to add Data Query String nil
data_query_id Data Query to be added String nil
reindex_method The reindex method to be used for that data query. None = no reindexing, Uptime = Uptime goes Backwards, Index = Index Count Changed, Fields = Verify all Fields String None

Usage

Cacti Server Data Bag

For securely overriding attributes on Hosted Chef, create a cacti/server encrypted data bag with the model below. Chef Solo can override the same attributes with a cacti/server unencrypted data bag of the same information.

required: * ['admin']['password'] - local administrator password * ['database']['host'] - FQDN or "localhost" (localhost automatically installs/configures database) * ['database']['name'] - Name of Cacti database * ['database']['user'] - Cacti database username * ['database']['password'] - Cacti database username password

optional: * ['database']['port'] - Database port, defaults to 3306

Repeat for other Chef environments as necessary. Example:

{
  "id": "server",
  "development": {
    "admin": {
      "password": "cacti_admin_password"
    },
    "database": {
      "host": "localhost",
      "name": "cacti",
      "user": "cacti",
      "password": "cacti_db_password"
    }
  }
}

Cacti Default Installation

  • Create recommended (encrypted) data bag: knife data bag create cacti server --secret-file=path/to/secret
  • Add recipe[cacti] to your node's run list.
  • Browse to http://node['cacti']['apache2']['server_name']/cacti

Cacti Spine Installation

  • Add recipe[cacti::spine] to your node's run list.
    • If non-localhost database:
    • Login as administrator
    • Settings > Paths > Spine Poller File Path: /usr/bin/spine
    • Settings > Poller > Poller Type: spine

Testing and Development

Here's how you can quickly get testing or developing against the cookbook thanks to Vagrant and Berkshelf.

vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-cachier
vagrant plugin install vagrant-omnibus
git clone git://github.com/bflad/chef-cacti.git
cd chef-cacti
vagrant up BOX # BOX being centos5, centos6, debian7, fedora18, fedora19, fedora20, freebsd9, ubuntu1204, ubuntu1210, ubuntu1304, or ubuntu1310

You can then SSH into the running VM using the vagrant ssh BOX command.

The VM can easily be stopped and deleted with the vagrant destroy command. Please see the official Vagrant documentation for a more in depth explanation of available commands.

Contributing

Please use standard Github issues/pull requests.

Contributors

Dependent cookbooks

mysql ~> 5.0
database = 2.3.1
apache2 ~> 1.0
yum-epel >= 0.0.0
cron >= 0.0.0
build-essential >= 0.0.0
apt >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

0.6.0

  • Pin older cookbook dependency versions preparing for 1.0.0 upgrade (your environment may not want/need this intermediate release for this change)
    • apache2 ~> 1.0
    • database 2.3.1
    • mysql ~> 5.0
  • Add cli_executable recipe to ensure scripts are executable beforehand (fixes file resource call in cli library)
  • Use apache_conf resource
  • Fix cacti_test::graph_lwrp for all platforms
  • Switch to bento boxes in Atlas for Test Kitchen and Vagrant

0.5.1

  • Fix ordering of poller_file and poller_cmd

0.5.0

  • Add cacti_device, cacti_graph, cacti_tree, cacti_data_query LRWPs by Elan Ruusamäe (@glensc) (#5)

0.4.0

  • Enhancement: [GH-8]: Experimental PLD Linux Th support

0.3.0

  • DEPRECATED: server recipe; use default recipe or individual recipes as needed
  • Enhancement: Chef solo support for unencrypted data bags
  • Enhancement: Fallback to new node['cacti']['admin'] and node['cacti']['database'] attributes if no data bag (now easily Vagrant testable)
  • Enhancement: Fedora 19 and 20 support
  • Enhancement: Ubuntu 12.10, 13.04, and 13.10 support
  • Enhancement: Migrate apache2 configuration in server recipe to apache2 recipe
  • Enhancement: Migrate cron configuration in server recipe to cron recipe
  • Enhancement: Migrate configuration in server recipe to configuration recipe
  • Enhancement: Migrate database configuration in server recipe to database recipe
  • Enhancement: Migrate package installation in server recipe to package recipe
  • Enhancement: Move hardcoded packages in recipes into node['cacti']['packages'] and node['cacti']['spine']['packages'] attributes (/ht @stormerider)
  • Enhancement: Move dbconfig and poller in server recipe into node['cacti']['db_file'] and node['cacti']['poller_file'] attributes
  • Enhancement: Add node['cacti']['rrdtool']['version'] to help with default platform package versioning in database
  • Enhancement: Auto-detect default cacti package version per Ubuntu release
  • Enhancement: Default recipe installs EPEL for RHEL family OSes

0.2.0

v0.1.1

  • Fixed spine copying to perserve mode and ownership
  • Added php-ldap to server recipe packages list

v0.1.0

  • Initial release.

Collaborator Number Metric
            

0.6.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.6.0 passed this metric

Foodcritic Metric
            

0.6.0 failed this metric

FC059: LWRP provider does not declare use_inline_resources: cacti/providers/data_query.rb:1
FC059: LWRP provider does not declare use_inline_resources: cacti/providers/device.rb:1
FC059: LWRP provider does not declare use_inline_resources: cacti/providers/graph.rb:1
FC059: LWRP provider does not declare use_inline_resources: cacti/providers/tree.rb:1
FC064: Ensure issues_url is set in metadata: cacti/metadata.rb:1
FC065: Ensure source_url is set in metadata: cacti/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cacti/metadata.rb:1
FC069: Ensure standardized license defined in metadata: cacti/metadata.rb:1
Run with Foodcritic Version 11.1.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.6.0 passed this metric

No Binaries Metric
            

0.6.0 passed this metric

Publish Metric
            

0.6.0 passed this metric

Supported Platforms Metric
            

0.6.0 passed this metric

Testing File Metric
            

0.6.0 passed this metric

Version Tag Metric
            

0.6.0 passed this metric