TrapGen 使用说明

简介:

Using Trapgen

You can download trapgen from here (there are alternative SNMP trap generators around, this is just as an example):

http://trapgen.trapreceiver.com/

Usage:

trapgen -d <destinationIpAddress:port>

-c <communityName>

-f <filename>

-g <trapType>

-h

-i <senderIP>

-m <timeout>

-o <senderOID>

-p a | h | b

-r <requestId>

-s <specificType>

-t <timestamp>

-v <oid> <type> <value>

Note: Either the -d <destination ip address> pair or the -f <input file> pair (which must contain a -d <destination ip address> pair) is mandandatory. Choosing -p will cause the trap to be printed to the screen, and will not send a trap to the specified destination.

example: trapgen -d 192.168.2.3

The above example will generate a trap that looks like this:

community: public

sender ip: current host ip

Sender OID: 1.3.6.1.4.1.2854

Trap Type: 6 (enterprise specific)

Specific Type: 1

Timestamp: system time value in timeticks

This trap will have an empty varbind list and will be sent to ip address 192.168.2.3 on port 162. The above values are the defaults (except the destination ip address 192.168.2.3). Use the various command line options to override these defaults. 

Command Line Options

-d <destinationIpAddress:port>

This mandatory parameter specifies the destination IP address for the generated trap. However, if the -p option is chosen, no trap will go to the specifed IP address. The default destination port is 162. If you want to send the trap to a different port, you can specify the new port number by following the IP address with a colon followed by the port number. For example:

trapgen -d 10.1.1.1 (Sends a trap to IP address 10.1.1.1 port 162)

trapgen -d 10.1.1.1:8162 (Sends a trap to IP address 10.1.1.1 port 8162)

-c <communityName>

An optional parameter that modifies the value of the community name from the default value of "public" to the value specified

-f <filename>

You may store the parameter information in a text file. The text file should look like a series of command line options, with each option on a separate line. For example:

–mytrapfile.txt–

-d 123.45.67.89:1025

-c private

-o 1.3.6.1.4.1.1824

-i 199.8.7.6

-g 5

-s 23

-t 12445

-v 1.3.6.1.4.1.1824.1.0.0.1 STRING This is a string (you do not need quotes)

-v 1.3.6.1.4.1.1824.1.0.0.1 COUNTER 3345556

-v 1.3.6.1.4.1.1824.1.0.0.1 GAUGE 12343212

-v 1.3.6.1.4.1.1824.1.0.0.1 INTEGER 99

-v 1.3.6.1.4.1.1824.1.0.0.1 ADDRESS 100.200.123.111

-v 1.3.6.1.4.1.1824.1.0.0.1 OID 1.2.3.4.5.6.7.8.9

-v 1.3.6.1.4.1.1824.1.0.0.1 TIMETICK 2233121

trapgen -d 10.1.1.1 -f mytrapfile.txt

In addition to the options listed in the file, the command line options will also be processed. The command line options will override the file specified options (except varbind info which will accumulate).

-g <trapType>

An optional parameter that modifies the default trap type from enterprise specific (6) to the user specified trap type. Valid trap types are:

· 0 – cold start

· 1 – warm start

· 2 – link down

· 3 – link up

· 4 – authentication failure

· 5 – egp neighbor loss

· 6 – enterprise specific

-h

Prints a help message that lists these command line parameters and options

-i <senderIP>

This modifies the default send IP address. The default value is the currnent host IP address of the machine running trapgen.

-m <timeout>

Set the value for the timeout

-o <senderOID>

This modifies the default value of the NCOMTECH enterprise OID (1.3.6.1.4.1.2854) to the value specified.

-p a | h | b

This option prints the traps generated to the screen rather than sending them to the specified IP address. This helps you to review the contents of the trap you are expecting to receive at your trap receiving program. THis option has three methods of printing: a – ASCII, h – hexidecimal, and b for both.

-r <requestId>

This option sets the request ID to a value specified by the user. This value is otherwise generated by trapgen.


-s <specificType>

This option enables the user to specify the specific type for a trap. This value is usually defined in the MIBs.

-t <timestamp>

This replaces the default value of the current system time with the value specified by the user.

-v <oid> <type> <value>

<oid> is the MIB variable object identified (oid) for the instance variable specified by this option. The oid should match a valid leaf instance, and should match the type listed in this option if you are sending a valid trap.

<TYPE> is one of the following:

· STRING

· COUNTER

· GAUGE

· INTEGER

· ADDRESS

· OID

· TIMETICK

· HEX

<value> is the value to associate in the varbind

For example:

trapgen -d 10.1.1.1 -v 1.3.6.1.4.1.1824.1.0.0.1 STRING "Very High Temperature"

Note the use of quotes ("") to enclose the text which contains spaces.

SOSSE and NSM integration – SNMP

To configure Spotlight SQL Server Enterprise to integrate with a NMS using SNMP traps generated by trapgen.exe

1. Open Spotlight and select File -> Connect

clip_image002

2. In Connection Manager right click on an instance of SQL Server and select Properties.

clip_image004

3. In Properties select Alarms

clip_image006

4. In Editing Alarms (select Click here to edit the default settings for all connections if required) select the relevant alarm i.e. Databases Unavailable and select Override the default settings for the rule. Select Run Program when the alarm is raised. Choose Select a Programto run. Adjust thresholds and severity as required.

clip_image008

5. Enter trapgen.exe and parameters in the Command Line box.

clip_image010

相关文章
|
网络协议
udhcpc 参数使用说明
当没有网络的时候,板子一直发送dhcp请求,导致程序不往下执行,解决的办法是把它切换到后台运行,可是如何切换到后台呢,有办法,它自带参数可以实现该功能。如下:   udhcpc -b -i eth0 -p /var/run/udhcpc.pid -R解释一下,-b就是切换到后台指令,-i是指定使用哪个网络接口,双网卡的时候一定要使用它来指定eth0  or  eth1。
2505 0
|
2月前
|
JSON Java API
jjwt使用说明-笔记
这篇文章介绍了如何使用jjwt库在Java中生成和验证JSON Web Tokens (JWT)。文章提供了在Maven项目中添加jjwt依赖的步骤,生成token的方法,以及如何验证token的示例代码。此外,还包含了一些关于token标准载荷和自定义载荷的说明,以及如何处理token验证过程中可能遇到的异常。
jjwt使用说明-笔记
|
6月前
VNG S99使用说明
VNG S99使用说明
32 0
|
SQL 数据库 数据库管理
Archery使用教程 [部署、配置、使用] 详情!
Archery使用教程 [部署、配置、使用] 详情!
|
安全 数据库 数据格式
EndnoteX9简介及基本教程使用说明
EndnoteX9简介及基本教程使用说明
476 0
EndnoteX9简介及基本教程使用说明
|
存储 安全 程序员
@SafeVarargs 使用说明
@SafeVarargs 是jdk1.7引入的适用于可变参数与泛型能够更好结合的一个注解。 @SuppressWarnings 产生编译期警告的示例代码
64 0
UpdateData使用说明
UpdateData() MFC的窗口函数,下面是MSDN的说明; Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data.
958 0
|
Web App开发 应用服务中间件 nginx
JBrowse使用说明:如何安装JBrowse
JBrowse is a fast, scalable genome browser built completely with JavaScript and HTML5. It can run on your desktop, or be embedded in your website. 如果你想要使用JBrowse,一定要有管理员权限,否则建议使用IGV。
2604 0
|
数据库 数据安全/隐私保护 SQL
下一篇
无影云桌面