strange output from storage promise

32 views
Skip to first unread message

Xander Cage

unread,
Sep 14, 2023, 4:13:46 AM9/14/23
to help-cfengine
Hi,

on one of our aix machines we get this outpput from  storage monitoring.

error: File system '/opt' is suspiciously small! (9759 bytes)

which is definitly not correct...

root@wpsap: /root # lsfs -q /opt
Name Nodename Mount Pt VFS Size Options Auto Accounting
/dev/hd10opt -- /opt jfs2 11534336 -- yes no
(lv size: 11534336, fs size: 11534336, block size: 512, sparse files: yes, inline log: no, inline log size: 0, EAformat: v1, Quota: no, DMAPI: no, VIX: yes, EFS: no, ISNAPSHOT: no, MAXEXT: 0, MountGuard: no, LFF: no)


skimmed through spaghetti code but i guess was unable to fully grasp whats going on here...


where is volume.sensible_size coming from? i expected some form of statfs call somewhere but only found one in another unrelated universe.


i have an case open with the ibm guys, so please can sombady shaed some light on this`?

wbr

chris


Bas van der Vlies

unread,
Sep 14, 2023, 4:33:21 AM9/14/23
to help-c...@googlegroups.com
What is your code? I usually set the defaults very low. I suspect there
are not many file under `/opt`

eg:
```
body volume scl_min_free_space(free)


{


check_foreign => "true";


freespace => "$(free)";


sensible_size => "0";


sensible_count => "0";


}

will suppress this warning
> --
> You received this message because you are subscribed to the Google
> Groups "help-cfengine" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to help-cfengin...@googlegroups.com
> <mailto:help-cfengin...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/help-cfengine/a4216275-e3c7-4960-b987-cba2786bf3dfn%40googlegroups.com <https://groups.google.com/d/msgid/help-cfengine/a4216275-e3c7-4960-b987-cba2786bf3dfn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
--
Bas van der Vlies
| High Performance Computing & Visualization | SURF| Science Park 140 |
1098 XG Amsterdam
| T +31 (0) 20 800 1300 | bas.van...@surf.nl | www.surf.nl |

Lars Erik Wik

unread,
Sep 14, 2023, 4:53:58 AM9/14/23
to help-cfengine
> where is volume.sensible_size coming from?

I might be wrong, but It looks to me like you are listing the size of the filesystem. However the `storage` promise type is complaining about the number of bytes used. Can you try to type command `df /opt/` ?

Xander Cage

unread,
Sep 14, 2023, 5:56:13 AM9/14/23
to help-cfengine
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"; }```

Xander Cage

unread,
Sep 14, 2023, 5:57:06 AM9/14/23
to help-cfengine
holy cat..markdown of code did not work...sorry about the clutter

Lars Erik Wik

unread,
Sep 14, 2023, 7:18:54 AM9/14/23
to help-cfengine
If the documentation is correct, then the error message is a bit misleading. Created a ticket to make it more clear (see https://northerntech.atlassian.net/browse/CFE-4251). Could use share the results of executing `df /opt/` ?

As you can see in the output from my AIX machine, `lsfs -q /opt/` outputs disk size, while `df /opt/` also shows number of bytes used.
```

$ df /opt/

Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on

/dev/hd10opt     8388608   3148528   63%    30298     8% /opt

$ lsfs -q /opt/

Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting

/dev/hd10opt    --         /opt                   jfs2  8388608 --         yes  no

```

I believe the error message is shown when the number of bytes used is lower that what the `sensible_size` attribute in `body volume` is set to. (See https://github.com/cfengine/masterfiles/blob/998f71dcbf2f982d2d0783e58bd22288efddf377/lib/storage.cf#L14)

Xander Cage

unread,
Sep 14, 2023, 7:33:50 AM9/14/23
to help-cfengine
All,

after adding the default body mentioned by Bas van der Vlies, everything works as expected...

root@wpsap: /root # /var/cfengine/bin/cf-agent -KI -b rootvg_diskspace
    info: Using command line specified bundlesequence
    info: Filesystem '/var' content seems to be sensible as promised
    info: Filesystem '/opt' content seems to be sensible as promised
    info: Filesystem '/' content seems to be sensible as promised
    info: Filesystem '/usr' content seems to be sensible as promised
    info: Filesystem '/tmp' content seems to be sensible as promised

here the requested df output:

root@wpsap: /root # df /opt/

Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd10opt    11534336   7785720   33%    45681     5% /opt

thank you all for helping me out...

cheers

chris
Reply all
Reply to author
Forward
0 new messages