使用SNMPTT的变量替换功能,消息可以变的更友好,如在SNMPTT 配置文件中定义如下的格式:
FORMAT Logical Drive Status Change: Status is now $3.
那么上面收到的消息将会显示,可以看出,第三个变量rebuilding被替换显示出来:
Feb 12 13:37:13 server11 TRAPD: .1.3.6.1.4.1.232.0.3008 Normal "XLOGONLY" server08 - Logical Drive Status Change: Status is now rebuilding
(1). Perl 5.6.1 or higher. SNMPTT is developed with 5.6.1 and 5.8.0, but other versions may also work.
(2). Required: Net-SNMP (formerly known as UCD-SNMP). Specifically snmptrapd.
(3). Required: Text::ParseWords module (included with most distributions including ActivePerl)
(4). Required: Getopt::Long module (included with most distributions including ActivePerl)
(5). Required: Posix module (included with most if not all distributions including ActivePerl)
(6). Required: Config::IniFiles module
(7). Required: Time::HiRes module (only required when using SNMPTT in daemon mode - required by snmptthandler)
(8). Required: Sys::Hostname module (included with most if not all distributions including ActivePerl).
(9). Required: File::Basename module (included with most if not all distributions including ActivePerl).
(10). Required: Text::Balanced module (included with most if not all distributions including ActivePerl).
第三行:禁止访问控制检查 will disable the above access control checks, and revert to the previous behaviour of accepting all incoming notifications.
第四行:禁止通知的日志记录disables the logging of notifications altogether. This is useful if the snmptrapd application should only run traphandle hooks and should not log traps to any location.
注: snmptrapd.conf有很多很多具体的参数配置,具体可以man一下。
.snmptrapd服务启动配置:
使用如下命令启动snmptrapd,snmptrapd -On.
如果存在/etc/rc.d/init.d/snmptrapd文件,则也要更改添加上选项”-On”。
OPTIONS="-On -Lf /var/log/snmptrapd.log -p /var/run/snmptrapd.pid"
注:具体参数意思可查看帮助 四、snmptt.ini主配置文件的配置