Skip to content
Snippets Groups Projects
Commit 6e2ac234 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

fix host search in snmp.cfg

parent bd99efcb
Branches
No related tags found
1 merge request!72fix host search in snmp.cfg
This commit is part of merge request !72. Comments created here will be created in the context of that merge request.
...@@ -35,7 +35,7 @@ read_config(){ ...@@ -35,7 +35,7 @@ read_config(){
SNMPAUTH="-v $SNMPVERSION -c $SNMPCOMMUNITY" SNMPAUTH="-v $SNMPVERSION -c $SNMPCOMMUNITY"
if [ -r "$SNMPCONFIG" ]; then 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 if [ -z "$SNMPAUTH" ]; then
SNMPAUTH="$( grep "^DEFAULT:" "$SNMPCONFIG" | cut -f 2- -d ':' )" SNMPAUTH="$( grep "^DEFAULT:" "$SNMPCONFIG" | cut -f 2- -d ':' )"
if [ -z "$SNMPAUTH" ]; then if [ -z "$SNMPAUTH" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment