Open-AudIT

What's on your network?
It is currently Wed Jan 17, 2018 1:51 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
PostPosted: Fri Jul 30, 2010 1:52 am 
Offline
Helper

Joined: Thu Apr 15, 2010 12:28 am
Posts: 83
Hi

I was a little annoyed about the front page function Partition free space less than 1000 MB because it also shows linux software raid partitions :-( which have size 0.
Code:
IP Address    Hostname    Free Space MB    Size MB    Free Space %    Drive Letter    Volume Name
Not-Networked       0 MB    0 MB    0 %    /dev/hda1    
Not-Networked       0 MB    0 MB    0 %    /dev/hda2    
Not-Networked       0 MB    0 MB    0 %    /dev/hdb1    
Not-Networked       0 MB    0 MB    0 %    /dev/hdb2    
Not-Networked       0 MB    0 MB    0 %    /dev/hdc1    
Not-Networked       0 MB    0 MB    0 %    /dev/hdc2    
Not-Networked       0 MB    0 MB    0 %    /dev/md3    
Not-Networked       0 MB    0 MB    0 %    /dev/sda1    
Not-Networked       0 MB    0 MB    0 %    /dev/sdb1    
Not-Networked       0 MB    0 MB    0 %    /dev/sdc1    
Not-Networked       0 MB    0 MB    0 %    /dev/sdd1    
Not-Networked       0 MB    0 MB    0 %    /dev/sde1    
Not-Networked       0 MB    0 MB    0 %    /dev/sdf1    
Not-Networked       0 MB    0 MB    0 %    /dev/sdg1    
Not-Networked       0 MB    0 MB    0 %    /dev/sdh1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/hda1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/hda2    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/hdb1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/hdb2    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/hdc1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/hdc2    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/md2    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/md3    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sda1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdb1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdc1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdc1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdd1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdd1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sde1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sde1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdf1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdf1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdg1    
10.7.0.26    DK2    0 MB    0 MB    0 %    /dev/sdh1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/hda1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/hda2    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/hda3    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/hdb1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/hdb2    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/hdb3    
10.7.0.10    DKSRV003    0 MB    10088 MB    0 %    /dev/md0    /
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sda1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdb1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdc1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdd1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sde1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdf1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdg1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdh1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdi1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdj1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdk1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdl1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdm1    
10.7.0.10    DKSRV003    0 MB    0 MB    0 %    /dev/sdn1    
10.7.0.1    DKVPN1    219 MB    2114 MB    10.4 %    /dev/hda1    /


So i made this patch that fixes the problem by only showing partitions with a size larger than 0.
Code:
dkopen-audit:/var/www/open-audit# svn diff index_data.php
Index: index_data.php
===================================================================
--- index_data.php   (revision 1245)
+++ index_data.php   (working copy)
@@ -369,7 +369,7 @@
    
   $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 .= "WHERE par.partition_free_space < '$partition_free_space' AND par.partition_size > 0 AND sys.system_uuid = par.partition_uuid AND par.partition_timestamp = sys.system_timestamp ";
   $sql .= "ORDER BY sys.system_name, par.partition_caption";
   
    $result = mysql_query($sql, $db) or die (mysql_error());
@@ -1471,4 +1471,4 @@
    return;
 }
 
-?>
\ No newline at end of file
+?>



And now it only shows
Code:
10.7.0.10    DKSRV003    0 MB    10088 MB    0 %    /dev/md0    /
10.7.0.1    DKVPN1    219 MB    2114 MB    10.4 %    /dev/hda1    /


Much better :mrgreen:


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 06, 2010 3:55 am 
Offline
Contributor
User avatar

Joined: Thu Mar 02, 2006 4:41 am
Posts: 179
Location: Massachusetts
Thumbs up, I implemented your tweak to index_data.php and it works like a charm!

_________________
Server Info: running on a CentOS 7 vm
OA Version: 2.0.6 @ 500 devices


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 12, 2010 11:23 pm 
Offline
Helper

Joined: Thu Apr 15, 2010 12:28 am
Posts: 83
shanimal wrote:
Thumbs up, I implemented your tweak to index_data.php and it works like a charm!

I had to reimplement it, because open mac audit open mac audit showed (null) for some mac partitions.

Code:
dkopen-audit:/var/www/open-audit# svn diff index_data.php
Index: index_data.php
===================================================================
--- index_data.php    (revision 1247)
+++ index_data.php    (working copy)
@@ -367,9 +367,9 @@
   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  = "SELECT sys.system_name, sys.net_ip_address, par.partition_uuid, par.partition_volume_name, par.partition_caption, par.partition_free_space, par.partition_file_system, 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 .= "WHERE par.partition_free_space < '$partition_free_space' AND par.partition_file_system!='(null)' AND par.partition_volume_name!='(null)' AND par.partition_file_system!='linux_raid_member' AND par.partition_file_system!='LVM2_member' AND sys.system_uuid = par.partition_uuid AND par.partition_timestamp = sys.system_timestamp ";
   $sql .= "ORDER BY sys.system_name, par.partition_caption";
   
     $result = mysql_query($sql, $db) or die (mysql_error());
@@ -1471,4 +1471,4 @@
     return;
 }
 
-?>
\ No newline at end of file
+?>
dkopen-audit:/var/www/open-audit#


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.  [ 3 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 3 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:  
Powered by phpBB® Forum Software © phpBB Group