Hobbit, Net-snmp snmptrap,and HPOV
list Mark Itd Coupe
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
list David Gore
▸
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
list Henrik Størner
▸
On Fri, Sep 02, 2005 at 11:43:55AM -0400, Coupe, Mark (ITD) wrote:
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.
The problem is somewhere in your custom script, since that's what
generates the OID that is being fed to the snmptrap command.
The command you should end up with ought to look somewhat like
snmptrap -v1 -c public \
172.16.10.100 \
"" \
hobbit.foo.com \
0 0 "" \
1.3.6.1.4.1.7058.1 \
s "This is a Hobbit trap message"
172.16.10.100 is the HPOV monitor IP-address, "hobbit.foo.com" is the
hostname reporting the trap, "1.3.6...." is the trap OID.
At least, this generates an SNMP trap that Ethereal decodes as I would
expect.
Regards,
Henrik
list Allan Marillier
I hope this is not another silly question! I've searched the archives, but not seen anything that solves my problem, which may prove to be a misconfiguration. I have a bb-dftab on my clients in /home/hobbit/client/etc/bb-dftab. After changing it, I restarted the hobbit client just to be sure. /home and /opt are still showing up as yellow and red respectively. /home (90 %) has reached the WARNING level (90 %) /opt (97 %) has reached the PANIC level (95 %) The client bb-dftab contains: /usr:92:98 /home:95:99 /opt:99:100 and is owned by the hobbit user, with rw-r--r-- permissions The client hobbitclient.cfg is default as bundled and contains: # For the disk check DODISK="TRUE" NODISKCOLOR="clear" BBDFTAB="$BBHOME/etc/bb-dftab" DFEXCLUDE="cdrom" DFPANIC="95" DFSORT="4" DFUSE="^/dev" DFWARN="90"
list David Gore
▸
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 CoupeI, 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
Here is Mark's script posted with permission:
SCRIPT
#!/bin/bash
#SVCCODES="disk:100,cpu:200,procs:300,svcs:350,msgs:400,conn:500,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:819,imap:843
,imap2:843,imap3:843,imap4:843,mrtg:850,swap:860,memory:870,sys: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=`date`
OID=.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/ext
case $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.txt`
echo $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
list Figaro Nicolas
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:user-0ef10ea25696@xymon.invalid] Envoyé : lundi 19 septembre 2005 17:11 À : user-ae9b8668bcde@xymon.invalid 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 CoupeI, and perhaps others would be interested in what precisely you are doing? Are you pushing all hobbit alarms from the hobbit server toHPOV?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? DavidHere 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:819,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=`date`
OID=.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/ext
case $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.txt`
echo $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
list Michael Nemeth
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) user-609d3fab5b2d@xymon.invalid Work: XXX XXX-XXXX |><___________) | Home Page:http://www.geocities.com/mjnemeth/ | Work Page:http://faraday.motown.lmco.com:3000/~nemethm/ | Work Page:http://ortsweb/~mnemeth/ |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
list Henrik Størner
▸
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
list Michael Nemeth
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 directoryAdd 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
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | _p_ Mike Nemeth | ___| |_____ email(w) user-609d3fab5b2d@xymon.invalid Work: XXX XXX-XXXX |><___________) | Home Page:http://www.geocities.com/mjnemeth/ | Work Page:http://faraday.motown.lmco.com:3000/~nemethm/ | Work Page:http://ortsweb/~mnemeth/ |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
list Sladewig
▸
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 directoryAdd 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
list Asif Iqbal
▸
On 9/19/05, sladewig <user-25b160a6ee31@xymon.invalid> 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.1Henrik 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 directoryAdd 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
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu