Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Wed Dec 11, 2019 8:40 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
PostPosted: Wed Apr 15, 2009 1:36 am 
Offline
Newbie

Joined: Wed Mar 04, 2009 1:03 am
Posts: 5
To me a listing of partitions with x MB free space is less meaning than a percentage of the partition free. A partition with less than 10% free will suffer somewhat if it is a system partition. I made a few changes to the code to allow this to happen, let me know if this is a good idea. Another thought I had but haven't implemented is to switch between MB and % in the config, or even include both.

index.php
Code:
DisplaySection('f4',__("Partition free space less than ").$partition_free_space.__(" MB"),'PartitionUsage','Partitions');

change to
Code:
DisplaySection('f4',__("Partition free space less than ").$partition_free_space.__(" %"),'PartitionUsage','Partitions');


admin_config.php
Code:
echo "<div class=\"npb_config_col\">".__("MB").":<input type='text' name='partition_free_space_post' size='4' value='$partition_free_space'></div><br >";

change to
Code:
echo "<div class=\"npb_config_col\">".__("%").":<input type='text' name='partition_free_space_post' size='3' value='$partition_free_space'></div><br >";


index_data.php
Code:
function GetPartitionUsageData($id)
{
  global $db, $partition_free_space;
   $tr_class='npb_highlight_row';
   
  $sql  = "SELECT sys.system_name, sys.net_ip_address, par.partition_uuid, par.partition_volume_name, par.partition_caption, par.partition_free_space, par.partition_size, par.partition_timestamp ";
  $sql .= "FROM system sys, partition par ";
  $sql .= "WHERE par.partition_free_space < '$partition_free_space' AND sys.system_uuid = par.partition_uuid AND par.partition_timestamp = sys.system_timestamp ";
  $sql .= "ORDER BY sys.system_name, par.partition_caption";

change to
Code:
function GetPartitionUsageData($id)
{
  global $db, $partition_free_space;
   $tr_class='npb_highlight_row';
   $partition_percent = $partition_free_space *.01;
   
  $sql  = "SELECT sys.system_name, sys.net_ip_address, par.partition_uuid, par.partition_volume_name, par.partition_caption, par.partition_free_space, par.partition_size, par.partition_timestamp ";
  $sql .= "FROM system sys, partition par ";
  $sql .= "WHERE (par.partition_free_space / par.partition_size) < '$partition_percent' AND sys.system_uuid = par.partition_uuid AND par.partition_timestamp = sys.system_timestamp ";
  $sql .= "ORDER BY sys.system_name, par.partition_caption";


I don't know how much performance impact it will have to do the math 'on the fly' in the SQL but with my 350 systems it didn't do much of any difference.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group