[ SEA-GHOST MINI SHELL]
Path : /proc/2/root/var/lib/zabbix/ |
|
Current File : //proc/2/root/var/lib/zabbix/general_recursive_snmp_check.bash |
#!/bin/bash
HOST=$1
COMMUNITY=$2
OID=$3
OUTPUT_STATUS=$4
GETTING_DATA=$( snmpwalk -v 2c -c ${COMMUNITY} ${HOST} ${OID} )
GET_SNMP_VALUE=$( echo "${GETTING_DATA}" | awk '{print $NF}' )
if [[ "${GETTING_DATA}" =~ .*(No Such Object available on this agent).* ]]
then
STATUS='101'
echo "${STATUS}"
exit 0;
fi
while read CHECK_SNMP_VALUE
do
if [ "${CHECK_SNMP_VALUE}" != "${OUTPUT_STATUS}" ]
then
STATUS='1'
fi
done <<< "$GET_SNMP_VALUE"
echo "${STATUS:=0}"
SEA-GHOST - SHELL CODING BY SEA-GHOST