Current File : /home/httpd/html/5K2rEFhjmRiucJ8p.php
<?php
/*
Custom monitoring script for memory monitoring using PHP shell_exec() functionality.
iAvailableRAMWarning integer can be changed to trigger alerts on certain % of available RAM.
*/
$iAvailableRAMWarning=20;
print_r (shell_exec( 'free -m | head -n2 | tail -n1 | awk \'{printf("%.2f% Memory (%.2f Gb out of %.2f Gb) is free\n", $NF/$2*100, $NF/1024, $2/1024);}\'' ));
print_r (shell_exec( "if [ $(( ($(free -m | head -n2 | tail -n1 | grep -o '[0-9]\+' | tail -n1)*100)/$(free -m | head -n2 | tail -n1 | grep -o '[0-9]\+' | head -n1))) -le $iAvailableRAMWarning ]; then echo This is bad; else echo This is OK; fi;" ));
?>