DX NetOps

 View Only
  • 1.  Device-SNMP community String Details

    Posted Sep 19, 2016 03:12 AM

    Hi All,

     

    Is there a way in SPectrum 9.4.2   we can find out , what SNMP community string is being used by all the devices.

    Can a report be pulled out for all devices, with their SNMP mappings.



  • 2.  Re: Device-SNMP community String Details

    Broadcom Employee
    Posted Sep 19, 2016 04:52 AM

    Hi Guneet,

     

    You can use CLI script similar to below. You can try to execute the script and verify (put the script into $SPECROOT/vnmsh/sample_script directory).

    #!/bin/sh
    CLIPATH=..                          # Define path to the cli directory


    # determine which awk utility to use

    OSTYPE=`uname -s`
    case  $OSTYPE in
            Linux)
                       AWKUTIL=/usr/bin/awk ;;

            Windows_NT) # NT
                       AWKUTIL=awk ;;

            *)         # All other platforms
                       AWKUTIL=/usr/bin/nawk ;;
    esac

    CLISESSID=$$                        # Define the CLISESSID variable to a
    export CLISESSID                    # unique value and export it.
    export CLIMNAMEWIDTH=64

    # Connect to SS
    $CLIPATH/connect

    for dev in `$CLIPATH/show devices | $AWKUTIL '{printf "%s,%s,\n", $1, $2}' | tail -n +2`;
    do
      mh=`echo $dev | $AWKUTIL -F, '{print $1}'`
      comm=`$CLIPATH/show attributes attr=0x10024 mh=$mh | tail -n +2 | $AWKUTIL '{print $3}'`
      echo $dev$comm
    done

    exit 0

    Regards,

    Widjaja



  • 3.  Re: Device-SNMP community String Details
    Best Answer

    Posted Sep 19, 2016 07:40 AM

    You can add the Community_Name attribute id 0x10024 to be displayed in the Results tab after a Locater search. This can be done by editing the $SPECROOT/tomcat/webapps/spectrum/WEB-INF/common/config/table-model-config.xml file. Copy this file to the $SPECROOT/custom/common/config directory and add a reference to the column-community-config.xml file. The following is an example where I added it near the end:

     

    <column idref="column-device-uuid-config">
    <hidden-by-default>true</hidden-by-default>
    </column>
    <column idref="column-community-config">
    <hidden-by-default>true</hidden-by-default>
    </column>
    </column-list>
    </table>

     

    Log out of OneClick and then log back in. Run the All Devices Locater search. Right click on any column header int eh Results tab and you should see the following:

     

     

    Check the box next to SNMP Community String and click OK. The Community String/Name should now appear in a column for each model displayed.

     

    Joe



  • 4.  Re: Device-SNMP community String Details

    Posted Sep 19, 2016 08:59 AM

    Thanks Joe,

    It worked for me.