web-dev-qa-db-ja.com

SNMPTTexecが機能しない

Nagios環境でSNMPTTを使用しています。私のMIBはすべてのイベントで機能しますが、1。何が起こっているのか理解できません。

トラップが発生したときに、ファイルを実行して、通知とNagiosアラートを処理するようにします。

MIBのセクションは次のとおりです。

EVENT lgpEventConditionEntryAdded .1.3.6.1.4.1.476.1.42.3.3.0.1 "Status Events" CRITICAL
FORMAT LIEBERT CUSTOM TRAP lgpEventConditionEntryAdded
EXEC /usr/lib64/nagios/plugins/pob_translate_liebert_trap.sh $r $s $2
SDESC
The device is reporting an alarm.
EDESC

私のpob_translate_liebert_trap.shファイルは、追加の電子メールデバッグを実行し、それをNagiosに送信します。ここで実際に見るものは何もありません。

トラップが.1.3.6.1.4.1.476.1.42.3.3.0.1と一致した場合のsnmptt.debugログの結果は次のとおりです。

Processing file: #snmptt-trap-1468519738245030
Reading trap.  Current time: Thu Jul 14 14:32:38 2016

Raw trap passed from snmptrapd:
1468519738
<UNKNOWN>
UDP: [10.redacted]:65534->[170.redacted]
.1.3.6.1.2.1.1.3.0 70:4:13:32.08
.1.3.6.1.6.3.1.1.4.1.0 .1.3.6.1.4.1.476.1.42.3.3.0.1
.1.3.6.1.4.1.476.1.42.3.2.3.1.1.12 12
.1.3.6.1.4.1.476.1.42.3.2.3.1.2.12 .1.3.6.1.4.1.476.1.42.3.2.1.19
.1.3.6.1.4.1.476.1.42.3.2.3.1.3.12 70:4:13:32.05
.1.3.6.1.6.3.18.1.3.0 10.redacted
.1.3.6.1.6.3.18.1.4.0 "public"
.1.3.6.1.6.3.1.1.4.3.0 .1.3.6.1.4.1.476.1.42.3.3

Items passed from snmptrapd:
value 0: 10.redacted
value 1: 10.redacted
value 2: .1.3.6.1.2.1.1.3.0
value 3: 70:4:13:32.08
value 4: .1.3.6.1.6.3.1.1.4.1.0
value 5: .1.3.6.1.4.1.476.1.42.3.3.0.1
value 6: .1.3.6.1.4.1.476.1.42.3.2.3.1.1.12
value 7: 12
value 8: .1.3.6.1.4.1.476.1.42.3.2.3.1.2.12
value 9: .1.3.6.1.4.1.476.1.42.3.2.1.19
value 10: .1.3.6.1.4.1.476.1.42.3.2.3.1.3.12
value 11: 70:4:13:32.05
value 12: .1.3.6.1.6.3.18.1.3.0
value 13: 10.redacted
value 14: .1.3.6.1.6.3.18.1.4.0
value 15: public
value 16: .1.3.6.1.6.3.1.1.4.3.0
value 17: .1.3.6.1.4.1.476.1.42.3.3
Host IP address (10.redacted) could not be resolved by DNS.  Variable $r / $R etc will use the IP address
Agent IP address (10.redacted) is the same as the Host IP, so copying the Host name: 10.redacted

Trap received from 10.redacted: .1.3.6.1.4.1.476.1.42.3.3.0.1
0:              hostname
1:              ip address
2:              uptime
3:              trapname / OID
4:              ip address from trap agent
5:              trap community string
6:              enterprise
7:              securityEngineID        (snmptthandler-embedded required)
8:              securityName            (snmptthandler-embedded required)
9:              contextEngineID         (snmptthandler-embedded required)
10:             contextName             (snmptthandler-embedded required)
0+:             passed variables

Value 0: 10.redacted
Value 1: 10.redacted
Value 2: 70:4:13:32.08
Value 3: .1.3.6.1.4.1.476.1.42.3.3.0.1
Value 4: 10.redacted
Value 5: public
Value 6: .1.3.6.1.4.1.476.1.42.3.3
Value 7:
Value 8:
Value 9:
Value 10:
Agent dns name: 10.redacted
Ent Value 0 ($1): .1.3.6.1.4.1.476.1.42.3.2.3.1.1.12=12
Ent Value 1 ($2): .1.3.6.1.4.1.476.1.42.3.2.3.1.2.12=.1.3.6.1.4.1.476.1.42.3.2.1.19
Ent Value 2 ($3): .1.3.6.1.4.1.476.1.42.3.2.3.1.3.12=70:4:13:32.05

Exact match of trap found in EVENT hash table

Working with EVENT entry: .1.3.6.1.4.1.476.1.42.3.3.0.1 => lgpEventConditionEntryAdded,Status Events,CRITICAL,
  No nodes defined for this entry so all nodes will match
  No MATCH entries defined for this entry

Trap defined, processing...


PREEXEC line(s):


FORMAT line:
Variable .1.3.6.1.4.1.476.1.42.3.2.3.1.3.12 with value 70:4:13:32.05
Variable .1.3.6.1.4.1.476.1.42.3.2.3.1.2.12 with value .1.3.6.1.4.1.476.1.42.3.2.1.19
Variable .1.3.6.1.4.1.476.1.42.3.2.3.1.1.12 with value 12
LIEBERT CUSTOM TRAP lgpEventConditionEntryAdded
.1.3.6.1.4.1.476.1.42.3.3.0.1 CRITICAL "Status Events" 10.redacted - LIEBERT CUSTOM TRAP lgpEventConditionEntryAdded

EXEC line(s):
Variable .1.3.6.1.4.1.476.1.42.3.2.3.1.3.12 with value 70:4:13:32.05
Variable .1.3.6.1.4.1.476.1.42.3.2.3.1.2.12 with value .1.3.6.1.4.1.476.1.42.3.2.1.19
Variable .1.3.6.1.4.1.476.1.42.3.2.3.1.1.12 with value 12
EXEC command:/usr/lib64/nagios/plugins/pob_translate_liebert_trap.sh 10.redacted CRITICAL .1.3.6.1.4.1.476.1.42.3.2.1.19

ここで、ユーザーsnmpttとしてログインし、次のコマンドを実行すると、/usr/lib64/nagios/plugins/pob_translate_liebert_trap.sh 10.redacted CRITICAL .1.3.6.1.4.1.476.1.42.3.2.1.19は正常に機能します。

Snmpttがスクリプトを変換するときに、このスクリプトが実行されていないことから何が壊れているのかについての洞察はありますか?それはそれのように見えますはず実行されています

2
Pat

私の場合、問題は「$ *」の1つにありました。これをパラメータリストから削除すると、すべて正常に機能します。

これはバグです。 trump | kidsのテキスト内の記号に依存します。

1
AlexSav