Hey! These docs are for version 6.3, which is no longer officially supported. Click here for the latest version, 6.7!


How to configure the Opsview Monitor playbooks in Puppet

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:

url: http://opsview.example.com/rest
username: foobar
password: foobaz

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.

class opsview (
         #Default settings
         $opsview_hostgroup = $opsview::params::opsview_hostgroup,
         $opsview_host_templates = $opsview::params::opsview_host_templates,
         $opsview_reload = $opsview::params::opsview_reload,
         $opsview_keywords = $opsview::params::opsview_keywords,
        ) inherits opsview::params {
        @@opsview_monitored {$fqdn:
          ip => $ipaddress,
          hostgroup => $opsview_hostgroup,
          hosttemplates => $opsview_host_templates,
          reload_opsview => $opsview_reload,
          keywords => $opsview_keywords,
          tag => ['opsview']
class opsview::manage {
        Opsview_monitored <<| tag == '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.

class opsview::params {
        $opsview_hostgroup="Monitoring Servers"
        $opsview_host_templates=['Network - Base']

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.

node default {
        include opsview
node 'puppetmaster.yourdomain.com' {
        include opsview
        include opsview::manage
node 'ciscoswitch.yourdomain.com' {
        class {'opsview':
          opsview_host_templates => ['Network - Base', 'Network - Cisco'],
          opsview_keywords => ['cisco', 'network']

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.