Net-SNMP 的多个配置文件,以简化 MIBS 管理

Net-SNMP 的多个配置文件,以简化 MIBS 管理

我目前有一个包含许多mibdirs子句的 /etc/snmp/snmp.conf 。这很好,因为我们有一个包含所有 MIBS 的包,但现在我想将这些 MIBS 的子集绑定到驱动程序,这样当我安装特定驱动程序时,它也会安装 MIBS。附加到 snmp.conf 似乎很麻烦。我想要多个独立的conf文件(显然只是添加到核心conf中)以使一切变得简单。

如何拥有多个conf文件,特别是拥有每个包含一组mibdirs调用的单独文件?有这样的事吗/etc/snmp/snmp.d

答案1

来自man snmp_config

   INCLUDING OTHER CONFIGURATION FILES
   It is possible to include other configuration files for processing 
   during normal configuration file processing.:

          # include site specific config
          includeFile site.conf

   This will load the specified configuration file. The
   path to file must be either absolute, starting with '/',
   or relative. The relative path is then relative to the directory
   where the parent file with 'includeFile' directive resides.

   The included file name does not need to have '.conf' suffix.

          # include a all *.conf files in a directory
          includeDir /etc/snmp/config.d

   This will search specified directory for all files with '.conf'
   suffix and process them as if they were included using includeFile
   directive. The configuration files are not processed in any particular
   order.

   The specified directory must be absolute directory path.

相关内容