BB Unix Network Monitor - Message

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

{bb} bbstat via e-mail - procmail recipie



Here's the /home/bbstat/.procmailrc file that I have one a couple systems.


PATH=/usr/bin:/bin:/sbin:$HOME/bin
MAILDIR=$HOME/Mail      #you'd better make sure it exists
#DEFAULT=$HOME/Mailbox
#LOGFILE=/dev/null
LOGFILE=$MAILDIR/log
SHELL=/bin/sh
VERBOSE=on
 
# Send message to pager - for testing
# This works - case IS signifigant
:0
* ^Subject:[ ]proctest
! 11231231234@smsphone.net
 
#:0  # Send ping results to jas' pcs phone
##* ping[        ]*\/[-a-z0-9_]+(\.[-a-z0-9_]+)*
#* ! ^X-Loop: alert@bbhost.domain\.com
#{
#       :0 B
#       * ping[  ]*\/[-a-z0-9_]+(\.[-a-z0-9_]+)*
#       ! 11231231234@smsphone.net | ping $MATCH -c 1 #}

 
############################################################################
###################
 
# Both references to X-Loop need to be the address of the local user to 
eliminate looping.
# The ';' at the end of the 'RED' line allows the grep results to be added 
to the message
#   without overwriting - no semicolon would overwrite.
# The grep line looks for any sites with a status of red
# and then reports only the filename.  The cut removed the leading 
directory.
# 19 fits my system.  You'll need to modify that number.
#
# Comments must be here and not interspersed throughout the recipie.
#
:0 h c
* !^FROM_DAEMON
* !^X-Loop: bbstat@123.123.123.123"
| (formail -r -A"Precedence: junk" \
-A"X-Loop: bbstat@123.123.123.123" ; \
echo -e "RED\n"; \
grep "red " /root/bb/www/logs/* -l | cut -c 19- ; \
echo -e "YELLOW\n"; \
grep "yellow " /root/bb/www/logs/* -l | cut -c 19- ; \
echo -e "CLEAR\n" ; \
grep "clear " /root/bb/www/logs/* -l | cut -c 19- ; \
echo -e "GREEN\n" ; \
grep "green " /root/bb/www/logs/* -l | cut -c 19- ; \
echo "END" \
) | $SENDMAIL -t



===== Original Message from charles@toucan.ie (Charles Gillanders) at 
9/30/99 8:24 am
>Actually Jerry, would you mind sending me that as well.  Thanks,
>
>Charles
>
>-----Original Message-----
>From: Jerry Shenk [mailto:jas@dect.com]
>Sent: 30 September 1999 11:43
>To: Andrew Dalgleish
>Subject: RE: {bb} HTML table formatting
>
>
>Don't know if this is what you're looking for or not but I have a bbstat
>account on a couple of my bbhost machines so from my SMS phone (normally
>while driving), I can send a message to bbstat@hostname_or_ipaddress and get
>
>a response back listing the RED, YELLOW and CLEAR lights in that order.
>Obviously space is sorely limited so if there are more than three REDs,
>that's the end of the message.  I do not have it set up to split the message
>
>up.  This actually works pretty well.  Right now, it returns the entire
>FQDN.service that is in one of the above states.  I'd like to use cut to
>take only the first and last parameters so that I can get more hosts listed.
>
>
>If you want, I can mail you my procmail recipe that does all the work.

---Jerry Shenk, Master CNE -
D&E Computer Networking Services, formerly Com Tech Technical Services 
(717) 569-5800, http://www.dect.com/jas
Snail Mail: 248 Granite Run Drive * Lancaster, PA 17601
Internet E-mail: jas@dect.com
Office Fax (don't fax me here): (717) 560-1682
Personal Fax via www.efax.com: (603) 250-1453

-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
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