For more details, please see ourCookie Policy.


Fibre Channel (SAN)

Reply
Occasional Contributor
Posts: 14
Registered: ‎06-01-2016

SNMP settings - DesiredSeverity. How to set it via CLI using scripting?

Hi team.

 

We are looking for to script our SNMP-settings, but I´m running into a showstopper that

I don´t understand how to set the correct Severity level.

 

Per default, the setting is None (in our switches) and we want level 3 (Warning).

I can set it if I manually go via "snmpconfig --set mibcapability" and then walk down the values,

but we want to put this into a script.

 

I´ve been testing the following cmds:

snmpconfig --set mibcapability -mib_name SW-MIB -trap_name swEventTrap --bitmask 0x03

snmpconfig --set mibcapability -mib_name SW-MIB -trap_name swEventTrap 3

snmpconfig --set mibcapability -mib_name SW-MIB -bitmask 0x10 3

 

But they didn´t work. I don´t think I have understood everything correctly.

 

Is there anybody that can share some light and help me on my way??

Regards

Ulf

 

 

 

 

 

 

Highlighted
Regular Contributor
Posts: 208
Registered: ‎04-04-2018

Re: SNMP settings - DesiredSeverity. How to set it via CLI using scripting?

[ Edited ]

Hello,

 

at first you you would like to change setting for SW-TRAP not for SW-MIB.

There is no option to do that with one official command . But there is another bypass for these interactive things.

 

you may use prinft and pipe

 

But at first you have to count how many "enters" you need to press before reach your variable for change.

 

So for example cut from output of command: snmpConfig --set mibCapability

 

.
.
.
SW-TRAP: YES
        swFault: YES
        swSensorScn: YES
        swFCPortScn: YES
        swEventTrap: YES
                DesiredSeverity:None
        swFabricWatchTrap: YES
                DesiredSeverity:None
.
.
.

I've count 14x enter to reach variable:

 swEventTrap:

So you may prepare command like:

printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n1\n" | snmpConfig --set mibCapability

After command i may see:

 

.
.
.
SW-TRAP: YES
        swFault: YES
        swSensorScn: YES
        swFCPortScn: YES
        swEventTrap: YES
                DesiredSeverity:Critical
        swFabricWatchTrap: YES
                DesiredSeverity:None
.
.
.

In your case use 3 as warning not 1 

 

 

 

Please mark this response as "Accept as Solution" if it answers your question.

Marian Bezeg

Join the Broadcom Community

Get quick and easy access to valuable resources across the Broadcom Community Network.