[hobbit] Hobbit, Net-snmp snmptrap,and HPOV
There is an option to snmptrap (from net snmp) to send full OIDs, otherwise they are cut. Instead of "snmptrap -v 1", the options should be : "snmptrap -v 1 -Of"
Otherwise only the end of the OID is sent.
Nicolas Figaro
-----Message d'origine----- De : David Gore [mailto:David.Gore at mci.com] Envoyé : lundi 19 septembre 2005 17:11 À : hobbit at hswn.dk Objet : Re: [hobbit] Hobbit, Net-snmp snmptrap,and HPOV
David Gore wrote:
Coupe, Mark (ITD) wrote:
All,
I'm trying to push alarms from Hobbit to HPOV. We have a custom script that is invoking Netsnmp's snmptrap. The snmp traps are reaching the HP Node Manager Event Browser correctly.
However, the OV operations trap condition is not recognizing the trap.
The trap is being displayed as "unmatched" in the Message Browser even though there is a condition set up for that specific trap.When we look at the unmatched trap, it appears that the OID is not being recognized and an '0' is inserted, for example instead of .1.3.6.1.4.1.7058.0.XX, we are seeing .0.0.XX.
Any guidance would be greatly appreaciated.
Thanks,
-Mark Coupe
I, and perhaps others would be interested in what precisely you are doing? Are you pushing all hobbit alarms from the hobbit server to HPOV?
Sorry, I am HPOV ignorant, but we are interested in forwarding all the hobbit alarms/alerts as SNMP traps to one of Concord's products. I am not to familiar with Concord's product either. I just know the powers that be would like to have snmp traps from all our monitored hosts.
In otherwords, I am interested in any system or methodology that someone has setup to forward alarms from the hobbit server to an SNMP server. Any setups out there that someone is willing to share the details?
David
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
Here is Mark's script posted with permission:
SCRIPT
#!/bin/bash
#SVCCODES="disk:100,cpu:200,procs:300,svcs:350,msgs:400,conn:5 00,http:60 0,ftp:721,ssh:722,ssh1:722,ssh2:722,telnet:723,smtp:725,fping: 727,mq:729 ,dns:800,pop2:809,pop-2:809,pop:810,pop3:810,pop-3:810,nntp:81 9,imap:843 ,imap2:843,imap3:843,imap4:843,mrtg:850,swap:860,memory:870,sy s:880,err: 890,test:901"
#Variables #$OID - OID to be used without trailing value (.1.3.6.1.4.1.7058)(BB default) #$OIDTAIL - ending value of OID particluar to alarm type; determined by "case" statement #$MACHIP - IP address of device generating alarm; determined by hobbit #$BBHOSTNAME - hostname of device generating alarm; determined by the hobbit bb-hosts file #$BBSVCNUM - service code corresponding to the service being monitored; determined by hobbit configuration #$BBCOLORLEVEL - alarm level; determined by hobbit #$RECOVERED - '0' denotes alarm; '1' denotes recovery #$HPOV
- the IP address of the destination HPOV server #TMPDIR - directory for location of temporary file necessary for sed of $MACHIP
###Start script ###
CHRONO=
dateOID=.1.3.6.1.4.1.7058 #Put your own OV server IP address in the next line. HPOV=xxx.xxx.xxx.xxx TMPDIR=/home/hobbit/server/extcase $BBSVCNUM in 100) #Disk OIDTAIL=10 ;; 200) #CPU OIDTAIL=20 ;; 300) #Procs OIDTAIL=30 ;; 350) #Svcs OIDTAIL=40 ;; 400) #Msgs OIDTAIL=50 ;; 500) #Conn OIDTAIL=60 ;; 600) #Http OIDTAIL=70 ;; #OIDTAIL=80 (not assigned) 721) #FTP OIDTAIL=90 ;; 722) #SSH OIDTAIL=100 ;; 723) #Telnet OIDTAIL=110 ;; 725) #SMTP OIDTAIL=120 ;; 727) #Fping OIDTAIL=130 ;; 729) #MQ OIDTAIL=140 ;; 800) #DNS OIDTAIL=150 ;; 809) #POP2 OIDTAIL=160 ;; 810) #POP OIDTAIL=170 ;; 819) #NNTP OIDTAIL=180 ;; 843) #IMAP OIDTAIL=190 ;; 850) #MRTG OIDTAIL=200 ;; 860) #Swap OIDTAIL=210 ;; 870) #Memory OIDTAIL=220 ;; 880) #Sys OIDTAIL=230 ;; 890) #ERR OIDTAIL=240 ;; 901) #Test OIDTAIL=250 ;; esac
if [[ "$RECOVERED" = "0" ]]; then if [[ "$BBCOLORLEVEL" = "purple" ]]; then OIDTAIL=$(($OIDTAIL + 1)) elif [[ "$BBCOLORLEVEL" = "yellow" ]]; then OIDTAIL=$(($OIDTAIL + 2)) elif [[ "$BBCOLORLEVEL" = "red" ]]; then OIDTAIL=$(($OIDTAIL + 3)) fi elif [[ "$RECOVERED" = "1" ]]; then BBCOLORLEVEL=green fi
#Following line: reads Hobbit IP into temporary file echo $MACHIP > $TMPDIR/tmpfile.txt
#Following lines: puts Hobbit 12 digit IP format in dotted decimal and removes any leading zeroes. MACHIP=
sed 's/\(...\)\(...\)\(...\)\(...\)/\1.\2.\3.\4/' $TMPDIR/tmpfile.txtecho $MACHIP > $TMPDIR/tmpfile.txt MACHIP=sed -e 's/^00//' -e 's/^0//' -e 's/\.000/./' -e 's/\.00/./' -e 's/\.0/./' -e 's/\.000/./' -e 's/\.00/./' -e 's/\.0/./' -e 's/\.000/./' -e 's/\.00/./' -e 's/\.0/./' -e 's/\.\.\./.0.0./' -e 's/\.\./.0./' -e 's/\.$/.0/' $TMPDIR/tmpfile.txt#Following line: removes the temporary file rm -f $TMPDIR/tmpfile.txt
#Following line: forwards the error message to HPOV as an SNMP message
snmptrap -v 1 -c mitcovo $HPOV "$OID" "$MACHIP" 6 $OIDTAIL ""echo "DATE: $CHRONO" >> /home/hobbit/server/ext/hpov-push.log echo "snmptrap -v 1 -c public $HPOV "$OID" "$MACHIP" 6 $OIDTAIL "" " >> /home/hobbit/server/ext/hpov-push.log
END SCRIPT
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
Just built the lastest snapshot on a Solaris 9. I got it to compile but when I run I get in variour log files: ld.so.1 /path to hobbit program/ : fatal : libpcre.so: open failed no such file or directory
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| _p_ Mike Nemeth
| ___| |_____ email(w) michael.nemeth at lmco.com Work: 856 359-1425
|><___________) | Home Page:http://www.geocities.com/mjnemeth/
| Work Page:http://faraday.motown.lmco.com:3000/~nemethm/
| Work Page:http://ortsweb/~mnemeth/
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On Mon, Sep 19, 2005 at 11:42:58AM -0400, Michael Nemeth wrote:
Just built the lastest snapshot on a Solaris 9. I got it to compile but when I run I get in variour log files: ld.so.1 /path to hobbit program/ : fatal : libpcre.so: open failed no such file or directory
Add the directory where you have the PCRE library installed to the LD_LIBRARY_PATH setting for your Hobbit user. E.g. set it in the default /etc/profile.
If you don't want to put it there, the easiest solution is probably to add the definition to the top-level Makefile for Hobbit, like
RUNTIMEDEFS="LD_LIBRARY_PATH=/usr/local/pcre/lib"
then running "make clean; make; make install" again.
Henrik
Didn't seam to work either way! I ended up lv -s from /usr/local/lib/xxx.so to /usr/bin.xxx.so Maybe sol 9 bug or missing patch.
Henrik Stoerner wrote:
On Mon, Sep 19, 2005 at 11:42:58AM -0400, Michael Nemeth wrote:
Just built the lastest snapshot on a Solaris 9. I got it to compile but when I run I get in variour log files: ld.so.1 /path to hobbit program/ : fatal : libpcre.so: open failed no such file or directory
Add the directory where you have the PCRE library installed to the LD_LIBRARY_PATH setting for your Hobbit user. E.g. set it in the default /etc/profile.
If you don't want to put it there, the easiest solution is probably to add the definition to the top-level Makefile for Hobbit, like
RUNTIMEDEFS="LD_LIBRARY_PATH=/usr/local/pcre/lib"
then running "make clean; make; make install" again.
Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| _p_ Mike Nemeth
| ___| |_____ email(w) michael.nemeth at lmco.com Work: 856 359-1425
|><___________) | Home Page:http://www.geocities.com/mjnemeth/
| Work Page:http://faraday.motown.lmco.com:3000/~nemethm/
| Work Page:http://ortsweb/~mnemeth/
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael Nemeth wrote:
Didn't seam to work either way! I ended up lv -s from /usr/local/lib/xxx.so to /usr/bin.xxx.so Maybe sol 9 bug or missing patch.
The system loader/linker can't find your lib. Assuming you have the .so lib in /usr/local/lib.
You can add -R to the Makefile PCRELIBS = -L/usr/local/lib -R/usr/local/lib -lpcre The -R "hard code" the path to the library into the executable so env variable will be needed. The -L told it where to find it while compiling.
Or use crle to add /usr/local/lib to system wide runtime linking environment. See man crle. Be VERY CAREFUL with this or you will end up booting from cdrom to repair. Be sure to include the existing library paths!
Command line: crle -c /var/ld/ld.config -l /usr/lib:/usr/lib/secure:/usr/local/lib
I usally use the latter as nowadays gcc uses a .so for all its generated programs and then dragging around the LD_LIBRARY_PATH isn't needed.
ldd hobbitd_alert libpcre.so.0 => /usr/local/lib/libpcre.so.0 libc.so.1 => /usr/lib/libc.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 libdl.so.1 => /usr/lib/libdl.so.1 /usr/platform/SUNW,Sun-Fire-V210/lib/libc_psr.so.1
Henrik Stoerner wrote:
On Mon, Sep 19, 2005 at 11:42:58AM -0400, Michael Nemeth wrote:
Just built the lastest snapshot on a Solaris 9. I got it to compile but when I run I get in variour log files: ld.so.1 /path to hobbit program/ : fatal : libpcre.so: open failed no such file or directory
Add the directory where you have the PCRE library installed to the LD_LIBRARY_PATH setting for your Hobbit user. E.g. set it in the default /etc/profile.
If you don't want to put it there, the easiest solution is probably to add the definition to the top-level Makefile for Hobbit, like
RUNTIMEDEFS="LD_LIBRARY_PATH=/usr/local/pcre/lib"
then running "make clean; make; make install" again.
Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
On 9/19/05, sladewig <sladewig at bankinfo.com> wrote:
Michael Nemeth wrote:
Didn't seam to work either way! I ended up lv -s from /usr/local/lib/xxx.so to /usr/bin.xxx.so Maybe sol 9 bug or missing patch.
The system loader/linker can't find your lib. Assuming you have the .so lib in /usr/local/lib.
You can add -R to the Makefile PCRELIBS = -L/usr/local/lib -R/usr/local/lib -lpcre
Yeap this is the preferred way for Solaris. That is what I did before running GNU make
The -R "hard code" the path to the library into the executable so env variable will be needed. The -L told it where to find it while compiling.
Or use crle to add /usr/local/lib to system wide runtime linking environment. See man crle. Be VERY CAREFUL with this or you will end up booting from cdrom to repair. Be sure to include the existing library paths!
Command line: crle -c /var/ld/ld.config -l /usr/lib:/usr/lib/secure:/usr/local/lib
I usally use the latter as nowadays gcc uses a .so for all its generated programs and then dragging around the LD_LIBRARY_PATH isn't needed.
ldd hobbitd_alert libpcre.so.0 => /usr/local/lib/libpcre.so.0 libc.so.1 => /usr/lib/libc.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 libdl.so.1 => /usr/lib/libdl.so.1 /usr/platform/SUNW,Sun-Fire-V210/lib/libc_psr.so.1
Henrik Stoerner wrote:
On Mon, Sep 19, 2005 at 11:42:58AM -0400, Michael Nemeth wrote:
Just built the lastest snapshot on a Solaris 9. I got it to compile but when I run I get in variour log files: ld.so.1 /path to hobbit program/ : fatal : libpcre.so: open failed no such file or directory
Add the directory where you have the PCRE library installed to the LD_LIBRARY_PATH setting for your Hobbit user. E.g. set it in the default /etc/profile.
If you don't want to put it there, the easiest solution is probably to add the definition to the top-level Makefile for Hobbit, like
RUNTIMEDEFS="LD_LIBRARY_PATH=/usr/local/pcre/lib"
then running "make clean; make; make install" again.
Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
participants (5)
-
henrik@hswn.dk
-
michael.nemeth@lmco.com
-
nfigaro@effigie.fr
-
sladewig@bankinfo.com
-
vadud3@gmail.com