Switch Wizard Using resource.cfg

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Switch Wizard Using resource.cfg

Post 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?
Mike Weber

Nagios Training/Consulting
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Switch Wizard Using resource.cfg

Post 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!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Re: Switch Wizard Using resource.cfg

Post by mikew »

Thanks, I will give it a try and report back.
Mike Weber

Nagios Training/Consulting
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Re: Switch Wizard Using resource.cfg

Post 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.
Mike Weber

Nagios Training/Consulting
Locked