4 Cam, 4 hard drives how modify function getDiskPercent ?

Forum for questions and support relating to the 1.24.x releases only.
Locked
Flav
Posts: 38
Joined: Tue Jan 12, 2010 2:26 pm

4 Cam, 4 hard drives how modify function getDiskPercent ?

Post by Flav »

Hi.
Y need modify the function iin nclude/fonction.php

Code: Select all

function getDiskPercent()
{
    $df = shell_exec( 'df '.ZM_DIR_EVENTS );
    $space = -1;
    if ( preg_match( '/\s(\d+)%/ms', $df, $matches ) )
        $space = $matches[1];
    return( $space );
}
I have 4 Hard drives mounting like this

sdc1 --> /usr/share/zoneminder/events/1
sdd1 --> /usr/share/zoneminder/events/2
sde1 --> /usr/share/zoneminder/events/3
sdf1 --> /usr/share/zoneminder/events/4

I want creat filter with the diskspace function but this one give me the space in /usr/share/zoneminder/events the first HD sda1
And i'm not and good dev can someone help me ?

thanks
coke
Posts: 518
Joined: Wed Jan 30, 2008 5:53 pm
Location: St. Louis, MO, USA

Post by coke »

Is there a good reason to have them all on separate disks? Have you considered LVM? It's great for attaching sets of disks, and when you decide to add more later it's just a few simple commands.
Flav
Posts: 38
Joined: Tue Jan 12, 2010 2:26 pm

Post by Flav »

coke wrote:Is there a good reason to have them all on separate disks? Have you considered LVM? It's great for attaching sets of disks, and when you decide to add more later it's just a few simple commands.
I dont take the good explain.

It's for a private parking My system is a ubuntu with scsi Disksbay
All cam are hight def and they ars in Record Mode
We must save 3 month of records

The disksbay is attached like this (and i can't change it)

3 x 1Tb RAID 5 --> SDC1 --> Monitor1
3 x 1Tb RAID 5 --> SDD1 --> Monitor2
3 x 1Tb RAID 5 --> SDE1 --> Monitor3
3 x 1Tb RAID 5 --> SDF1 --> Monitor4
coke
Posts: 518
Joined: Wed Jan 30, 2008 5:53 pm
Location: St. Louis, MO, USA

Post by coke »

LVM is a method of pooling the disks to appear as 1. If you could reformat/arrange the volumes into an LVM then your 4 1 terabyte raids would show up as one big 16 terabyte disk.

Warning: LVM is not for the faint of heart, or for the boot partition. Google LVM2 in your native language and see if it's something you could do/would want to do.
coke
Posts: 518
Joined: Wed Jan 30, 2008 5:53 pm
Location: St. Louis, MO, USA

Post by coke »

Meanwhile, my regex is too rusty to argue with the other lines, but you'll want to change line 3 to

Code: Select all

$df = shell_exec( 'df --total /usr/share/zoneminder/events/1 /usr/share/zoneminder/events/2 /usr/share/zoneminder/events/3 /usr/share/zoneminder/events/4' );
It's a start.
Flav
Posts: 38
Joined: Tue Jan 12, 2010 2:26 pm

Post by Flav »

coke wrote:LVM is a method of pooling the disks to appear as 1. If you could reformat/arrange the volumes into an LVM then your 4 1 terabyte raids would show up as one big 16 terabyte disk.

Warning: LVM is not for the faint of heart, or for the boot partition. Google LVM2 in your native language and see if it's something you could do/would want to do.
I know But the System Administrator don't want change to LVM

Thanks
Locked