#!/bin/sh

processMDM6000()
{
	#echo processMDM6000 function called >> /tmp/trap.log
	
	mdm6000oid=$1
	mdm6000status=$2

	mdm6000root="SNMPv2-SMI::enterprises.5835.5.2"
	mdm6000demod="3300.1.1"
	mdm6000mod="1000.1.19"
	mdm6000dev="100.1.10"

	min=-1
  	#demod alarms
  	if [[ $mdm6000oid == $mdm6000root.$mdm6000demod.* ]]
  	then
  		min=0
		mask="$mdm6000root.$mdm6000demod."
		mdm6000oid=$(echo $mdm6000oid | sed "s/$mask//")
  	fi
  	#mod alarms
  	if [[ $mdm6000oid == $mdm6000root.$mdm6000mod.* ]]
  	then
  		min=8
		mdm6000oid=$(echo $mdm6000oid | sed "s/$mdm6000root.$mdm6000mod.//")
  	fi
  	#device alarms
  	if [[ $mdm6000oid == $mdm6000root.$mdm6000dev.* ]]
  	then
  		min=27
		mdm6000oid=$(echo $mdm6000oid | sed "s/$mdm6000root.$mdm6000dev.//")
  	fi


	if [ min != "-1" ]
	then
		event=$(echo $mdm6000oid | sed 's/.0//')
		event=$(($min + $event))
		insertAlarm $id $event $mdm6000status
		#echo $event $mdm6000status
	else
		echo "no match found for $mdm6000oid." >> /tmp/satis.trap.log
	fi
} 

#processMDM6000 SNMPv2-SMI::enterprises.5835.5.2.3300.1.1.4.0 1
