Page 1 of 1

Switch Wizard Using resource.cfg

Posted: Thu Sep 04, 2014 7:49 am
by mikew
I am working with a two organizations which have several thousand switches and routers to enter with the switch/router wizard. One is using v2c and one is using v3. Both organizations would like to use the resource.cfg file to define there community string or user/password information as they do not want it to be plain text for people to see in the configurations. They are just trying to avoid someone looking over their shoulder and scooping sensitive data...basic security.

The question then is:
Is there a way to use those values in the resource.cfg file when you start the wizard?

Changing those values after the fact is not an option unless we write a script and import all the changes, but with 1000 switches/routers that is many thousands of lines of code to have to change....I can make mistakes.

Is there a fundamental reason that the switch wizard could not be altered to do this?

Ideas?

Re: Switch Wizard Using resource.cfg

Posted: Thu Sep 04, 2014 11:19 am
by sreinhardt
Actually most if not all wizards should pull just fine from resources.cfg. Simply use $USER2$ in place of the community string or any other variable that you wish to replace. The only exception that I can think of would be things such as vmware wizard for user auth, which stores in a flatfile and does not get nagios to expand the user macros prior to execution.

If you wanted them to be populated by default with those macros, some simple php modification of the default form values on switch.inc.php file would clear that right up!

Re: Switch Wizard Using resource.cfg

Posted: Thu Sep 04, 2014 11:26 am
by mikew
Thanks, I will give it a try and report back.

Re: Switch Wizard Using resource.cfg

Posted: Thu Sep 04, 2014 12:56 pm
by mikew
Works as you explained...thanks you can lock this.

Just for those interested in this process:

Edit /usr/local/nagios/etc/resource.cfg and add your Macro:

$USER9$=my_community_string

Then when you add it in your switch/router config just use $USER9$.

Of course if this is V3 you will need to create a Macro for each element: user, pass, etc.