403Webshell
Server IP : 199.250.200.62  /  Your IP : 216.73.216.24
Web Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /opt/dedrads/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/dedrads/check_dcpumon
#!/bin/bash

CHECKUSER="$1"
SESSIONID="$2"

if [ -z "$1" ]; then
echo
echo "Usage: check_dcpumon [username]"
echo
exit 0
fi

#load functions + banners
if [ -f /opt/sharedrads/radsfunctions.sh ]; then
    # shellcheck disable=SC1091
    source /opt/sharedrads/radsfunctions.sh
else
    # shellcheck disable=SC1091
    source /opt/dedrads/radsfunctions.sh
fi

if [ "$2" == "--plaintext" ]; then
RADSCOLORS=off
DETAILED=YES
fi

if [ -z "$2" ]; then
SESSIONID=$(date +%s)
DETAILED=YES
fi

#get the data from dcpumon, save it in a unique tmp session file
NODATA=FALSE
/usr/local/cpanel/bin/dcpumonview | grep "/$CHECKUSER/" > "/tmp/.$SESSIONID" || NODATA=TRUE


if [ "$NODATA" == "FALSE" ]; then



if [ "$RADSCOLORS" == "off" ];
then
echo -e "\033[0m  Displaying top utilization processes for user as recorded by cPanel and dcpumon \033[0m"
else
echo -e "\033[40;37;2m  Displaying top utilization processes for user as recorded by cPanel and dcpumon \033[0m"
fi



if [ "$RADSCOLORS" == "off" ];
then
    	echo -en "\033[0m"
else
    	echo -en "\033[30;1m"
fi

#strip html from 'dcpumonview' output
cat "/tmp/.$SESSIONID" | sed 's/<[^>]*>/ /g'

#clear colors
echo -ne "\033[0m"

fi

#no session ID was received earlier, we were invoked directly, lets display add'l history:

echo

if [ "$DETAILED" == "YES" ]; then

if [ "$RADSCOLORS" == "off" ];
then
echo "  Displaying usage history for user as recorded by cPanel and dcpumon "
else
echo -e "\033[40;37;2m  Displaying usage history for user as recorded by cPanel and dcpumon \033[0m"
fi

if [ "$RADSCOLORS" == "off" ];
then
        echo -ne "\033[0m"
else
        echo -ne "\033[34;1m"
fi

grep "$CHECKUSER" "/var/log/dcpumon/$(date +%Y)/$(date +%b)"/* | grep -v root | sed 's_/var/log/dcpumon/__'| \
         awk -F= '{total=total+$2;printf "%s\t%1.1f\t%f\t%f\t\n",$1,$2,$3,$4}' | \
         awk '{gsub(/\//," ",$0);gsub(/:/,": ",$0);print;}' | sort -fMk2 -nk3
#clear colors
fi

echo -ne "\033[0m"

rm -f "/tmp/.$SESSIONID"

Youez - 2016 - github.com/yon3zu
LinuXploit