KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

UNC free space calculation

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
evilmonkey



Joined: 03 Jul 2007
Posts: 6

PostPosted: Fri Nov 23, 2007 9:24 pm    Post subject: UNC free space calculation Reply with quote

Can you publish what formula you use to calculate percentage free for UNC?


Using linux RMA we get a discrepency on Debian based system. e.g.:

OS says:
9.1G 7.2G 1.5G 84% /var

Where 84% is amount used

HM says:
Reply: 21%

Where alert is set to alert on percent < 20%

I've also seen different behaviour than the above from RedHat where the mount didn't work (e.g. /var) but adding the dev device did.

I don't think this is a problem with RMA seems more like someone is using the HD idea of disk and the other the OS idea of disk.
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Mon Nov 26, 2007 4:29 am    Post subject: Reply with quote

Actually, RMA uses standard function statfs() to retrieve free space information. What exact free space parameter do you check: free space for current user or the total free space?

Regards,
Max


Last edited by KS-Soft Europe on Mon Nov 26, 2007 7:54 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Mon Nov 26, 2007 7:18 am    Post subject: Reply with quote

Code is pretty simple
Code:

  struct statfs statbuf;
  if (statfs(path, &statbuf)==0)
  {
     total = (int64)(statbuf.f_blocks) * statbuf.f_bsize;
     free  = (int64)(statbuf.f_bfree)  * statbuf.f_bsize;
     freeforuser = (int64)(statbuf.f_bavail) * statbuf.f_bsize;
     return True;
  }
  else return False;


Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index