Re: strange output from storage promise

Xander Cage <[email protected]> Thu, 14 Sep 2023 04:33:50 -0700 (PDT)
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
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

On Thursday, September 14, 2023 at 1:18:54 PM UTC+2 [email protected] 
wrote:

> 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
> )
> On Thursday, September 14, 2023 at 11:57:06 AM UTC+2 Xander Cage wrote:
>
>> holy cat..markdown of code did not work...sorry about the clutter
>>
>> On Thursday, September 14, 2023 at 11:56:13 AM UTC+2 Xander Cage wrote:
>>
>>> 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"; }``` 
>>>
>>>
>>> ​
>>>
>>>
>>> On Thursday, September 14, 2023 at 10:53:58 AM UTC+2 
>>> [email protected] wrote:
>>>
>>> > where is volume.sensible_size coming from?
>>> `sensible_size` is an attribute in `body volume` (see 
>>> https://docs.cfengine.com/docs/3.21/reference-promise-types-storage.html#sensible_size
>>> )
>>>
>>> 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/` ?
>>> On Thursday, September 14, 2023 at 10:13:46 AM UTC+2 Xander Cage wrote:
>>>
>>> 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) 
>>>
>>> mesage comes from here -> 
>>> https://github.com/cfengine/core/blob/master/cf-agent/verify_storage.c#L251
>>>
>>> skimmed through spaghetti code but i guess was unable to fully grasp 
>>> whats going on here...
>>>
>>>
>>> https://github.com/cfengine/core/blob/master/cf-agent/verify_storage.c#L249
>>>
>>> where is volume.sensible_size coming from? i expected some form of 
>>> statfs call somewhere but only found one in another unrelated universe.
>>>
>>>
>>> https://github.com/cfengine/core/blob/master/libpromises/storage_tools.c#L84
>>>
>>> i have an case open with the ibm guys, so please can sombady shaed some 
>>> light on this`?
>>>
>>> wbr
>>>
>>> chris
>>>
>>>
>>>

-- 
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 [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/582ca6db-0a6c-41e8-bbbd-bb681382fca7n%40googlegroups.com.