File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 $service_name = ' collectd'
1111 $config_file = " ${collectd_dir} /collectd.conf"
1212 $root_group = ' root'
13+ $java_dir = ' /usr/share/collectd/java'
1314 }
1415 ' Solaris' : {
1516 $package = ' CSWcollectd'
1920 $service_name = ' collectd'
2021 $config_file = " ${collectd_dir} /collectd.conf"
2122 $root_group = ' root'
23+ # FIXME: $java_dir
2224 }
2325 ' Redhat' : {
2426 $package = ' collectd'
2830 $service_name = ' collectd'
2931 $config_file = ' /etc/collectd.conf'
3032 $root_group = ' root'
33+ $java_dir = ' /usr/share/collectd/java'
3134 }
3235 ' Suse' : {
3336 $package = ' collectd'
3740 $service_name = ' collectd'
3841 $config_file = ' /etc/collectd.conf'
3942 $root_group = ' root'
43+ # FIXME: $java_dir
4044 }
4145 ' FreeBSD' : {
4246 $package = ' collectd5'
4650 $service_name = ' collectd'
4751 $config_file = ' /usr/local/etc/collectd.conf'
4852 $root_group = ' wheel'
53+ # FIXME: $java_dir
4954 }
5055 ' Archlinux' : {
5156 $package = ' collectd'
5560 $service_name = ' collectd'
5661 $config_file = ' /etc/collectd.conf'
5762 $root_group = ' wheel'
63+ # FIXME: $java_dir
5864 }
5965 ' Gentoo' : {
6066 $package = ' app-admin/collectd'
6470 $service_name = ' collectd'
6571 $config_file = ' /etc/collectd.conf'
6672 $root_group = ' collectd'
73+ # FIXME: $java_dir
6774 }
6875
6976 default: {
Original file line number Diff line number Diff line change 66 include collectd
77 include collectd::params
88 include collectd::plugin::java
9-
9+ $class_path = " ${collectd::params::java_dir} /collectd-api.jar: ${collectd::params::java_dir} /generic-jmx.jar "
1010 $config_file = " ${collectd::params::plugin_conf_dir} /15-genericjmx.conf"
1111
1212 concat { $config_file:
Original file line number Diff line number Diff line change 22
33describe 'collectd::plugin::genericjmx' , :type => :class do
44 let ( :facts ) { {
5- :osfamily => 'RedHat ' ,
5+ :osfamily => 'Debian ' ,
66 :concat_basedir => tmpfilename ( 'collectd-genericjmx' ) ,
77 } }
88
9- let ( :config_filename ) { '/etc/collectd.d/15-genericjmx.conf' }
9+ let ( :config_filename ) { '/etc/collectd/conf .d/15-genericjmx.conf' }
1010
1111 context ':ensure => present, defaults' do
1212 it 'will include the java plugin' do
6464 it 'should have one jvmarg parameter' do
6565 should contain_concat__fragment ( 'collectd_plugin_genericjmx_conf_header' ) . with_content ( /JVMArg "bat"/ )
6666 end
67- it 'should have ONLY one jvmarg parameter' do
68- should contain_concat__fragment ( 'collectd_plugin_genericjmx_conf_header' ) . without_content ( /(.*JVMArg.*){2 ,}/m )
67+ it 'should have ONLY one jvmarg parameter other than classpath ' do
68+ should contain_concat__fragment ( 'collectd_plugin_genericjmx_conf_header' ) . without_content ( /(.*JVMArg.*){3 ,}/m )
6969 end
7070 end
7171
7272 context 'jvmarg parameter empty' do
7373 let ( :params ) { { :jvmarg => [ ] } }
74- it 'should not have any jvmarg parameters' do
75- should contain_concat__fragment ( 'collectd_plugin_genericjmx_conf_header' ) . without_content ( /JVMArg/ )
74+ it 'should wnot have any jvmarg parameters other than classpath ' do
75+ should contain_concat__fragment ( 'collectd_plugin_genericjmx_conf_header' ) . without_content ( /(.* JVMArg.*){2,}/m )
7676 end
7777 end
7878end
Original file line number Diff line number Diff line change 11< Plugin "java">
2+ JVMArg "-Djava.class.path=<%= @class_path %> "
23<% Array ( @jvmarg ) . each do |jvmarg | -%>
34 JVMArg "<%= jvmarg %> "
45<% end -%>
You can’t perform that action at this time.
0 commit comments