Ok i have found the solution and if anyone lives like that problem here is the solution;
HOWTO: Autocleanup urchin when you delete an Ensim virtual site.
Ok, so we all followed the howto's to integrate urchin with Ensim to add a new Urchin profile when a new Ensim domain is added. Howeverm when a domain is deleted from Ensim, that Urchin profile is left stranded. We have created a script to delete the Urchin profile when a site is deleted from Ensim.
Here's how to deploy it.
This HOWTO has been tested on Ensim 3.7 for RHEL. Your results may vary.
All these commands are executed as root
Select a location on the server for the storage of your urchin integration scripts. (This should probably be the same location your urchin-add.sh script is located).
Create a file in this location called urchin-delete.sh and put in the following contents.
code:--------------------------------------------------------------------------------
#!/bin/sh
URCHINPATH="/usr/local/urchin"
OUTPUT="/tmp/urchin-temp.conf"
DOMAIN=`/usr/local/bin/sitelookup -s $1 domain`
USER=`/usr/local/bin/sitelookup -s $1 site_admin`
echo "action=delete table=task name=\"$DOMAIN\"" > $OUTPUT
echo "action=delete table=profile name=\"$DOMAIN\"" >> $OUTPUT
echo "action=delete table=logfile name=\"$DOMAIN-access_log\"" >> $OUTPUT
echo "action=delete table=logfile Name=\"$DOMAIN-access_log.1\"" >> $OUTPUT
echo "action=delete table=user Name=\"$USER@$DOMAIN\"" >> $OUTPUT
$URCHINPATH/util/uconf-driver -f $OUTPUT > /dev/null
rm $OUTPUT
--------------------------------------------------------------------------------
Save the file and give it the following permissions
chmod 755 urchin-delete.sh
Next create a file called deleteVirtDomain.sh in the /etc/appliance/customization directory and copy in the following contents. (Note: if the file already exists, simply append the last line to the script.
Remember to change the path below to actually point to you urchin-delete.sh script you created in the previous step.
code:--------------------------------------------------------------------------------
#!/bin/sh
/path_to_your_urchin_scripts/urchin-delete.sh $1
--------------------------------------------------------------------------------
Set the permissions on the deleteVirtDomain.sh script
chmod 755 /etc/appliance/customization/deleteVirtDomain.sh
That’s it... Now when you delete your domains in ensim, you'll have your Urchin profiles cleaned up as well.
Best Wrist Watches