We will need to create some files in order to get puppet ready to automatically import Opsview hosts.
You will need to create this file in the following format on each client that you wish to connect with an Opsview server. The user account must have a role with appropriate CONFIGURATION permissions:
You should use https to ensure the connection is secured to the Opsview server, but this may not always be possible if you use a self-signed certificate.
modules/opsview/manifests/init.pp` will define the “opsview” class, which provides an exported resource to collect host information from puppet nodes. It also defines an “opsview::manage” class that will be used by the “manage” node to collect all of the host information and send it to Opsview.
modules/opsview/manifests/params.pp` will set the default values that are used by the exported resource defined in init.pp; feel free to modify these as needed.
## Setting up site.pp
Now that init.pp and params.pp have been set up for the Opsview puppet module, we can update our site.pp to make use of our new opsview classes.
In the above example, the ‘puppetmaster.yourdomain.com’ node will send its host information to puppetdb using the ‘opsview’ class. In addition to this, it will gather all of the host information from puppetdb and send it over to Opsview using the ‘opsview::manage’ class.
Our ‘ciscoswitch.yourdomain.com’ node is also calling the ‘opsview’ class but is overriding the default values for opsview_host_templates and opsview_keywords.