����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.170 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 : /proc/1630575/root/proc/1630575/root/proc/self/root/usr/lib64/nagios/plugins/extra/ |
Upload File : |
#!/usr/bin/env perl
use extreme;
use English;
use Getopt::Long;
use SolusVmAPI::Client;
exec "sudo $0 @ARGV" if $UID > 0;
my ( $warncount, @incidents, @perfdata );
GetOptions( 'warncount=i' => \$warncount, );
$warncount //= 15;
############
# VPS
#
my $svmapi = SolusVmAPI::Client->new();
my $free_ips = $svmapi->get('ips/free_ips');
for my $location ( keys $free_ips->%* ) {
push @incidents, "VPS: $free_ips->{$location} IP left in $location location"
if $free_ips->{$location} < $warncount;
push @perfdata, "solusvm_${location}=$free_ips->{$location}";
}
############
# shared
my @locations
= `ips show --ip_version=4 | grep Location | awk '{print \$2}' | sort | uniq`;
for my $location (@locations) {
my $type = 'Shared';
chop $location;
next unless $location;
my $count = `ips show --ip_version=4 --location=$location --free --count`;
chop $count;
$type = 'Pterodactyl' if length($location) > '1';
push @incidents, "$type: $count IP left in $location location"
if $count < $warncount;
$location = lc($location);
$type = lc($type);
push @perfdata, "${type}_${location}=$count";
}
############
if (@incidents) {
say join( "\n", @incidents ) . " | " . join( ";;; ", @perfdata ) . ";;;";
exit 2;
}
say "OK" . " | " . join( ";;; ", @perfdata ) . ";;;";