Skip to content

Commit

Permalink
Merge branch 'master' of github.com:puppetlabs/puppet-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kari Halsted committed May 25, 2016
2 parents 9c39d6a + b9432e6 commit cef3fb8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 62 deletions.
58 changes: 0 additions & 58 deletions source/guides/exported_resources.markdown

This file was deleted.

5 changes: 5 additions & 0 deletions source/nginx_rewrite.conf
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,8 @@ rewrite /guides/scope_and_puppet.html /puppet/2.7/reference/scope_and_puppet.h

# removing Puppet internals guide
rewrite /guides/puppet_internals.html /puppet/latest/reference/subsystem_catalog_compilation.html permanent;

# removing old and out of date PE deployment guides
rewrite /guides/deployment_guide/index.html /pe/latest/install_basic.html
rewrite /guides/deployment_guide/dg_first_steps.html /pe/latest/install_basic.html
rewrite /guides/deployment_guide/dg_define_infrastructure.html /pe/latest/quick_start_essential_config.html
43 changes: 39 additions & 4 deletions source/puppet/4.5/reference/lang_exported.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ canonical: "/puppet/latest/reference/lang_exported.html"
[puppetdb]: {{puppetdb}}/
[puppetdb_connect]: {{puppetdb}}/connect_puppet_master.html
[puppetdb_install]: {{puppetdb}}/install_via_module.html
[exported_guide]: /guides/exported_resources.html
[catalog]: ./lang_summary.html#compilation-and-catalogs

> **Note:** Exported resources require catalog storage and searching (formerly known as "storeconfigs") to be enabled on your Puppet master. Both the catalog storage and the searching (among other features) are provided by [PuppetDB][]. To enable exported resources, follow these instructions:
Expand All @@ -38,8 +37,6 @@ Exported resources allow the Puppet compiler to share information among nodes by
The most common use cases are monitoring and backups. A class that manages a service like PostgreSQL can export a [`nagios_service`][nagios_service] resource describing how to monitor the service, including information like its hostname and port. The Nagios server can then collect every `nagios_service` resource, and will automatically start monitoring the Postgres server.

For more details, see [Exported Resource Design Patterns][exported_guide].


## Syntax

Expand Down Expand Up @@ -92,7 +89,7 @@ Since any node could be exporting a resource, it is difficult to predict what th

See [Exported Resource Collectors][exported_collector] for more detail on the collector syntax and search expressions.


## Behavior


Expand All @@ -119,3 +116,41 @@ To ensure uniqueness, every resource you export should include a substring uniqu

Exported resource collectors do not collect normal or virtual resources. In particular, they cannot retrieve non-exported resources from other nodes' catalogs.

### Exported resources with Nagios

The following example shows Puppet native types for managing Nagios configuration
files. These types become very powerful when you export and collect
them. For example, you could create a class for something like
Apache that adds a service definition on your Nagios host,
automatically monitoring the web server:

# /etc/puppetlabs/puppet/modules/nagios/manifests/target/apache.pp
class nagios::target::apache {
@@nagios_host { $fqdn:
ensure => present,
alias => $hostname,
address => $ipaddress,
use => "generic-host",
}
@@nagios_service { "check_ping_${hostname}":
check_command => "check_ping!100.0,20%!500.0,60%",
use => "generic-service",
host_name => "$fqdn",
notification_period => "24x7",
service_description => "${hostname}_check_ping"
}
}

# /etc/puppetlabs/puppet/modules/nagios/manifests/monitor.pp
class nagios::monitor {
package { [ nagios, nagios-plugins ]: ensure => installed, }
service { nagios:
ensure => running,
enable => true,
#subscribe => File[$nagios_cfgdir],
require => Package[nagios],
}
# collect resources and populate /etc/nagios/nagios_*.cfg
Nagios_host <<||>>
Nagios_service <<||>>
}

0 comments on commit cef3fb8

Please sign in to comment.