Syntax error at ‘{‘; expected ‘}’ when using nagios in puppet

nagiospuppetsyntax

It's a big problem to me, because I'm not familiar with puppet.

ERROR on the puppetmaster:

debug: importing '/etc/puppet/manifests/nodes/group-1.pp'
err: Could not parse for environment production: Syntax error at '{'; expected '}' at /etc/puppet/manifests/nodes/group-1.pp:6

ERROR on the puppet client:

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not parse for environment production: Syntax error at
'{'; expected '}' at /etc/puppet/manifests/nodes/group-1.pp:6

in group-1.pp:

node 'group1'
{
        include ntp 

        class { 'nagios::host':           #this is line 6
                nodename => $clientcert,
                appname => 'test',
        }   
}

nagios::host in module module/nagios/host.pp
code are here:

class nagios::host($nodename, $hostgroup) {


  file { '/usr/lib/nagios/plugins':
    mode    => "755",
    require => Package["nagios-plugins"],
  }

  ...

    @@nagios_service { "${nodename}_check_ssh":
      ensure => present,
      use => 'generic-service',
      host_name => "${nodename}",
      notification_interval => 60,
      flap_detection_enabled => 0,
      service_description => "SSH",
      check_command => "check_ssh",
      target => "/etc/nagios3/services.d/${nodename}.cfg",
    } 
}

and the file module/nagios/init.pp is blank

How could I fix it ?

Best Answer

Puppet 0.25 does not support parametrized classes, you must upgrade to puppet > 2.6.

Related Topic