[ SEA-GHOST MINI SHELL]

Path : /proc/2/root/var/lib/zabbix/
FILE UPLOADER :
Current File : //proc/2/root/var/lib/zabbix/ipmi_discovery.sh

#!/bin/bash

sensors=$(ipmitool -I "$1" -H "$2" -U "$3" -P "$4" -L "$5" sensor | grep $6)

first=1
IFS=$'\n'

echo -ne "{ \"data\" : [\n";

for sensor in $sensors
do

 if [[ $(echo ${sensor}| awk -F "|" '{print $2}'| sed 's/ //g') != "na" ]]; then
   name=$(echo ${sensor}| awk -F "|" '{print $1}'| sed 's/[ \t]*$//')
   lct=$(echo ${sensor}| awk -F "|" '{print $6}'| sed 's/ //g')
   hct=$(echo ${sensor}| awk -F "|" '{print $9}'| sed 's/ //g')

   if [ $first == 0 ]; then echo -ne ",\n";
   fi
   first=0

   echo -ne "{"
   echo -ne " \"{#SNAME}\" : \"$name\", \"{#LCT}\" : \"$lct\", \"{#HCT}\" : \"$hct\" ";
   echo -ne " }"
 fi
done

echo -ne " ]";
echo -ne " }\n";

SEA-GHOST - SHELL CODING BY SEA-GHOST