[ SEA-GHOST MINI SHELL]

Path : /proc/2/root/var/lib/zabbix/
FILE UPLOADER :
Current File : //proc/2/root/var/lib/zabbix/megacli-adp-discovery.sh

#!/usr/bin/env bash
# Author: Lesovsky A.V.
# Adapters auto-discovery via MegaCLI. VERY VERY EXPERIMENTAL (TESTED WITH 8.02.21 Oct 21, 2011)
if type MegaCli >/dev/null 2>&1 ; then
    MEGACLI="MegaCli"
elif type /opt/MegaRAID/MegaCli/MegaCli64 >/dev/null 2>&1 ; then
    MEGACLI="/opt/MegaRAID/MegaCli/MegaCli64"
else
    MEGACLI="unknown"
fi

if [ "$MEGACLI" != "unknown" ]; then
  adp_list=$(sudo $MEGACLI adpallinfo aALL nolog |grep "^Adapter #" |cut -d# -f2)

  if [[ $1 = raw ]]; then
    for adp in ${adp_list}; do echo $adp; done ; exit 0
  fi

  echo -n '{"data":['
  for adp in $adp_list; do echo -n "{\"{#ADPNUM}\": \"$adp\"},"; done |sed -e 's:\},$:\}:'
  echo -n ']}'
else
  echo "ZBX_NOTSUPPORTED"
fi

SEA-GHOST - SHELL CODING BY SEA-GHOST