[SERVER-13004] Enterprise SNMP config file setup on windows Created: 03/Mar/14 Updated: 08/Jan/24 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Security |
| Affects Version/s: | 2.6.0-rc0 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Minor - P4 |
| Reporter: | Mira Carey | Assignee: | Backlog - Security Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | Windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Server Security
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
The config files for snmp support on windows need a fair bit of setup compared to linux. And while it's possible to get everything working on windows, the workaround make it obvious how non-idiomatically we've built the support. Do we want to update the existing docs, or try a little harder in the installer to make support more out of the box? Steps needed to get snmp up for windows:
By default, mongod looks for mongod.conf in a handful of paths, none of which exists: c:/snmp/etc/snmp;c:/snmp/share/snmp (note the reversed slashes). It seems like we could look for a config in our own install path "c:\Program Files\MongoDB Enterprise 2.6.0", or provide a command line switch to point to a file. We could also ship with a subagent config that works out of the box. Either way, setting an environment variable for a library that we're completely wrapping to locate a config which doesn't immediately work seems impolite when we could technically just fix our installer. |
| Comments |
| Comment by Mark Benvenuto [ 16/May/17 ] |
|
We never want to set a global environment variable like SNMPCONFPATH as part of the installer. An simpler option is to simply set SNMPCONFPATH before init_agent is called in the mongod process. This would allow us to use the MongoDB install path over the Net-SNMP hardcoded c:\snmp. |
| Comment by Eric Milkie [ 03/Mar/14 ] |
|
See linked tickets for sub-work. |
| Comment by Eric Milkie [ 03/Mar/14 ] |
|
Actually, mongod does not look for mongod.conf, NetSNMP does, and since the configuration default path is set at compile-time for that third-party library, it is difficult to choose a reasonable default. NetSNMP is designed so that you build it yourself and then install it yourself, and when you do that everything is easy. When you have another company build it for you, this scheme doesn't work so well. So we must override the default with that environment variable at run time. As far as I know, on Linux you must copy the SNMP configure files to an appropriate place as well, so I don't see the first bullet as being any worse on Windows. I believe the directory name was chosen because it was similar to the Linux directory, and because we couldn't think of anything better. Searching for the config file in Program Files install path isn't idiomatic, since you shouldn't have editable configuration text files in the Program Files tree. Setting environment variables within the mongod runtime is risky, and particularly so on Windows. Letting the user set the environment before running the server seemed like the easiest way to avoid problems. In the future, we expect to have a native monitoring solution on Windows that will be a lot less clunky; there are a few SERVER tickets tracking the work. |