Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/usr/share/perl5/vendor_perl/Ocsinventory/Agent/Backend/OS/HPUX/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/perl5/vendor_perl/Ocsinventory/Agent/Backend/OS/HPUX/Drives.pm
package Ocsinventory::Agent::Backend::OS::HPUX::Drives;

sub check  { $^O =~ /hpux/ }

sub run {
    my $params = shift;
    my $common = $params->{common};

    my $type;
    my $fs;
    my $lv;
    my $total;
    my $free;

    for ( `fstyp -l | grep -v nfs` ) {
        if ( /^\s*$/ ) {         #Blank line 
            next;
        }  

        $type=$_;
        for ( `bdf -t $type `) {
            if ( /Filesystem/ ) { ;  } ;
            if ( /^(\S+)\s(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/ ) {
                $lv=$1;
                $total=$2;
                $free=$3;
                $fs=$6;
                $common->addDrives({
                    FREE => $free,
                    FILESYSTEM => $fs,
                    TOTAL => $total,
                    TYPE => $type,
                    VOLUMN => $lv,
                });
            };
            if ( /^(\S+)\s/) {
                $lv=$1;
            };
            if ( /(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/) {
                $total=$1;
                $free=$3;
                $fs=$5;
                # print "fs $fs lv $lv total $total free $free type $type\n";
                $common->addDrives({
                    FREE => $free,
                    FILESYSTEM => $fs,
                    TOTAL => $total,
                    TYPE => $type,
                    VOLUMN => $lv,
                });
            };
        };
    };
}

1;

Hry