11-22-2018 02:08 AM
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??
11-23-2018 01:26 AM - edited 11-23-2018 01:27 AM
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:
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