1752866 Members
3884 Online
108791 Solutions
New Discussion ī„‚

Re: How to delete SNMP Communities via IMC?

 
SOLVED
Go to solution
Arctica
Occasional Advisor

How to delete SNMP Communities via IMC?

Just starting to learn how to use IMC.

Really happy to have found the batch setting of new community names via 

Resource > Batch Operation > Device/Interface Configuration Guide

 

But I get the impression that this is working for adding new SNMP names, but how do I batch that I want to delete the "Public" and "Private" default SNMP communities?

6 REPLIES 6
LindsayHill
Honored Contributor
Solution

Re: How to delete SNMP Communities via IMC?

I think the best way to do this will be to create a configuration template (Service -> Configuration Center), and push that out to those devices.

Create a config template that contains "no snmp-server community public", or whatever the equivalent is for your devices.

Arctica
Occasional Advisor

Re: How to delete SNMP Communities via IMC?

Great, thanks a lot!

I made a script with these 2 lines and it worked perfect when testing against a HP Procurve 2520 switch:

no snmp-server community public
no snmp-server community private

May I ask you one more thing?
I thought I could add 2 more lines and have the same script add the SNMP communities I want to have:

snmp-server community donald rw
snmp-server community duck ro

But those lines fail with a "TELNET syntax error".

Is there a way to test that the commands in the script are correct or not? I tried to Telnet to the switch, went to CLI and entered as an example "no snmp-server community public" which I know works via IMC, but the Telnet window just say "Invalid input: snmp-server".
And what would be the correct syntax in my little script to have the communities added?

Arctica
Occasional Advisor

Re: How to delete SNMP Communities via IMC?

I played around and actually found the answer to my own questions :-)

So to test any script commands, what I should do in CLI is to first issue the command "config" and then I can enter the lines I have in my script.

And the correct syntax to add an SNMP community is:

snmp-server community Donald unrestricted

So my tiny 4 lines that will save me some time are simply:

no snmp-server community public
no snmp-server community private
snmp-server community Donald unrestricted
snmp-server community Duck restricted

Thanks for your help!

 

LindsayHill
Honored Contributor

Re: How to delete SNMP Communities via IMC?

Good to hear you got it working

NeilR
Esteemed Contributor

Re: How to delete SNMP Communities via IMC?

Also note that the CLI script execution function does not automatically save the modified configuration to memory. 

So add a write memory (or equivalent for your OS) statement to the end of your script to save. Otherwise the next reboot will clear your changes.

That can be handy not to save if you are just testing or want an easy recovery - a reboot will quickly restore the old config.

Arctica
Occasional Advisor

Re: How to delete SNMP Communities via IMC?

Thanks, I wouldn't have thought about that!