BB Unix Network Monitor - Message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Re: {bb} bbgen and DOCURL and bb-csvinfo.cgi
- To: <bb@bb4.com>
- Subject: RE: Re: {bb} bbgen and DOCURL and bb-csvinfo.cgi
- From: <U.Kirbach@enbw.com>
- Date: Wed, 1 Sep 2004 10:40:18 +0200
- Content-class: urn:content-classes:message
- Content-transfer-encoding: 8bit
- Content-type: text/plain; charset="iso-8859-1"
- Reply-to: bb@bb4.com
- Sender: owner-bb@bb4.com
- Thread-index: AcSPmtAymW2z2KjmTuuXmSTtzpmwygAYwQ0A
- Thread-topic: Re: {bb} bbgen and DOCURL and bb-csvinfo.cgi
Hello Henrik,
I didn't see the wood for the trees.
Your suggestion is so apparently, sorry for my blackout.
I would like to thank you for your ongoing dedication
on this list.
Thank you
Uwe
-----Original Message-----
From: owner-bb@bb4.com [mailto:owner-bb@bb4.com] On Behalf Of Henrik Storner
Sent: Tuesday, August 31, 2004 10:25 PM
To: bb@bb4.com
Subject: Re: {bb} bbgen and DOCURL and bb-csvinfo.cgi
In <9B3C0C86BE46BF499B7B8E10E397F6C014BEDC@s2h3118r> <U.Kirbach@enbw.com>
writes:
>your new bbgen 2.16 is very useful.
>Especially for internal documentation the bb-csvinfo suite.
>Thank you very much for that.
You're welcome - it was so easy to do, so I am glad that it
is useful.
> is it possible to enhance the docurl feature for bbgen to have also
>host specific docurls beside the standard docurl via command line?
>for example in BBHOME/etc/bb-hosts
>10.10.192.1 host1 #
DOCURL="$CGIBINURL/bb-csvinfo.sh?db=hostinfo.csv&key=%s"
># no DOCURL - using standard docurl from command line
>10.10.192.2 host2 #
I would prefer to keep this in the CGI script, rather then building it
into bbgen. The current setup is simple and flexible - I prefer to
keep it that way.
And you already have tools that can do pretty much what you want.
Instead of putting the database-name in the URL, just make the doc-
link go to a CGI script which gets only the hostname as parameter, e.g
run bbgen with "--docurl=$CGIBINURL/myinfoscript.sh?%s"
If you then put a "DOCDB=file1.csv" tag in the bb-hosts file, you
can pickup that tag from your "myinfoscript.sh" script and pass it
off to the bb-csvinfo.cgi script yourself. Like this:
#!/bin/bash
# Pick up the BB environment
BBHOME=/usr/local/bb
export BBHOME
. $BBHOME/etc/bbdef.sh
# CGI provides $QUERY_STRING, which is the hostname
HOSTNAME="$QUERY_STRING"
# Pick a database to use from the DOCDB=filename tag
# in the bb-hosts file.
# bbhostgrep picks all the host with a DOCDB tag,
# so we can just grep for our host and the DOCDB
# tag will be item 4.
#
DOCDB=`$BBHOME/bin/bbhostgrep --noextras "DOCDB=*" | \
grep "$HOSTNAME" | awk '{print $4}' | sed 's/DOCDB=//'`
# Now use the bb-csvinfo to generate the HTML page.
# bb-csvinfo.cgi is normally run via CGI, but you
# can run it just fine as long as you setup the
# QUERY_STRING environment with the parameters it needs.
# Below, if $DOCDB is not set (because the host didnt
# have a DOCDB tag), default to the "defaultdb.csv" file.
#
QUERY_STRING="key=$HOSTNAME&db=${DOCDB:-defaultdb.csv}"
export QUERY_STRING
exec $BBHOME/bin/bb-csvinfo.cgi
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
Mit freundlichen Grüßen
Uwe Kirbach
--
Uwe Kirbach
EnBW Service GmbH
Betrieb Enterprise Systeme und Infrastruktur
Systemmanagement Unix
Durlacher Allee 93
76131 Karlsruhe
Tel: +49-0721-63-14139
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
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