<br><font size=2 face="sans-serif">I now made it with the bbshowhosts command.
This command writes a complete bbhosts file. So I temporarely generate
that complete file and then cycle through all the directories in the rrd
directory and grep for each in that complete bbhosts file. If I not find
a host there I drop it.</font><br><br><font size=2 face="sans-serif">If there is a nicer solution please
tell me.</font><br><br><font size=2 face="sans-serif">#!/bin/sh</font><br><br><font size=2 face="sans-serif">#</font><br><font size=2 face="sans-serif"># find old files from components which
are no longer in BB-HOSTS</font><br><font size=2 face="sans-serif">#</font><br><font size=2 face="sans-serif">. /etc/hobbit/hobbitserver.cfg</font><br><font size=2 face="sans-serif">echo "BBRRDS: $BBRRDS"</font><br><font size=2 face="sans-serif">$BBHOME/bin/bbhostshow /etc/hobbit/bb-hosts
>hosts.tmp</font><br><br><font size=2 face="sans-serif">for i in `ls $BBRRDS`</font><br><font size=2 face="sans-serif">do</font><br><font size=2 face="sans-serif">  grep $i hosts.tmp >/dev/null</font><br><font size=2 face="sans-serif">  if [ "$?" -ne "0"
]</font><br><font size=2 face="sans-serif">  then</font><br><font size=2 face="sans-serif">    echo "$i found"</font><br><font size=2 face="sans-serif">    # drop the host $i here</font><br><font size=2 face="sans-serif">  fi</font><br><font size=2 face="sans-serif">done</font><br><font size=2 face="sans-serif">rm hosts.tmp</font><br><br><font size=2 face="sans-serif">Thanks you for your hints.</font><br><br><font size=2 face="sans-serif">Thorsten Erdmann<br></font><br><br><br><table width=100%><tr valign=top><td width=40%><font size=1 face="sans-serif"><b>greg.hubbard@eds.com</b></font><p><font size=1 face="sans-serif">25.02.2009 17:12</font><table border><tr valign=top><td bgcolor=white><div align=center><font size=1 face="sans-serif">Bitte antworten an<br>hobbit@hswn.dk</font></div></table><br><td width=59%><table width=100%><tr valign=top><td><div align=right><font size=1 face="sans-serif">An</font></div><td><font size=1 face="sans-serif">hobbit@hswn.dk</font><tr valign=top><td><div align=right><font size=1 face="sans-serif">Kopie</font></div><td><tr valign=top><td><div align=right><font size=1 face="sans-serif">Thema</font></div><td><font size=1 face="sans-serif">RE: [hobbit] Antwort: RE: [hobbit] Howto
delete abandoned datafiles</font></table><br><table><tr valign=top><td><td></table><br></table><br><br><br><font size=2 color=blue face="Verdana">It seems to me that the cleanest
way is to figure out how to make your inventory system "know"
when it is losing something.  I agree that it is easier to write a
system that has no memory of what it did in prior runs.</font><br><font size=3> </font><br><font size=2 color=blue face="Verdana">If your inventory system can
be queried, or if you have an intermediate file that can be searched, you
might be able to run a "notification" script from the alert system
that would fire on "purple" alarms.  What the script could
do is take the host name in the alarm and look for it in your inventory
or other file -- if found, quit.  If not found, then the "drop
host" command.  This is a kludge, and might cause other issues,
but it is one way to keep your display cleaned up.</font><br><font size=3> </font><br><font size=2 color=blue face="Verdana">Others may have much better
ideas!</font><br><font size=3> </font><br><font size=2 color=blue face="Verdana">GLH</font><br><br><hr><font size=2 face="Tahoma"><b>From:</b> thorsten.erdmann@daimler.com
[mailto:thorsten.erdmann@daimler.com] <b><br>Sent:</b> Wednesday, February 25, 2009 9:50 AM<b><br>To:</b> hobbit@hswn.dk<b><br>Subject:</b> [hobbit] Antwort: RE: [hobbit] Howto delete abandoned datafiles</font><font size=3><br></font><br><font size=2 face="sans-serif"><br>No. I export the data from our inventory and simply regenerate the bbhosts
files. So old hosts simply are missing in the new bbhosts files. So I don't
know which hosts were deleted. Therefore I would need to store the old
export file and compare it to the new one to find the differences and use
the "drop host" command. I find that very complicated. </font><font size=3><br></font><font size=2 face="sans-serif"><br>Such a cleanup utility would also be helpful if one edits the bbhosts by
hand and forgets to drop a host he has deleted.</font><font size=3><br></font><font size=2 face="sans-serif"><br>I just started to write a shellscript which scans the rrd directory and
tries to find the host in the bbhost files. But is complicated to follow
all the includes. I thought bbhostgrep is the answer but it only can find
a test, not a host.</font><font size=3><br></font><font size=2 face="sans-serif"><br>Any ideas<br>Thorsten</font><font size=3><br><br><br><br></font><table width=100%><tr valign=top><td width=34%><font size=1 face="sans-serif"><b>greg.hubbard@eds.com</b></font><font size=3></font><p><font size=1 face="sans-serif">25.02.2009 16:01</font><font size=3></font><br><table border=4><tr valign=top><td bgcolor=white><div align=center><font size=1 face="sans-serif">Bitte antworten an<br>hobbit@hswn.dk</font></div></table><p><td width=65%><br><table width=100%><tr valign=top><td width=13%><div align=right><font size=1 face="sans-serif">An</font></div><td width=86%><font size=1 face="sans-serif">hobbit@hswn.dk</font><font size=3></font><tr valign=top><td><div align=right><font size=1 face="sans-serif">Kopie</font></div><td><tr valign=top><td><div align=right><font size=1 face="sans-serif">Thema</font></div><td><font size=1 face="sans-serif">RE: [hobbit] Howto delete abandoned
datafiles</font></table><br><br><table><tr valign=top><td><td></table><br></table><br><font size=3><br><br></font><font size=2 color=blue face="Verdana"><br>Are you using the "drop host" function in the "bb"
command?</font><font size=3><br><br></font><hr><font size=2 face="Tahoma"><b>From:</b> thorsten.erdmann@daimler.com
[mailto:thorsten.erdmann@daimler.com] <b><br>Sent:</b> Wednesday, February 25, 2009 8:54 AM<b><br>To:</b> hobbit@hswn.dk<b><br>Subject:</b> [hobbit] Howto delete abandoned datafiles</font><font size=3><br></font><font size=2 face="sans-serif"><br><br>Hi<br><br>I have written a script which generates several hobbit bbhosts include
files automaticly from our inventory system. Now I have a problem when
a host has been deinstalled.<br>I delete the entry from the hobbit config but the old datafiles (rrd and
so on) keep there forever.<br><br>Is there a tool to scan the complete hobbit bbhost hierarchy and delete
all data which are not longer needed?<br><br>Thank you<br><br>Thorsten Erdmann</font><font size=2 color=#808080 face="sans-serif"><br><br>If you are not the intended addressee, please inform us immediately that
you have received this e-mail in error, and delete it. We thank you for
your cooperation. </font><font size=3><br></font><font size=2 color=#808080 face="sans-serif"><br><br>If you are not the intended addressee, please inform us immediately that
you have received this e-mail in error, and delete it. We thank you for
your cooperation. <br></font><br><font face="sans-serif"><font face="sans-serif, Arial, Helvetica" size="-1" color="#808080"><br>If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
<br></br> 
                                                                          
</font></font>