����JFIF��x�x����'403WebShell
403Webshell
Server IP : 78.140.185.180  /  Your IP : 3.144.162.109
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_users_ratio
#!/usr/bin/env perl

use extreme;
use File::Slurp;
use English;
use Sys::Hostname;
use Carp;

my %ERRORS = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 );

exec "sudo $0 @ARGV" if $UID > 0;

my ( $total, $suspended ) = ( 0, 0 );

if ( -d '/usr/local/cpanel' ) {
    $total     = scalar read_dir('/var/cpanel/users')->@*;
    $suspended = scalar read_dir('/var/cpanel/suspended')->@*
      if -d '/var/cpanel/suspended';
}
elsif ( -d '/usr/local/mgr5' ) {
    my $out
      = `/usr/local/mgr5/sbin/mgrctl -m ispmgr user | awk '\$0 ~ /active=off/ {susp += 1} END {print NR, (susp=="" ? 0 : susp)}'`;
    ( $total, $suspended ) = split /\s+/, $out;
}
elsif ( -d '/usr/local/directadmin' ) {
    $total = scalar read_dir('/usr/local/directadmin/data/users')->@*;
    $suspended
      = `grep -r 'suspended=yes' /usr/local/directadmin/data/users/*/user.conf | wc -l`;
}
elsif ( -d '/usr/local/solus' ) {
    require SolusVmAPI::Client;

    my $hostname = hostname;
    my $svmapi   = SolusVmAPI::Client->new();
    my $out      = $svmapi->get("vms-count/$hostname");
    $total       = $out->{'vms-count'}->{'total'};
    $suspended   = $out->{'vms-count'}->{'suspended'};
}

chomp $total;
chomp $suspended;
my $ratio = sprintf( '%.2f', $total == 0 ? 0 : $suspended / $total );
say
  "total users=$total; suspended=$suspended; ratio=$ratio | total=$total;;; suspended=$suspended;;;";
exit $ERRORS{'OK'}      if $ratio < 0.4;
exit $ERRORS{'WARNING'} if $ratio >= 0.4;

Youez - 2016 - github.com/yon3zu
LinuXploit