[ SEA-GHOST MINI SHELL]

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

#!/bin/bash

host=$1
community=$2

first=1
IFS=$'\n'
snmpindex=$(snmpwalk -v 2c -c "$community" "$host" 1.3.6.1.4.1.674.10892.2.5.1.1.5 | grep -v "N/A"| awk -F " =" '{print $1}'| awk -F "." '{print $14}')
echo -ne "{ \"data\" : [\n";

for i in $snmpindex
do
        slotnum=$(snmpwalk -v2c -c "$community" "$host" 1.3.6.1.4.1.674.10892.2.5.1.1.5.$i | awk -F "=" '{print $2}' | awk -F ": " '{print $2}' | sed "s/\"//g")
        slotname=$(snmpwalk -v 2c -c "$community" "$host" 1.3.6.1.4.1.674.10892.2.5.1.1.4.$i| awk -F "=" '{print $2}' | awk -F ": " '{print $2}' | sed "s/\"//g")
        if [ $first == 0 ]; then echo -ne ",\n";
        fi
        first=0

        echo -ne "{"
        echo -ne " \"{#SNMPINDEX}\" : \"$i\" , \"{#SLOTNAME}\" : \"$slotname\" , \"{#SLOTNUM}\" : \"$slotnum\" , \"{#HOSTNAME}\" : \"$host\" ";
        echo -ne " }"
done

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

SEA-GHOST - SHELL CODING BY SEA-GHOST