BB Unix Network Monitor - Message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {bb} New service definition in BB usgin bbgen



In <429DB61A.7040906@holme-pedersen.dk> BB - Hobbit <tlp-hobbit@holme-pedersen.dk> writes:

>Let me clarify. I am trying to make a new service called ncftp to be 
>used in the bb-hosts file. This I have setup in bb-services as a mere 
>copy of the ftp definition aonly renaming the name tag in the definition.

>Then in bbsys.local I have created an entry like this

>NCFTP="/usr/local/bin/ncftp -L <VIP address>"
>export NCFTP

>in the hope that bbtest-net would pick up this definition of the ncftp 
>command like it does with the fping command.

OK, you're on the wrong track here. The "bb-services" file is a configuration 
file for the bbtest-net network test application. But you want to run the ncftp
tool to perform the test - bbtest-net doesn't know anything about how to
handle this tool. bbtest-net is not a generic "run anything you drop in bbsys.local"
tool - it is written to perform a limited set of network tests, in most cases without
having to involve running external programs. 

So what you must do is to setup a BB extension script to run your tests.

Create a script $BBHOME/ext/ncftptest.sh

   #!/bin/sh

   $BBHOME/bin/bbhostgrep --no-extras "ncftp" |
   while read L
   do
      set $L
      IP=$1; shift
      HOSTNAME=$1; shift
      MACHINE="`echi $HOSTNAME | sed -e's/\./,/g'`"

      # Run your ncftp command to test on $HOSTNAME or $IP
      
      # Assuming ncftp returns an exit code of 0 = success
      if test $? -eq 0
      then
         $BB $BBDISP "status $MACHINE.ncftp green `date`

	 ncftp test OK"
      else
         $BB $BBDISP "status $MACHINE.ncftp green `date`

	 ncftp test FAILED"
      fi
   done

   exit 0

Then add this script to the $BBHOME/etc/bb-bbexttab file listing
your extension scripts and restart BB.



Henrik

-- 
Henrik Storner
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.


Home | Main Index | Thread Index