recieving SNMP traps

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: recieving SNMP traps

Post by benhank »

here we go:

Code: Select all

[root@LkennagiosT01 ~]#     snmptranslate -Dinit_mib .1.3 2>&1 |grep MIBDIR
init_mib: Seen MIBDIRS: Looking in '/root/.snmp/mibs:/usr/local/share/snmp/mibs' for mib dirs ...
[root@LkennagiosT01 ~]#
and then:

Code: Select all

[root@LkennagiosT01 mibs]# ls
cpq54nn.mib      cpqica.mib        cpqscsi.mib                hpipf02trap.mib
cpqagent.mib     cpqida.mib        cpqservice.mib             hpipftrap.mib
cpqapli.mib      cpqide.mib        cpqsinfo.mib               hp-mccluster.mib
cpqappg80.mib    cpqidrec.mib      cpqsm2.mib                 hpnetctz.mib
cpqclus.mib      cpqinfo.mib       cpqsrvmn.mib               hpn.mib
cpqcmc.mib       cpqiodrv.mib      cpqstat.mib                hpnr.mib
cpqcr.mib        cpql2mgt.mib      cpqstdeq.mib               hpov-nnm.mib
cpqdceeo.mib     cpqlinos.mib      cpqstsys.mib               hpovsam_im.mib
cpqdmii.mib      cpqn5226a.mib     cpqswcc.mib                hpovsam.mib
cpqdsccs.mib     cpqnic.mib        cpqthrsh.mib               hpprfmib.mib
cpqfca.mib       cpqnunif.mib      cpq-traps.mib              hpsgcluster.mib
cpqfix.mib       cpqpower.mib      cpqups.mib                 hpsvrmgmt-oid.mib
cpqgen.mib       cpqrack.mib       cpqwcrm.mib                hpswa.mib
cpqhlth.mib      cpqrecov.mib      cpqwinos.mib               hp-switch-pl.mib
cpqhostb.mib     cpqsanapp.mib     Gbe2 mib descriptions.txt  hpswitchpl.mib
cpqhost.mib      cpqsanevent.mib   GbE mib descriptions.txt   hptat.mib
cpqhsv110v3.mib  cpqSasSwitch.mib  hpeccmib.mib               hptrap.mib
[root@LkennagiosT01 mibs]#
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: recieving SNMP traps

Post by sreinhardt »

Which mibdir listing is that? Just want to confirm, as you do have both expected:
/root/.snmp/mibs
/usr/local/share/snmp/mibs
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: recieving SNMP traps

Post by benhank »

Here is what I have

Code: Select all

[root@LkennagiosT01 ~]# cd /root/.snmp/mibs
-bash: cd: /root/.snmp/mibs: No such file or directory
[root@LkennagiosT01 ~]# cd /root
[root@LkennagiosT01 ~]# cd .snmp/mibs
-bash: cd: .snmp/mibs: No such file or directory
[root@LkennagiosT01 ~]# ls
anaconda-ks.cfg  install.log  install.log.syslog  scripts(<--this is a directory)  snmpd.conf
[root@LkennagiosT01 ~]# cd /usr/local/share/snmp/mibs
[root@LkennagiosT01 mibs]# ls
cpq54nn.mib      cpqica.mib        cpqscsi.mib                hpipf02trap.mib
cpqagent.mib     cpqida.mib        cpqservice.mib             hpipftrap.mib
cpqapli.mib      cpqide.mib        cpqsinfo.mib               hp-mccluster.mib
cpqappg80.mib    cpqidrec.mib      cpqsm2.mib                 hpnetctz.mib
cpqclus.mib      cpqinfo.mib       cpqsrvmn.mib               hpn.mib
cpqcmc.mib       cpqiodrv.mib      cpqstat.mib                hpnr.mib
cpqcr.mib        cpql2mgt.mib      cpqstdeq.mib               hpov-nnm.mib
cpqdceeo.mib     cpqlinos.mib      cpqstsys.mib               hpovsam_im.mib
cpqdmii.mib      cpqn5226a.mib     cpqswcc.mib                hpovsam.mib
cpqdsccs.mib     cpqnic.mib        cpqthrsh.mib               hpprfmib.mib
cpqfca.mib       cpqnunif.mib      cpq-traps.mib              hpsgcluster.mib
cpqfix.mib       cpqpower.mib      cpqups.mib                 hpsvrmgmt-oid.mib
cpqgen.mib       cpqrack.mib       cpqwcrm.mib                hpswa.mib
cpqhlth.mib      cpqrecov.mib      cpqwinos.mib               hp-switch-pl.mib
cpqhostb.mib     cpqsanapp.mib     Gbe2 mib descriptions.txt  hpswitchpl.mib
cpqhost.mib      cpqsanevent.mib   GbE mib descriptions.txt   hptat.mib
cpqhsv110v3.mib  cpqSasSwitch.mib  hpeccmib.mib               hptrap.mib
[root@LkennagiosT01 mibs]#
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: recieving SNMP traps

Post by sreinhardt »

Prefect, in that case I'm going to suggest downloading that tar i uploaded before, and placing the files within, in your /usr/local/share/snmp/mibs directory. No need to overwrite things already there, but anything that is not there already should be added. Then you will want to change permissions and ownership like:
root.nagios 664

As a side note, my mibs are in /usr/share/snmp/mibs, do you also have these?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: recieving SNMP traps

Post by benhank »

Ok, the answer to the question is yes my snmp folder has those files.
Before we go any further, here is an update:
Just in case something is wrong on the server we have been working on, I installed snmp on a different server. i reasoned that if I get it working properly on a dif server, then I can follow the same steps and install it on my busted server. so from this point on the busted server has been kicked to the curb,(temporarily set aside)(btw I have never understood why my Afro American bros invented and use that phrase...it makes no dang sense...) and we will be proceeding with the new clean rig.

ok so on the new box I have done the following:
1. downloaded,un-tared snmptt_1.3.tar.sometin z into

Code: Select all

/usr/src/
then

Code: Select all

 
 1003  cd /usr/src/snmptt_1.3
 1004  ls
which returned:

Code: Select all

bin        README                      snmptt-eventlog.mc
BUGS       sample-trap                 snmptthandler
ChangeLog  sample-trap-daemon          snmptthandler-embedded
contrib    sample-unknown-trap         snmptt.ini
COPYING    sample-unknown-trap-daemon  snmptt.ini-nt
docs       snmptt                      snmptt-init.d
examples   snmpttconvert               snmptt.logrotate
INSTALL    snmpttconvertmib            snmptt-net-snmp-test
then:

Code: Select all

 1005  cp snmptt /usr/sbin/
 1006  cp snmptthandler /usr/sbin/
 1007  cp snmpttconvert /usr/bin/
 1008  cp snmptt-init.d /etc/init.d/snmptt
and:

Code: Select all

 1009  chkconfig --add snmptt
 1010  chkconfig --level 2345 snmptt on 
This was as per the install instructions that came with snmptt_1.3 Mike Weber's vid said
that it should be :

Code: Select all

chkconfig --level 35 snmptt on, 
I erred on the side of caution, and used the install doc's instructions
and moving along:

Code: Select all

 1011  mkdir /var/spool/snmptt/
 1012  useradd snmptt
 1013  mkdir /etc/snmp
 1014  cp snmptt.ini /etc/snmp
 1015  chown snmptt:snmptt /etc/snmp/snmptt.ini
 1016  /etc/rc.d/init.d/snmptt start
 1017  cp snmptt.conf /etc/snmp/

Code: Select all

 1019 /etc/rc.d/init.d/snmptt start 

This threw out "cant find this and that"errors so I:

Code: Select all

 yum install net-snmp-utils 
     yum install net-snmp-perl
      yum install net-snmp-libs
but they were already installed sooo:

Code: Select all

1024   cd /tmp
 1025  wget http://assets.nagios.com/downloads/nagiosxi/packages/snmptt-1.3-3.nagios.noarch.rpm
 1026  yum --nogpgcheck localinstall snmptt-1.3-3.nagios.noarch.rpm
and then boom!: (the good boom):

Code: Select all

[root@Lkennagiosp02 snmptt_1.3]# service snmpd restart
Stopping snmpd:                                            [  OK  ]
Starting snmpd:                                            [  OK  ]
[root@Lkennagiosp02 snmptt_1.3]# service snmptt restart
Stopping snmptt:                                           [  OK  ]
Starting snmptt:                                           [  OK  ]
[root@Lkennagiosp02 snmptt_1.3]# service snmptrapd restart
Stopping snmptrapd:                                        [  OK  ]
Starting snmptrapd:                                        [  OK  ]
[root@Lkennagiosp02 snmptt_1.3]#
I have two issues:
1. This log file works:

Code: Select all

[root@Lkennagiosp02 snmptt_1.3]# tail -f /var/log/snmptt/snmpttsystem.log
Tue Sep  3 12:30:45 2013 Finished loading 693 lines from /etc/snmp/snmptt.conf
Tue Sep  3 12:30:45 2013 Changing to UID: snmptt (501)
Tue Sep  3 12:35:23 2013 SNMPTT v1.3 started
Tue Sep  3 12:35:23 2013 Loading /etc/snmp/snmptt.conf
Tue Sep  3 12:35:23 2013 Finished loading 693 lines from /etc/snmp/snmptt.conf
Tue Sep  3 12:35:23 2013 Changing to UID: snmptt (501)
Tue Sep  3 13:35:22 2013 SNMPTT v1.3 started
Tue Sep  3 13:35:23 2013 Loading /etc/snmp/snmptt.conf
Tue Sep  3 13:35:23 2013 Finished loading 693 lines from /etc/snmp/snmptt.conf
Tue Sep  3 13:35:23 2013 Changing to UID: snmptt (501)
but these two bad boys don't:

Code: Select all

[root@Lkennagiosp02 snmptt_1.3]# tail -f /var/log/snmp/snmptt.log
tail: cannot open `/var/log/snmp/snmptt.log' for reading: No such file or directory
and 
tail -f /var/log/snmp/snmpttunknown.log
tail: cannot open `/var/log/snmp/snmpttunknown.log' for reading: No such file or directory
Do I manually add these files, or does this indicate that there is something else I need to install?

And next is the no holds barred royal rumble barbed wire cage match with : mofo mibs

As of right now I have not put your modified mibs in

Code: Select all

/usr/share/snmp/ 
folder.
I downloaded the mibs I need from the hp website. However, the mibs they give yah only have ".cfg" and ".mibs" files.
what do I do with em? I am only asking, because this is where it falls apart for me

OH! Lasty but not least, I changed standalone to daemon before I restarted the services.

Thanks for the patience and help so far man (yes I am trying to butter you up).
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: recieving SNMP traps

Post by sreinhardt »

well thats a full page read there, let me get another cup of coffee! :D

It seems that the install went good! Just to clarify since I didn't see it, did you modify snmptt.ini to be in daemon mode? As for logs, I don't believe you will see anything in there until traps have been recieved. At that point, if you have not added mibs they should be going into the unknown log.

As for adding mibs, simply add them to the mib directory then run "addmib /path/to/mib", restart snmp services, and all should be good!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: recieving SNMP traps

Post by benhank »

sreinhardt wrote:well thats a full page read there, let me get another cup of coffee! :D

It seems that the install went good! Just to clarify since I didn't see it, did you modify snmptt.ini to be in daemon mode? As for logs, I don't believe you will see anything in there until traps have been recieved. At that point, if you have not added mibs they should be going into the unknown log.

As for adding mibs, simply add them to the mib directory then run "addmib /path/to/mib", restart snmp services, and all should be good!
yes I changed to daemon =D

but please tell me I wont have to run addmib for all 50+ mibs
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: recieving SNMP traps

Post by sreinhardt »

Yep unfortunately you will. bash script it I suppose? But you do need to do them in the correct order as well, as some will undoubtedly have dependencies on others.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: recieving SNMP traps

Post by benhank »

ok then, time to role up the sleeves...and tell my boss this project iS not gonna work.... on to the next one tralalala.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Locked