It says specifically not to do that in the file, you sure?
### AUTO-GENERATED BY NXTI. DO NOT HAND-EDIT THIS FILE. ###
-
SNMPTT v1.4beta2
(c) 2002-2007 Alex Burger
http://snmptt.sourceforge.net
SNMP using PREEXEC
Re: SNMP using PREEXEC
Never mind about changing the order of the EXEC and the PREEXEC lines, further tested shown it did not matter.
I think it could be a setting in the /etc/snmp/snmptt.ini file that is stopping the translation of the Community String in the Trap so can you upload your /etc/snmp/snmptt.ini file here?
Also, run this command and post the output here so we can see if the required MIB files are on the system for translations.
I think it could be a setting in the /etc/snmp/snmptt.ini file that is stopping the translation of the Community String in the Trap so can you upload your /etc/snmp/snmptt.ini file here?
Also, run this command and post the output here so we can see if the required MIB files are on the system for translations.
Code: Select all
ls -l /usr/share/snmp/mibsBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: SNMP using PREEXEC
File uploaded.
-
MIB it is hitting is IF-MIB
-
ls -l /usr/share/snmp/mibs
total 2456
-rw-rw-r-- 1 root nagios 17455 Mar 22 2017 AGENTX-MIB.txt
-rw-rw-r-- 1 apache nagios 37659 Sep 10 23:11 BGP4-MIB.my
-rw-rw-r-- 1 root nagios 50948 Mar 22 2017 BRIDGE-MIB.txt
-rw-rw-r-- 1 apache nagios 6437 Aug 29 12:59 CISCO-ACCESS-ENVMON-MIB.my
-rw-rw-r-- 1 apache nagios 80063 Sep 6 16:38 CISCO-BGP4-MIB.my
-rw-rw-r-- 1 apache nagios 50451 Aug 29 11:30 CISCO-EIGRP-MIB.my
-rw-rw-r-- 1 apache nagios 36418 Aug 29 12:59 CISCO-ENVMON-MIB.my
-rw-rw-r-- 1 apache nagios 32918 Aug 29 12:02 CISCO-ERR-DISABLE-MIB.my
-rw-rw-r-- 1 apache nagios 24940 Sep 13 19:07 CISCO-PORT-STORM-CONTROL-MIB.my
-rw-rw-r-- 1 apache nagios 48003 Aug 29 12:23 CISCO-PRIVATE-VLAN-MIB.my
-rw-rw-r-- 1 apache nagios 16811 Aug 29 12:22 CISCO-SMI.my
-rw-rw-r-- 1 apache nagios 102922 Aug 29 12:22 CISCO-TC.my
-rw-rw-r-- 1 apache nagios 225618 Aug 29 12:23 CISCO-VTP-MIB.my
-rw-rw-r-- 1 root nagios 68104 Mar 22 2017 DISMAN-EVENT-MIB.txt
-rw-rw-r-- 1 root nagios 24613 Mar 22 2017 DISMAN-SCHEDULE-MIB.txt
-rw-rw-r-- 1 root nagios 64311 Mar 22 2017 DISMAN-SCRIPT-MIB.txt
-rw-rw-r-- 1 root nagios 84492 Mar 22 2017 EtherLike-MIB.txt
-rw-rw-r-- 1 root nagios 4660 Mar 22 2017 HCNUM-TC.txt
-rw-rw-r-- 1 root nagios 52544 Mar 22 2017 HOST-RESOURCES-MIB.txt
-rw-rw-r-- 1 root nagios 10583 Mar 22 2017 HOST-RESOURCES-TYPES.txt
-rw-rw-r-- 1 root nagios 4819 Mar 22 2017 IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt
-rw-rw-r-- 1 root nagios 29665 Mar 22 2017 IANAifType-MIB.txt
-rw-rw-r-- 1 root nagios 5066 Mar 22 2017 IF-INVERTED-STACK-MIB.txt
-rw-rw-r-- 1 root nagios 71691 Mar 22 2017 IF-MIB.txt
-rw-rw-r-- 1 root nagios 16782 Mar 22 2017 INET-ADDRESS-MIB.txt
-rw-rw-r-- 1 root nagios 46286 Mar 22 2017 IP-FORWARD-MIB.txt
-rw-rw-r-- 1 root nagios 185667 Mar 22 2017 IP-MIB.txt
-rw-rw-r-- 1 root nagios 15936 Mar 22 2017 IPV6-ICMP-MIB.txt
-rw-rw-r-- 1 root nagios 48703 Mar 22 2017 IPV6-MIB.txt
-rw-rw-r-- 1 root nagios 7257 Mar 22 2017 IPV6-TCP-MIB.txt
-rw-rw-r-- 1 root nagios 2367 Mar 22 2017 IPV6-TC.txt
-rw-rw-r-- 1 root nagios 4400 Mar 22 2017 IPV6-UDP-MIB.txt
-rw-rw-r-- 1 root nagios 5931 Mar 22 2017 LM-SENSORS-MIB.txt
-rw-rw-r-- 1 root nagios 42375 Mar 22 2017 MTA-MIB.txt
-rwxrwx--- 1 root nagios 19760 Aug 29 16:11 NAGIOS-NOTIFY-MIB.txt
-rwxrwx--- 1 root nagios 2093 Aug 29 16:11 NAGIOS-ROOT-MIB.txt
-rw-rw-r-- 1 root nagios 15901 Mar 22 2017 NET-SNMP-AGENT-MIB.txt
-rw-rw-r-- 1 root nagios 9160 Mar 22 2017 NET-SNMP-EXAMPLES-MIB.txt
-rw-rw-r-- 1 root nagios 9198 Mar 22 2017 NET-SNMP-EXTEND-MIB.txt
-rw-rw-r-- 1 root nagios 2036 Mar 22 2017 NET-SNMP-MIB.txt
-rw-rw-r-- 1 root nagios 3350 Mar 22 2017 NET-SNMP-PASS-MIB.txt
-rw-rw-r-- 1 root nagios 4686 Mar 22 2017 NET-SNMP-TC.txt
-rw-rw-r-- 1 root nagios 5039 Mar 22 2017 NET-SNMP-VACM-MIB.txt
-rw-rw-r-- 1 root nagios 21006 Mar 22 2017 NETWORK-SERVICES-MIB.txt
-rw-rw-r-- 1 root nagios 24694 Mar 22 2017 NOTIFICATION-LOG-MIB.txt
-rw-rw-r-- 1 root nagios 3067 Mar 22 2017 RFC1155-SMI.txt
-rw-rw-r-- 1 root nagios 79667 Mar 22 2017 RFC1213-MIB.txt
-rw-rw-r-- 1 root nagios 147822 Mar 22 2017 RMON-MIB.txt
-rw-rw-r-- 1 root nagios 45323 Mar 22 2017 SCTP-MIB.txt
-rw-rw-r-- 1 root nagios 4649 Mar 22 2017 SMUX-MIB.txt
-rw-rw-r-- 1 root nagios 15490 Mar 22 2017 SNMP-COMMUNITY-MIB.txt
-rw-rw-r-- 1 root nagios 22342 Mar 22 2017 SNMP-FRAMEWORK-MIB.txt
-rw-rw-r-- 1 root nagios 5496 Mar 22 2017 SNMP-MPD-MIB.txt
-rw-rw-r-- 1 root nagios 20014 Mar 22 2017 SNMP-NOTIFICATION-MIB.txt
-rw-rw-r-- 1 root nagios 9106 Mar 22 2017 SNMP-PROXY-MIB.txt
-rw-rw-r-- 1 root nagios 22769 Mar 22 2017 SNMP-TARGET-MIB.txt
-rw-rw-r-- 1 root nagios 39201 Mar 22 2017 SNMP-USER-BASED-SM-MIB.txt
-rw-rw-r-- 1 root nagios 2205 Mar 22 2017 SNMP-USM-AES-MIB.txt
-rw-rw-r-- 1 root nagios 21101 Mar 22 2017 SNMP-USM-DH-OBJECTS-MIB.txt
-rw-rw-r-- 1 root nagios 8263 Mar 22 2017 SNMPv2-CONF.txt
-rw-rw-r-- 1 root nagios 29305 Mar 22 2017 SNMPv2-MIB.txt
-rw-rw-r-- 1 root nagios 8924 Mar 22 2017 SNMPv2-SMI.txt
-rw-rw-r-- 1 root nagios 38034 Mar 22 2017 SNMPv2-TC.txt
-rw-rw-r-- 1 apache nagios 33259 Aug 29 12:45 SNMPv2-TC-v1.txt
-rw-rw-r-- 1 root nagios 5775 Mar 22 2017 SNMPv2-TM.txt
-rw-rw-r-- 1 root nagios 28564 Mar 22 2017 TCP-MIB.txt
-rw-rw-r-- 1 root nagios 16418 Mar 22 2017 TRANSPORT-ADDRESS-MIB.txt
-rw-rw-r-- 1 root nagios 2163 Mar 22 2017 UCD-DEMO-MIB.txt
-rw-rw-r-- 1 root nagios 4402 Mar 22 2017 UCD-DISKIO-MIB.txt
-rw-rw-r-- 1 root nagios 3010 Mar 22 2017 UCD-DLMOD-MIB.txt
-rw-rw-r-- 1 root nagios 8118 Mar 22 2017 UCD-IPFWACC-MIB.txt
-rw-rw-r-- 1 root nagios 46150 Mar 22 2017 UCD-SNMP-MIB.txt
-rw-rw-r-- 1 root nagios 20882 Mar 22 2017 UDP-MIB.txt
-
MIB it is hitting is IF-MIB
-
ls -l /usr/share/snmp/mibs
total 2456
-rw-rw-r-- 1 root nagios 17455 Mar 22 2017 AGENTX-MIB.txt
-rw-rw-r-- 1 apache nagios 37659 Sep 10 23:11 BGP4-MIB.my
-rw-rw-r-- 1 root nagios 50948 Mar 22 2017 BRIDGE-MIB.txt
-rw-rw-r-- 1 apache nagios 6437 Aug 29 12:59 CISCO-ACCESS-ENVMON-MIB.my
-rw-rw-r-- 1 apache nagios 80063 Sep 6 16:38 CISCO-BGP4-MIB.my
-rw-rw-r-- 1 apache nagios 50451 Aug 29 11:30 CISCO-EIGRP-MIB.my
-rw-rw-r-- 1 apache nagios 36418 Aug 29 12:59 CISCO-ENVMON-MIB.my
-rw-rw-r-- 1 apache nagios 32918 Aug 29 12:02 CISCO-ERR-DISABLE-MIB.my
-rw-rw-r-- 1 apache nagios 24940 Sep 13 19:07 CISCO-PORT-STORM-CONTROL-MIB.my
-rw-rw-r-- 1 apache nagios 48003 Aug 29 12:23 CISCO-PRIVATE-VLAN-MIB.my
-rw-rw-r-- 1 apache nagios 16811 Aug 29 12:22 CISCO-SMI.my
-rw-rw-r-- 1 apache nagios 102922 Aug 29 12:22 CISCO-TC.my
-rw-rw-r-- 1 apache nagios 225618 Aug 29 12:23 CISCO-VTP-MIB.my
-rw-rw-r-- 1 root nagios 68104 Mar 22 2017 DISMAN-EVENT-MIB.txt
-rw-rw-r-- 1 root nagios 24613 Mar 22 2017 DISMAN-SCHEDULE-MIB.txt
-rw-rw-r-- 1 root nagios 64311 Mar 22 2017 DISMAN-SCRIPT-MIB.txt
-rw-rw-r-- 1 root nagios 84492 Mar 22 2017 EtherLike-MIB.txt
-rw-rw-r-- 1 root nagios 4660 Mar 22 2017 HCNUM-TC.txt
-rw-rw-r-- 1 root nagios 52544 Mar 22 2017 HOST-RESOURCES-MIB.txt
-rw-rw-r-- 1 root nagios 10583 Mar 22 2017 HOST-RESOURCES-TYPES.txt
-rw-rw-r-- 1 root nagios 4819 Mar 22 2017 IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt
-rw-rw-r-- 1 root nagios 29665 Mar 22 2017 IANAifType-MIB.txt
-rw-rw-r-- 1 root nagios 5066 Mar 22 2017 IF-INVERTED-STACK-MIB.txt
-rw-rw-r-- 1 root nagios 71691 Mar 22 2017 IF-MIB.txt
-rw-rw-r-- 1 root nagios 16782 Mar 22 2017 INET-ADDRESS-MIB.txt
-rw-rw-r-- 1 root nagios 46286 Mar 22 2017 IP-FORWARD-MIB.txt
-rw-rw-r-- 1 root nagios 185667 Mar 22 2017 IP-MIB.txt
-rw-rw-r-- 1 root nagios 15936 Mar 22 2017 IPV6-ICMP-MIB.txt
-rw-rw-r-- 1 root nagios 48703 Mar 22 2017 IPV6-MIB.txt
-rw-rw-r-- 1 root nagios 7257 Mar 22 2017 IPV6-TCP-MIB.txt
-rw-rw-r-- 1 root nagios 2367 Mar 22 2017 IPV6-TC.txt
-rw-rw-r-- 1 root nagios 4400 Mar 22 2017 IPV6-UDP-MIB.txt
-rw-rw-r-- 1 root nagios 5931 Mar 22 2017 LM-SENSORS-MIB.txt
-rw-rw-r-- 1 root nagios 42375 Mar 22 2017 MTA-MIB.txt
-rwxrwx--- 1 root nagios 19760 Aug 29 16:11 NAGIOS-NOTIFY-MIB.txt
-rwxrwx--- 1 root nagios 2093 Aug 29 16:11 NAGIOS-ROOT-MIB.txt
-rw-rw-r-- 1 root nagios 15901 Mar 22 2017 NET-SNMP-AGENT-MIB.txt
-rw-rw-r-- 1 root nagios 9160 Mar 22 2017 NET-SNMP-EXAMPLES-MIB.txt
-rw-rw-r-- 1 root nagios 9198 Mar 22 2017 NET-SNMP-EXTEND-MIB.txt
-rw-rw-r-- 1 root nagios 2036 Mar 22 2017 NET-SNMP-MIB.txt
-rw-rw-r-- 1 root nagios 3350 Mar 22 2017 NET-SNMP-PASS-MIB.txt
-rw-rw-r-- 1 root nagios 4686 Mar 22 2017 NET-SNMP-TC.txt
-rw-rw-r-- 1 root nagios 5039 Mar 22 2017 NET-SNMP-VACM-MIB.txt
-rw-rw-r-- 1 root nagios 21006 Mar 22 2017 NETWORK-SERVICES-MIB.txt
-rw-rw-r-- 1 root nagios 24694 Mar 22 2017 NOTIFICATION-LOG-MIB.txt
-rw-rw-r-- 1 root nagios 3067 Mar 22 2017 RFC1155-SMI.txt
-rw-rw-r-- 1 root nagios 79667 Mar 22 2017 RFC1213-MIB.txt
-rw-rw-r-- 1 root nagios 147822 Mar 22 2017 RMON-MIB.txt
-rw-rw-r-- 1 root nagios 45323 Mar 22 2017 SCTP-MIB.txt
-rw-rw-r-- 1 root nagios 4649 Mar 22 2017 SMUX-MIB.txt
-rw-rw-r-- 1 root nagios 15490 Mar 22 2017 SNMP-COMMUNITY-MIB.txt
-rw-rw-r-- 1 root nagios 22342 Mar 22 2017 SNMP-FRAMEWORK-MIB.txt
-rw-rw-r-- 1 root nagios 5496 Mar 22 2017 SNMP-MPD-MIB.txt
-rw-rw-r-- 1 root nagios 20014 Mar 22 2017 SNMP-NOTIFICATION-MIB.txt
-rw-rw-r-- 1 root nagios 9106 Mar 22 2017 SNMP-PROXY-MIB.txt
-rw-rw-r-- 1 root nagios 22769 Mar 22 2017 SNMP-TARGET-MIB.txt
-rw-rw-r-- 1 root nagios 39201 Mar 22 2017 SNMP-USER-BASED-SM-MIB.txt
-rw-rw-r-- 1 root nagios 2205 Mar 22 2017 SNMP-USM-AES-MIB.txt
-rw-rw-r-- 1 root nagios 21101 Mar 22 2017 SNMP-USM-DH-OBJECTS-MIB.txt
-rw-rw-r-- 1 root nagios 8263 Mar 22 2017 SNMPv2-CONF.txt
-rw-rw-r-- 1 root nagios 29305 Mar 22 2017 SNMPv2-MIB.txt
-rw-rw-r-- 1 root nagios 8924 Mar 22 2017 SNMPv2-SMI.txt
-rw-rw-r-- 1 root nagios 38034 Mar 22 2017 SNMPv2-TC.txt
-rw-rw-r-- 1 apache nagios 33259 Aug 29 12:45 SNMPv2-TC-v1.txt
-rw-rw-r-- 1 root nagios 5775 Mar 22 2017 SNMPv2-TM.txt
-rw-rw-r-- 1 root nagios 28564 Mar 22 2017 TCP-MIB.txt
-rw-rw-r-- 1 root nagios 16418 Mar 22 2017 TRANSPORT-ADDRESS-MIB.txt
-rw-rw-r-- 1 root nagios 2163 Mar 22 2017 UCD-DEMO-MIB.txt
-rw-rw-r-- 1 root nagios 4402 Mar 22 2017 UCD-DISKIO-MIB.txt
-rw-rw-r-- 1 root nagios 3010 Mar 22 2017 UCD-DLMOD-MIB.txt
-rw-rw-r-- 1 root nagios 8118 Mar 22 2017 UCD-IPFWACC-MIB.txt
-rw-rw-r-- 1 root nagios 46150 Mar 22 2017 UCD-SNMP-MIB.txt
-rw-rw-r-- 1 root nagios 20882 Mar 22 2017 UDP-MIB.txt
You do not have the required permissions to view the files attached to this post.
Re: SNMP using PREEXEC
One question I should of asked earlier, are there ant special characters in the Community string and what are they?
I may have figured out the issue. In my tests, I was sending the traps using version 1 of SNMP and it worked just fine as sending a Trap using SNMP Version 1, sends the community string in the trap by default.
But, when I tested it by sending the Trap using SNMP Version 2, it failed as the community string is not sent in the trap by default.
When I added sending of the Community String to my SNMP Version 2 command, it worked.
So, whatever script or device you are sending the Traps to the Nagios server, make sure it is sending the community string in the trap so it can be decoded by snmptt and used in the PREEXEC command.
I may have figured out the issue. In my tests, I was sending the traps using version 1 of SNMP and it worked just fine as sending a Trap using SNMP Version 1, sends the community string in the trap by default.
But, when I tested it by sending the Trap using SNMP Version 2, it failed as the community string is not sent in the trap by default.
When I added sending of the Community String to my SNMP Version 2 command, it worked.
So, whatever script or device you are sending the Traps to the Nagios server, make sure it is sending the community string in the trap so it can be decoded by snmptt and used in the PREEXEC command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: SNMP using PREEXEC
No, no special characters. Ah ha, so we're probably not even getting the community string from the device using 2c. I'll see if I can replicate that using version 1 and report back.
Re: SNMP using PREEXEC
Yep, that was the ticket. We weren't receiving the community using the $C variable in version 2c since it was never even sent. Thank you.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: SNMP using PREEXEC
Great!setec wrote:Yep, that was the ticket. We weren't receiving the community using the $C variable in version 2c since it was never even sent. Thank you.
Gland to hear it is resolved!
Locking thread