[ SEA-GHOST MINI SHELL]

Path : /proc/2/cwd/proc/3/root/proc/3/task/3/root/proc/3/root/var/lib/zabbix/
FILE UPLOADER :
Current File : //proc/2/cwd/proc/3/root/proc/3/task/3/root/proc/3/root/var/lib/zabbix/balloon_check.pl

#!/usr/bin/perl

use strict;
use warnings;


my @IDs = `qm list | grep -v VMID | awk '{print \$1}'`;
chomp @IDs;
my @SERVERS = ();

for my $i (@IDs) {
  my $server_status = `pvesh get /nodes/\$(echo -n \$(hostname -s))/qemu/$i/status/current 2>/dev/null | grep "\\"status\\"" | awk -F'"' '{print \$4}'`;
  chomp $server_status;
  my $result_string = `pvesh create /nodes/\$(echo -n \$(hostname -s))/qemu/$i/monitor -command "info balloon" 2> /dev/null`;
  chomp $result_string;
  if ($result_string !~ /total_mem=/ and $server_status ne 'stopped') {
    my $server = `pvesh get /nodes/\$(echo -n \$(hostname -s))/qemu/$i/config 2>/dev/null | grep name | awk -F'"' '{print \$4}'`;
    chomp $server;
    push (@SERVERS, $server);

  }
}

if (@SERVERS) {
  print "ERROR: Found missing virtio-balloon driver: ";
  print join(", ", @SERVERS) . "\n";
} else {
  print "OK";
}

SEA-GHOST - SHELL CODING BY SEA-GHOST