diff --git a/check_snmp_includes b/check_snmp_includes
index 83b8a6b7395926b3cdc42746795030ee5864fb3e..27aab5912b6bdad48d38d75f8d73a966e3b7cde6 100644
--- a/check_snmp_includes
+++ b/check_snmp_includes
@@ -35,7 +35,7 @@ read_config(){
     SNMPAUTH="-v $SNMPVERSION -c $SNMPCOMMUNITY"
 
     if [ -r "$SNMPCONFIG" ]; then
-        SNMPAUTH="$( grep -v "^#" "$SNMPCONFIG" | grep "^,*${SNMPTARGET}[,:]" | cut -f 2- -d ':' )"
+        SNMPAUTH="$( grep -v "^#" "$SNMPCONFIG" | grep ",*${SNMPTARGET}[,:]" | cut -f 2- -d ':' )"
         if [ -z "$SNMPAUTH" ]; then
             SNMPAUTH="$( grep "^DEFAULT:" "$SNMPCONFIG" | cut -f 2- -d ':' )"
             if [ -z "$SNMPAUTH" ]; then