Page 1 of 1

snmptt.conf reading

PostPosted: Thu Jan 10, 2019 11:55 pm
by floki
All right. So for example I got converted these MIB file to snmptt.conf.<device>
Code: Select all
#
#
#
#
MIB: IBM-SVC-MIB (file:/usr/share/snmp/mibs/SVC_MIB_7.8.1.MIB) converted on Thu Jan 10 17:03:18 2019 using snmpttconvertmib v1.4beta2
#
#
#
EVENT tsveETrap .1.3.6.1.4.1.2.6.190.1 "Status Events" Normal
FORMAT tsve error trap $*
SDESC
tsve error trap
Variables:
  1: tsveMACH
  2: tsveSERI
  3: tsveERRI
  4: tsveERRC
  5: tsveSWVE
  6: tsveFRUP
  7: tsveCLUS
  8: tsveNODE
  9: tsveERRS
  10: tsveTIME
  11: tsveOBJT
  12: tsveOBJI
  13: tsveADD1
  14: tsveADD2
  15: tsveCOPY
  16: tsveMPNO
  17: tsveOBJN
  18: tsveIDAL
EDESC
#
#
#
EVENT tsveWTrap .1.3.6.1.4.1.2.6.190.2 "Status Events" Normal
FORMAT tsve warning trap $*
SDESC
tsve warning trap
Variables:
  1: tsveMACH
  2: tsveSERI
  3: tsveERRI
  4: tsveERRC
  5: tsveSWVE
  6: tsveFRUP
  7: tsveCLUS
  8: tsveNODE
  9: tsveERRS
  10: tsveTIME
  11: tsveOBJT
  12: tsveOBJI
  13: tsveADD1
  14: tsveADD2
  15: tsveCOPY
  16: tsveMPNO
  17: tsveOBJN
  18: tsveIDAL
EDESC
#
#
#
EVENT tsveITrap .1.3.6.1.4.1.2.6.190.3 "Status Events" Normal
FORMAT tsve information trap $*
SDESC
tsve information trap
Variables:
  1: tsveMACH
  2: tsveSERI
  3: tsveERRI
  4: tsveERRC
  5: tsveSWVE
  6: tsveFRUP
  7: tsveCLUS
  8: tsveNODE
  9: tsveERRS
  10: tsveTIME
  11: tsveOBJT
  12: tsveOBJI
  13: tsveADD1
  14: tsveADD2
  15: tsveCOPY
  16: tsveMPNO
  17: tsveOBJN
  18: tsveIDAL
EDESC


Does that mean, I can only have three services configured with snmp trap to be monitored by nagios core?

Re: snmptt.conf reading

PostPosted: Fri Jan 11, 2019 3:53 pm
by cdienger
Only these three OIDs will be recognized. You can certainly add more if you want.

Re: snmptt.conf reading

PostPosted: Sat Jan 12, 2019 1:24 am
by floki
ohh so from what I understand. It means that the device can send out snmp trap that will not be recognized by snmptt because it's not included in the snmptt.conf.<device>? And the trap will be logged in to snmpttunknown log?

Re: snmptt.conf reading

PostPosted: Sat Jan 12, 2019 9:33 am
by floki
hmmm after I looked into the nagios core GUI, I realized that I can actually use each variables listed in snmptt.conf.<device> and show each variable as a trap value. Like for example I can do this:

Code: Select all
#
#
#
EVENT tsveITrap .1.3.6.1.4.1.2.6.190.3 "Status Events" Normal
FORMAT tsve information trap $*
EXEC /usr/local/nagios/lib/eventhandlers/submit_check_results $r "Serv_Definition" 0 "tsve information trap $1"
SDESC
tsve information trap
Variables:
  1: tsveMACH
  2: tsveSERI
  3: tsveERRI
  4: tsveERRC
  5: tsveSWVE
  6: tsveFRUP
  7: tsveCLUS
  8: tsveNODE
  9: tsveERRS
  10: tsveTIME
  11: tsveOBJT
  12: tsveOBJI
  13: tsveADD1
  14: tsveADD2
  15: tsveCOPY
  16: tsveMPNO
  17: tsveOBJN
  18: tsveIDAL
EDESC


And then Create another trap
Code: Select all
#
#
#
EVENT tsveITrap .1.3.6.1.4.1.2.6.190.3 "Status Events" Normal
FORMAT tsve information trap $*
EXEC /usr/local/nagios/lib/eventhandlers/submit_check_results $r "Serv_Definition" 0 "tsve information trap $2"
SDESC
tsve information trap
Variables:
  1: tsveMACH
  2: tsveSERI
  3: tsveERRI
  4: tsveERRC
  5: tsveSWVE
  6: tsveFRUP
  7: tsveCLUS
  8: tsveNODE
  9: tsveERRS
  10: tsveTIME
  11: tsveOBJT
  12: tsveOBJI
  13: tsveADD1
  14: tsveADD2
  15: tsveCOPY
  16: tsveMPNO
  17: tsveOBJN
  18: tsveIDAL
EDESC

Re: snmptt.conf reading

PostPosted: Mon Jan 14, 2019 5:23 pm
by cdienger
Be aware that all this would do is change the parameters that are passed to the submit_check_results script. If you wanted more control over when the script is executed based on what the variables hold then there is the MATCH config option.