First, let me just say that I attended the CFEngine coffee hour last Thursday, and thank you. The conversation was interesting, engaging, and the feedback I received was very helpful.
Now, I'm attempting to use CFEngine to maintain a configuration file for a monitoring software called Nimsoft, and I'm running into some hurdles that perhaps someone can shed some light on.
I need to feed a list of file system devices and mount points into a configuration file. To do this, I'm using a template. I posted a gist of the policy here:
And the template here:
I'm using an associative array to contain the file system devices and mount points. I know that much is working because the report output when the policy runs is as follows:
2014-11-17T15:41:21-0500 notice: R: rpool/ROOT/2014Q4A /
2014-11-17T15:41:21-0500 notice: R: rpool/ROOT/2014Q4A/var /var
2014-11-17T15:41:21-0500 notice: R: rpool/export /export
2014-11-17T15:41:21-0500 notice: R: rpool/git_repo /export/git_repo
2014-11-17T15:41:21-0500 notice: R: rpool/export/home /export/home
2014-11-17T15:41:21-0500 notice: R: rpool /rpool
$
But when I check the file that the policy creates, I get the name of the array instead of the data that it should contain.
### BEGIN sample ########################################
<disk>
interval = 15 min
samples = 4
use_systemspace = no
ignore_filesystem =
ignore_device =
<fixed>
</>
active = yes
description = File system /
disk = $(nimsoft_cdm.fs_tbl[$(mnt_lst)])
percent = yes
qos_disk_usage = no
qos_disk_usage_perc = no
inode_percent = yes
qos_inode_usage = no
qos_inode_usage_perc = no
delta_percent = no
delta_calculate_all = yes
delta_type = both
qos_disk_delta = no
<error>
active = yes # / disk error active
threshold = 5 # / error threshold
message = DiskError
</error>
<warning>
active = yes # / disk warning active
threshold = 10 # / warning threshold
message = DiskWarning
</warning>
<inode_error>
active = no # / inode_error active
threshold = 10 # / inode_error threshold
message = InodeError
</inode_error>
<inode_warning>
active = no # / inode_warning active
threshold = 20 # / inode_warning threshold
message = InodeWarning
</inode_warning>
<missing>
active = yes # / disk missing active
message = DiskMissing
</missing>
<delta_error>
active = no # / delta_error active
threshold = 10 # / delta_error threshold
message = DeltaError
</delta_error>
<delta_warning>
active = no # / delta_warning active
threshold = 8 # / delta_warning threshold
message = DeltaWarning
</delta_warning>
<//>
### END sample ##########################################
Are templates in 3.5.3 able to support associative arrays? If not, is there another way to accomplish what I am trying to do? Or will I need to get my upgrade to 3.6 out of the way first, and check out some of the expanded data features it offers?
Thanks again for any insights you can share.
Regards,
Jeremy