簡単な質問があります。これはユーザー エラーである可能性が最も高いため、開始する前に謝罪します。
デバイスのしきい値を設定して、プリンターの 1 つが特定の状態になったときにアラートが送信されるようにしようとしています。(紙詰まり、トナー切れ、紙切れなど) これを処理する特定の oid を見つけました。(1.3.6.1.2.1.25.3.5.1.2.1) 特定の oid は、HOST-RESOURCE-MIB の下で hrPrinterDetectedErrorState と呼ばれます。SNMPWALK経由でoidが見えることを確認しました。私の問題は、吐き出すデータを解釈することです。MIB で読み取っているものと、SNMPWALK を介して表示しているものは異なります。
MIB からの oid の説明は次のとおりです。
"This object represents any error conditions detected
by the printer. The error conditions are encoded as
bits in an octet string, with the following
definitions:
Condition Bit #
lowPaper 0
noPaper 1
lowToner 2
noToner 3
doorOpen 4
jammed 5
offline 6
serviceRequested 7
inputTrayMissing 8
outputTrayMissing 9
markerSupplyMissing 10
outputNearFull 11
outputFull 12
inputTrayEmpty 13
overduePreventMaint 14
Bits are numbered starting with the most significant
bit of the first byte being bit 0, the least
significant bit of the first byte being bit 7, the
most significant bit of the second byte being bit 8,
and so on. A one bit encodes that the condition was
detected, while a zero bit encodes that the condition
was not detected.
This object is useful for alerting an operator to
specific warning or error conditions that may occur,
especially those requiring human intervention."
奇妙な部分は、SNMPWALK は oid が 16 進文字列であると言いますが、MIB はそれが 8 重文字列であるべきだと指定していることです。両者は違うのですか?SNMPWALK によって出力されるデータを変換して、MIB の内容と一致させる必要がありますか?
すべてをテストするために、プリンターをいくつかの異なる「状態」にしました。次に、デバイスで SNMPWALK を実行して、oid の出力を確認しました。これが結果です。ご覧のとおり、これらの結果は MIB の指定と一致しません。
Case 1: Opened the toner door
Expected Output based on MIB: 4
SNMP Output: 08
Case 2: Removed Toner & Closed the door
Expected Output based on MIB: 1
SNMP Output: 10
Case 3: Placed 1 sheet of paper and printed a 2 page document. The printer ran out of paper.
Expected Output based on MIB: 0 or 1
SNMP Output: @
私は出力で混乱しています。oid の読み取り方法を知っていれば、たとえば 08 を検出したときに特定のアクションを実行するようにしきい値を設定できます。
ご協力いただきありがとうございます!