求教如何使用snmptrap命令将告警信息发给其他主机?
cmd1a:/ ROOT # uname -a
SunOS cmd1a 5.9 Generic_118558-08 sun4u sparc SUNW,Netra-4
cmd1a:/ ROOT # /usr/local/bin/snmptrap -V
UCD-snmp version: 4.2.5
本机IP是: 172.26.164.4 远程主机IP是:172.26.164.71
从本机只能通过ssh 172.26.164.71 来登陆远程Solairs主机.
想通过如下命令将一段告警信息发给远程主机如何发送? 我尝试用如下命令,但是不对, 请教高人.
cmd1a:/ ROOT # /usr/local/bin/snmptrap -v 2c -c public -h 172.26.164.71 -m "warning information"
Usage: snmptrap [options...] <hostname> {<community>} [<trap parameters> ...]
UCD-snmp version: 4.2.5
-h this help message.
-H Display configuration file directives understood.
-V display version number.
-v 1|2c|3 specifies snmp version to use.
SNMP Version 1 or 2c specific
-c <c> set the community name (v1 or v2c)
SNMP Version 3 specific
-Z <B,T> set the destination engine boots/time for v3 requests.
-e <E> security engine ID (e.g., 800000020109840301).
-E <E> context engine ID (e.g., 800000020109840301).
-n <N> context name (e.g., bridge1).
-u <U> security name (e.g., bert).
-l <L> security level (noAuthNoPriv|authNoPriv|authPriv).
-a <A> authentication protocol (MD5|SHA)
-A <P> authentication protocol pass phrase.
-x <X> privacy protocol (DES).
-X <P> privacy protocol pass phrase
General communication options
-p <P> use port P instead of the default port.
-T <LAYER> use LAYER for the network layer.
(UDP or TCP).
-t <T> set the request timeout to T.
-r <R> set the number of retries to R.
Debugging
-d dump input/output packets.
-D all | <TOKEN[,TOKEN,...]> turn on debugging output for the specified TOKENs.
General options
-m all | <MIBS> use MIBS list instead of the default mib list.
-M <MIBDIRS> use MIBDIRS as the location to look for mibs.
-P <MIBOPTS> Toggle various defaults controlling mib parsing:
MIBOPTS values:
u: allow the usage of underlines in mib symbols.
c: disallow the usage of "--" to terminate comments.
d: save the descriptions of the mib objects.
e: Disable mib errors of MIB symbols conflicts
w: Enable mib warnings of MIB symbols conflicts
W: Enable detailed warnings of MIB symbols conflicts
R: Replace MIB symbols from latest module
-O <OUTOPTS> Toggle various defaults controlling output display:
OUTOPTS values:
n: Print oids numerically.
e: Print enums numerically.
E: Escape quotes in string indices.
X: Extended index format
b: Dont break oid indexes down.
q: Quick print for easier parsing.
f: Print full oids on output.
s: Print only last symbolic element of oid.
S: Print MIB module-id plus last element.
t: Print timeticks unparsed as numeric integers.
v: Print Print values only (not OID = value).
T: Print human-readable text along with hex strings.
-I <INOPTS> Toggle various defaults controlling input parsing:
INOPTS values:
R: Do random access to oid labels.
r: Don't check values for range/type legality.
b: Do best/regex matching to find a MIB node.
-C <APPOPTS> Toggle various application specific behaviour:
APPOPTS values:
i: Send an snmp INFORM instead of an snmp TRAP.
-v 1 trap parameters:
enterprise-oid agent trap-type specific-type uptime [ var ]...
or
-v 2 trap parameters:
uptime trapoid [ var ] ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您参考下这个命令格式
sudo snmptrap -IR -v 2c -c public ubuntu-laptop.local '' netSnmp.99999 netSnmp.99999.1 s "Hello, World"
不需要,本机这么多年来,每天都有大量的snmp 消息发送到那台远程主机上,然后远程主机通过HP-OV显示出来.
远程主机不需要配置吗?
有高手能帮忙看看这个问题吗? 解决不了啊