define nagios::iconf( $host_name='', $ip='', $short_alias='',$service_name='',$remote_host_name='',$port=''){
$reconfigure = "/usr/local/nagios/etc/import/${host_name}.cfg"
concat{$reconfigure:
owner => nagios,
group => nagios,
mode => 755
}
concat::fragment{"hosttemplate":
target => $reconfigure,
source => template('nagios/host.erb'),
order => 01,
}
concat::fragment{"servicetemplate":
target => $reconfigure,
ensure => template("nagios/${service_name}.erb"),
order => 15
}
}
include nagios
当我在 site.pp 中声明时
node "blahblahhostname"{
nagios::iconf{'name1':
host_name => 'localhost'
remote_host_name => 'blahblah1',
ip => '32.232.434.323',
port => '111',
short_alias => 'random',
service_name => 'servicename1'
}
nagios::iconf{'name2':
host_name => 'localhost'
remote_host_name => 'blahblah1',
ip => '32.232.434.323',
port => '111',
short_alias => 'random',
service_name => 'servicename2'
}
include nagios
}
我收到重复声明错误。我哪里做错了?