Ad Widget

Collapse

SNMP Trap and multiple payload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • melpheos
    Member
    • Dec 2008
    • 64

    #1

    SNMP Trap and multiple payload

    First post so hello everyone and thanks in advance for the help if i dont kill someone or myself tomorrow

    I'm trying to get alert trap from Vmware infrastructure center using the snmptrap.sh script that everyone knows.

    My problem is that the script is done for one payload and i'm totally clueless about what to do to receive the information for the other payloads.

    My trap has 6 payload and i need 2 or 3 of them (the host and the alarm)

    In the SH script, if i had "read payload" multiple time, the trap received by Zabbix is the last read payload (for example, if i write 5 time "read payload" i will have the 5th payload but not the 4 others)

    Echoing the exact same command gives me the full trap (unfiltered information with all OID, all 6 payloads and other useless information)

    My guess is that i must edit the SH script but my knowledge is quite limited in this domain so if anyone know what to do, it will be a big help.

    edit : was just thinking of something. Would it be right to put something like this

    read payload
    payload=`echo $payload1`
    read payload
    payload2=`echo $payload2`
    str="HOST=$hostname TRAP OID=$trapoid PAYLOAD=$payload1 PAYLOAD=&payload2"

    The syntax if for sure incorrect as i'm a total noob in term of shell programmation but...
    Last edited by melpheos; 14-01-2009, 13:04.
  • melpheos
    Member
    • Dec 2008
    • 64

    #2
    With the perl script removing this part
    Code:
        if ($onlyinteresting) {
     
            # Filter out uninteresting trap informations
     
    	if (($oid !~ /sysuptimeinstance/i) && 
    	    ($oid !~ /snmpv2-smi/i) && 
    	    ($oid !~ /snmptrapoid/i) &&
    	    ($oid !~ /snmptrapcommunity/i) 
    	    ) {
     
    		next;
     
    	}
     
        }
    i do not get neither the information i need

    This is trap sent by our Vmware infrastructure server

    Code:
    2009-01-14 15:07:04 hiddenforsecurityreason [10.*.*.*] (via UDP: [10.*.*.*]:2583) TRAP, SNMP v1, community samereasons
            SNMPv2-SMI::enterprises.6876.4.3 Enterprise Specific Trap (201) Uptime: 42 days, 0:03:56.82
            SNMPv2-SMI::enterprises.6876.4.3.301 = STRING: "vm"     SNMPv2-SMI::enterprises.6876.4.3.302 = STRING: "10.*.*.*"   SNMPv2-SMI::enterprises.6876.4.3.303 = STRING: "VM EBA"      SNMPv2-SMI::enterprises.6876.4.3.304 = STRING: "Gray"   SNMPv2-SMI::enterprises.6876.4.3.305 = STRING: "Red"    SNMPv2-SMI::enterprises.6876.4.3.306 = STRING: "New Alarm - (State = Powered Off)"
    What i get in zabbix is
    Code:
    (hiddenforsecurityreason, 10.*.*.*) DISMAN-EVENT-MIB::sysUpTimeInstance: 42:0:03:56.82
    What i would like to have is
    Code:
     Host VM EBA 
    New Alarm - (State = Powered Off)
    Any advise will be warmly welcomed
    Last edited by melpheos; 14-01-2009, 17:26.

    Comment

    • melpheos
      Member
      • Dec 2008
      • 64

      #3
      Progressing, now i have allmost all the trap but i'm limited to 255 char so i must find a way to filter what i dont need...

      Comment

      • melpheos
        Member
        • Dec 2008
        • 64

        #4
        Change to SNMPTT but this time all my traps goes to unknown trap Rhaaa this is really getting on my nerves (despite i can resolve the OID in the trap using a snmptranslate)

        Comment

        • melpheos
          Member
          • Dec 2008
          • 64

          #5
          Quit using those traps, it's just too horrible to set up...

          I have activated snmp on our ESX server (luckily it's ESX and not ESXi which does not support snmp get )

          Running a snmpwalk and trying to find what OID give's me the information i need.

          Comment

          • melpheos
            Member
            • Dec 2008
            • 64

            #6
            OK great, i have just discovered doing two consecutive snmpwalk that ESX use a dynamic OID assigment for various value.

            For instance, if you have 2 machines running on it with let say values
            1.1.1.1.1.1 555
            1.1.1.1.1.2 777

            If the first machine is stopped you will have only
            1.1.1.1.1.1 777

            Great job EMC, part of your OIDs are totally useless

            Comment

            • melpheos
              Member
              • Dec 2008
              • 64

              #7
              Whooooooooooo !!!!

              I finally got SNMPTT to work and send the information i need to the proper host using the right EXEC...

              One thing to note, VMWARETRAPS mibs information are not properly handle by snmpttconvertmib and i had to manualy edit the resulting conf file because the OID received in the trap and the OID in the conf file was different.

              I had to enable the debug option in snmptt.ini to see that and finaly have everything working.

              Comment

              • allrise
                Junior Member
                • Mar 2009
                • 18

                #8
                hi melpheos,

                I wanted to know how u setup your snmp text translator.. i am trying configure it but dont know how to it.. its bit urgent

                Comment

                • allrise
                  Junior Member
                  • Mar 2009
                  • 18

                  #9
                  i am referring this site http://www.brentrjones.com/?p=13 for configuring snmptt.. but i am struck on last step where we have to configure zabbix_sender.. i wanted to know exactly in which file zabbix_sender command has to be placed..

                  Comment

                  • melpheos
                    Member
                    • Dec 2008
                    • 64

                    #10
                    Originally posted by allrise
                    i am referring this site http://www.brentrjones.com/?p=13 for configuring snmptt.. but i am struck on last step where we have to configure zabbix_sender.. i wanted to know exactly in which file zabbix_sender command has to be placed..
                    Hi, you have to put the zabbix_sender command in the snmptt.conf.x file at the very end (in Brent Jones example it is snmptt.conf.dell)

                    Comment

                    • allrise
                      Junior Member
                      • Mar 2009
                      • 18

                      #11
                      Originally posted by melpheos
                      Hi, you have to put the zabbix_sender command in the snmptt.conf.x file at the very end (in Brent Jones example it is snmptt.conf.dell)
                      hi!, even i tried to put command in smptt.conf (in Brent Jones example it is snmptt.conf.dell) but i dont see traps on zabbix UI.. could u share ur smptt.conf.x file with me.. if its fine with u..

                      Comment

                      • allrise
                        Junior Member
                        • Mar 2009
                        • 18

                        #12
                        hi! one more thing i wanted to know in order to run snmptt.conf.dell do we have to configure some setting in snmptt.ini file also..
                        Last edited by allrise; 06-04-2009, 09:50.

                        Comment

                        • melpheos
                          Member
                          • Dec 2008
                          • 64

                          #13
                          Originally posted by allrise
                          hi! one more thing i wanted to know in order to run snmptt.conf.dell do we have to configure some setting in snmptt.ini file also..
                          I used the settings provided on Brent Jones sites.

                          The best thing is to put the debug mode on and see the content. Also put the log unkown trap as well.

                          The debug mode set to 3 should give you the information you need.

                          Comment

                          • allrise
                            Junior Member
                            • Mar 2009
                            • 18

                            #14
                            Originally posted by melpheos
                            I used the settings provided on Brent Jones sites.

                            The best thing is to put the debug mode on and see the content. Also put the log unkown trap as well.

                            The debug mode set to 3 should give you the information you need.
                            hi!! thanks for info.. i am able to see snmptraps info in my log files.. but these information is not getting display on zabbix UI... in snmptt.ini file in the end trapfiles are mentioned

                            [TrapFiles]
                            # A list of snmptt.conf files (this is NOT the snmptrapd.conf file). The COMPLETE path
                            # and filename. Ex: '/etc/snmp/snmptt.conf'
                            snmptt_conf_files = <<END
                            /etc/snmp/snmptt.conf
                            END

                            What exactly above command meant?? could u explain..

                            Comment

                            • melpheos
                              Member
                              • Dec 2008
                              • 64

                              #15
                              Originally posted by allrise
                              hi!! thanks for info.. i am able to see snmptraps info in my log files.. but these information is not getting display on zabbix UI... in snmptt.ini file in the end trapfiles are mentioned

                              [TrapFiles]
                              # A list of snmptt.conf files (this is NOT the snmptrapd.conf file). The COMPLETE path
                              # and filename. Ex: '/etc/snmp/snmptt.conf'
                              snmptt_conf_files = <<END
                              /etc/snmp/snmptt.conf
                              END

                              What exactly above command meant?? could u explain..
                              I think this was written on the Brent Jones website. Anyway, if you haven't done so you have to put here the path of your snmptt.conf.x file you have converted with snmpttconvert.

                              You should also check the snmptrapd log file on your zabbix server to see what reaches the server (need to enable logging on snmptrapd.conf file

                              Comment

                              Working...