hmm...i did not set any defaults from the very begining...
anyway heres the full policy...
```#
# produces classes if filesystems are somewhat full
# shows up as notkept in kibana
#
#
# control bundle
#
bundle agent b0002_rootvg_diskspace
{
meta:
"tags" slist => { "itsv" };
methods:
!am_policy_hub::
"call_to_rootvg_diskspace"
usebundle => rootvg_diskspace,
comment => "monitor rootvg filesystems",
handle => "itsv_reporting_rootvg_filesystems_monitoring",
classes => itsv_reporting_classkeeper( "$(this.promiser)", "$(this.handle)", itsv_ROOTVG_FILESYSTEMS_MONITORING ),
action => itsv_reporting( "$(this.handle)", "$(this.promiser)", "Promisee: $(this.promise_filename) at line $(this.promise_linenumber)", "1440" ),
ifvarclass => "SPARE_DAILY";
}
bundle agent rootvg_diskspace
{
vars:
"datacontainer[root][filesystem]" string => "/";
"datacontainer[root][minfree]" string => "500M";
"datacontainer[root][handle]" string => "itsv_reporting_root_fs_check";
"datacontainer[root][comment]" string => "root filesystem check";
"datacontainer[root][class]" string => "itsv_system_root_full";
"datacontainer[root][expire]" string => "1";
"datacontainer[var][filesystem]" string => "/var";
"datacontainer[var][minfree]" string => "600M";
"datacontainer[var][handle]" string => "itsv_reporting_var_fs_check";
"datacontainer[var][comment]" string => "var filesystem check";
"datacontainer[var][class]" string => "itsv_var_full";
"datacontainer[var][expire]" string => "1";
"datacontainer[usr][filesystem]" string => "/usr";
"datacontainer[usr][minfree]" string => "500M";
"datacontainer[usr][handle]" string => "itsv_reporting_usr_fs_check";
"datacontainer[usr][comment]" string => "usr filesystem check";
"datacontainer[usr][class]" string => "itsv_usr_full";
"datacontainer[usr][expire]" string => "1";
"datacontainer[opt][filesystem]" string => "/opt";
"datacontainer[opt][minfree]" string => "1G";
"datacontainer[opt][handle]" string => "itsv_reporting_opt_fs_check";
"datacontainer[opt][comment]" string => "opt filesystem check";
"datacontainer[opt][class]" string => "itsv_opt_full";
"datacontainer[opt][expire]" string => "1";
"datacontainer[tmp][filesystem]" string => "/tmp";
"datacontainer[tmp][minfree]" string => "600M";
"datacontainer[tmp][handle]" string => "itsv_reporting_tmp_fs_check";
"datacontainer[tmp][comment]" string => "tmp filesystem check";
"datacontainer[tmp][class]" string => "itsv_tmp_full";
"datacontainer[tmp][expire]" string => "1";
methods:
"call_checkdisk" usebundle => checkdisk("rootvg_diskspace.datacontainer"),
if => not("wpsap");
}
bundle agent checkdisk(d)
{
vars:
"vol" slist => getindices("$(d)");
storage:
"$($(d)[$(vol)][filesystem])"
handle => "$($(d)[$(vol)][handle])",
comment => "$($(d)[$(vol)][comment])",
action => itsv_reporting( "$($(d)[$(vol)][handle])", "$($(d)[$(vol)][comment])", "Promisee: $(this.promise_filename) at line $(this.promise_linenumber)", "$($(d)[$(vol)][expire])" ),
classes => itsv_reporting_classkeeper( "$($(d)[$(vol)][comment])", "$($(d)[$(vol)][handle])", "$($(d)[$(vol)][class])" ),
volume => min_free_space("$($(d)[$(vol)][minfree])");
methods:
"call_fs_expander" usebundle => fs_expander("$($(d)[$(vol)][filesystem])"),
if => canonify("$($(d)[$(vol)][comment])_handle_$($(d)[$(vol)][handle])_notkept");
}
bundle agent fs_expander(mountpoint)
{
vars:
"chfs_command" string => "/usr/sbin/chfs -a size=+200M";
"fs" string => canonify("$(mountpoint)");
"vg_free" string => execresult("/usr/sbin/lsvg rootvg | awk -F: '/FREE PP/ {match($3, /\([[:digit:]]*/); print substr($3, RSTART+1, RLENGTH-1)}'", "useshell");
classes:
"VG_SPACE_LOW" expression => eval("$(vg_free) < 10240", "class", "infix");
commands:
"$(chfs_command)"
args => "$(mountpoint)",
if => not("VG_SPACE_LOW"),
classes => if_repaired("$(fs)_expanded");
reports:
"Time: $(sys.date) - Bundle: $(this.bundle) - Message: expanded filesystem: $(mountpoint)."
if => "$(fs)_expanded";
}```