����JFIF��x�x����'
Server IP : 78.140.185.180 / Your IP : 18.218.161.96 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 : /usr/lib64/nagios/plugins/extra/ |
Upload File : |
#!/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;