Help - Search - Members - Calendar
Full Version: Ensim Converter Script
The Planet Forums > Control Panels > Urchin
Pages: 1, 2
matzarah
I've written a perl script that goes through each virtual host on ensim and creates on urchin:
-a report for the domain
-a user account for the domain (which has permissions set to the report/domain)
-logsource for the domain

urchin has been working pretty well since I ran the script, I will probably post it on the forums later (I want to make sure it is all working fine first before distributing it). it is really useful if you don't want to add 100 domains/reports & users manually.



The HOW-TO and the script is uploaded!

Please post your comments & results with this! I would really appreciate it!

it is located at: http://www.wildfirehq.net/urchin/



it is very easy to use, it simply writes a config file which you then import into urchin.
webbcite
Why not just post the How-To instead of the big tease... icon_smile.gif icon_smile.gif
matzarah
heheh alright..

I need to fix up a few things...

will be up soon


matzarah
matzarah
The HOW-TO and the script is uploaded!

Please post your comments & results with this! I would really appreciate it!

http://www.wildfirehq.net/urchin/

thanks,

matzarah
jamesp
Thanks, worked GREAT icon_biggrin.gif
DeltaArc
Matzarah's script has been running flawlessly on our machines so far.

I believe this thread *might* be a good idea to put as sticky.


Martin Enault
DeltaArc Networking
http://www.DeltaArc.net
hostpc
Another piece of quality workmanship by a Rackshack user - thanks for the great script! Works flawlessly!

Joe
Mike2522
How will we add new domains to urchin after we run the script? or can we just re-run the script again?
matzarah
I will soon write a script that will write a config file for new domains. probably something like.

perl newconf domain.com

then it will make a config something like, domain.com.urchin.conf - and then you'll import it into urchin....

however, if you run the script again, and import it again, I THINK it will leave any existing records and just add the new ones (new domain/s).
Mike2522
matzarah, i think i'll just wait for your new script. Very nice work BTW icon_biggrin.gif
Camper
What great instructions even I could do it!


Camper:)
reallynicejerk
QUOTE
Originally posted by matzarah
however, if you run the script again, and import it again, I THINK it will leave any existing records and just add the new ones (new domain/s).


Yes the import utility doesn't overwrite existing profiles unless you run it as -o (overwrite)
matzarah
QUOTE
Originally posted by reallynicejerk


Yes the import utility doesn't overwrite existing profiles unless you run it as -o (overwrite)



yes this is correct.

Mike2522, I may be a while with the script to just write a conf for a single domain. busy time of life right now....

just re-run the script I had posted and import it again - it should work with no trouble, as the importer will only overwrite existing records if you use the -o flag.
Mike2522
Thanks matzarah! Will do that for now as well.
redtagdeals
QUOTE
Originally posted by matzarah
The HOW-TO and the script is uploaded!

Please post your comments & results with this! I would really appreciate it!

http://matzarah.jdmtnet.wha.la/urchin  

thanks,

matzarah



worked like a charm!
DanDanFireMan
Excellent, well done!
orca
Yes, great work icon_smile.gif
REBIS
Brilliant script, mate! -Reb
Aquanuke
Thanks! brillant script, have one problem though...

Cant login to any of the accounts , ie doing

user : mydomain.com
Pass : temp123

Dosent work.. any ideas?

Thanks
matzarah
hmm this is interesting, no one else has informed me of this problem.

make sure you're not using the www.* infront of the domain name when logging in...

for example; mydomain.com ... not www.mydomain.com

I can't think of any other reason for it to do this. if you want me to try and figure out the problem you'll need to let me look at your urchin admin panel.
Aquanuke
Forget that email matzarah,

Sorry its working perfect... was because I was trying to login on domains which where aliased to the main domain :o(

All good

Thanks
Rack5
how to get Config Generator ?

I go to http://matzarah.jdmtnet.wha.la/urchin/confgen and then?
matzarah
you need to have the that file, then run it.

you can either click on the link, then copy the file content into a file on your machine, or do a right click on the link and select 'save target as'. you then run the script as the how-to says.
maxihost
hello,

I type the command
[root@mh15 util]# ./uconf-schedule

and then I set the script to update Daily

when I go to my control panel, update the page and see that all the sites are set to no schedulled and at the bottom of the page I see a message : Warning! Task scheduler disabled.

how do I turn it on ?

anybody help me !

thanks.
projectandrew
this site seems down - anyone else have the same problem or is it just me?
matzarah
the site was down for some hours for maintenance. sorry for any inconvenience.
BoiTaiTui
what happen if the site removed, will urchin remove that also?
matzarah
no. you would have to remove the site manually from urchin, and also the user.
Owen
I tried this script but when I do this I get an error...

[root@srv001 root]# perl confgen
No such file or directory at confgen line 10.

...anyone able to help, please?
McGuri
Your script is magical... i'm a rookie in rackshack with a new server and less of 5 minutes my Urchin multidomain READY !!!

Thanks icon_razz.gif
alex.davies
Just in case anyone is wondering, if you add domains after having run this script you can run it again, you will simply get code like this:

CODE
record winsmith.co.uk ONE already exists, use -o option to overwrite.

record winsmith.co.uk TWO already exists, use -o option to overwrite.

record winsmith.co.uk already exists, use -o option to overwrite.

record winsmith.co.uk already exists, use -o option to overwrite.

record winsmith.co.uk already exists, use -o option to overwrite.

removed 0 records.

added 30 records.

edited 0 records.

[root@srv01 util]#


In other words, it does not overwrite/clear, just adds new domains. I dont think it removes domains that you might have deleted, though, so you might have to do that manually.

Hope this helps,

Alex
Owen
QUOTE
Originally posted by McGuri
Your script is magical... i'm a rookie in rackshack with a new server and less of 5 minutes my Urchin multidomain  READY !!!

Thanks icon_razz.gif


Yeh this is an easy thing to do, guess to of ignored it anyway as it worked perfectly anyway icon_smile.gif.
NJHosting
matzarah, just tried to go to the site to get script and it is down or not available. Is it going to be back up.
DeltaArc
Greetings,

matzarah moved his site to a new domain.
I will let him know to update his posts.

The new url is : http://www.wildfirehq.net/urchin/

Martin Enault
DeltaArc Networking
http://www.DeltaArc.net
schmoe
I had a bunch of (non ensim) hosts to import into urchin. A few notes that others may find helpful:

http://help.urchin.com/whitepapers/scriptingconf.pdf
is very useful. It describes in some detail the format of the configuration file.

Using the "-o" flag will overwrite records in the configuration database. This can be used to replace items. Without it, the import will only add items.

To delete items and replace the configuration entirely, use the "-r" flag. Note that the documenation warns about being careful with this. You need to duplicate the "Global" settings found from the uconf-export. I never got this function to work (segmentation faults on import). The "overwrite" ended up being enough for me.

You can set the password. If you use plain-text in the ct_password field, the import will automatically encrypt it for you. If the password starts with USCC|, then the import assumes it is already encrypted (so you can keep passwords from an export).
RichPP
Is there a way to make this run every night?
Like a cron or something?
Owen
Yeh that would be good, wouldnt think it would be hard but wouldnt wanna rush and do it myself, as hate to mess with others scripts .etc.
DataDork
I had some questions after initially setting up urchin on my box this morning, but thanks to you, I was able to get those annoying lingering questions answered. Oh, and your script worked like a champ!

Thanks again...
CrazyGuy
when I run this script on my new server, it sets up profiles with 2 log file paths the same -

/home/virtual/domain.com/var/log/httpd/access

... but they should be

/home/virtual/domain.com/var/log/httpd/access_log
and
/home/virtual/domain.com/var/log/httpd/access_log.[1-4]

- which is how the script does it on my other (older) server.

Where does the script pick this up from - I don't think I ever configured it to do this on the other server, it "just worked", so I'm at a loss over how to set it up right on the new server.
CrazyGuy
following up on my own post in case anyone shares this prob in future ...

I tracked down the problem to the confgen script. I guess I cut 'n' pasted it into an editor on the server, and the two lines that write the log names into the conf file got a spurious line break introduced - putting _log and _log.[1-4] on new lines.

Surprisingly, the script continued to run - but using the truncated log file names.
swilliams
Great script! Got it up and running in no time.
rnccen
Does it work with Plesk?
matzarah
this will NOT work with plesk. its designed for Ensim only.
Nu2Linux
Worked without a flaw (well one, don't copy from your browser into vi or pico, download the file using wget http://.....)

Thanks!
JamesC
link dont work all i get is a 403 page

icon_sad.gif
REBIS
Is this script compatible with Ensim Pro?
matzarah
QUOTE
Originally posted by REBIS
Is this script compatible with Ensim Pro?


Yes.

QUOTE
Originally posted by JamesC
link dont work all i get is a 403 page

icon_sad.gif


Should be fine now.
Buttercup
Script works perfectly with Urchin 4 - does it work with Urchin 5? Thanks again for the script - it saved me a LOT of time and trouble adding all my domains.
REBIS
This is a nice script, however, the advantages of running NightHawk's Urchin setup script is that it just enables one dom at a time. I prefer not to automatically enable Urchin on all sites.

See this thread
jameztcc
just modify the access.log to access.log* will do away with the issues of many log files in the profile.

it worked, at on my Ensim 3.1.x... ...should not be a factor.


(Am using NightHawk's Urchin ... ..with my modification)

#! /bin/sh

DOMAINS=`/usr/local/bin/sitelookup -a domain`
SITERETVAL=$?
if [ $SITERETVAL -eq 0 ]; then
for DOMAIN in $DOMAINS
do
USER=`/usr/local/bin/sitelookup -d $DOMAIN site_admin`
/etc/appliance/customization/urchin-add.sh $DOMAIN $USER
done
fi
[root@svr1 customization]# cat urchin-add.sh
#! /bin/sh

URCHINPATH="/usr/local/urchin"
OUTPUT="/tmp/urchin-temp.conf"

DOMAIN=$1
USER=$2@$1
PASSWORD="urchin"

echo "" > $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_website=http://www.$DOMAIN" >> $OUTPUT
echo " ct_reportdomains=www.$DOMAIN,$DOMAIN" >> $OUTPUT
echo " cs_llist=$DOMAIN-access-log*" >> $OUTPUT
#echo " cs_llist=$DOMAIN-access-log,$DOMAIN-access-log.[1-4]" >> $OUTPUT
echo " ct_defaultpage=index.html" >> $OUTPUT
echo " cs_vmethod=0" >> $OUTPUT
echo " cs_ulist=$USER" >> $OUTPUT
echo "
" >> $OUTPUT
echo >> $OUTPUT
echo "" >> $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " cr_frequency=4" >> $OUTPUT
echo " cr_minute=0" >> $OUTPUT
echo " cr_runnow=0" >> $OUTPUT
echo " cr_enabled=off" >> $OUTPUT
echo "
" >> $OUTPUT
echo >> $OUTPUT
echo "" >> $OUTPUT
echo " ct_name=$DOMAIN-access-log*" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_loglocation=/home/virtual/$DOMAIN/var/log/httpd/access_log*" >> $OUTPUT
echo " cs_logformat=ncsa" >> $OUTPUT
echo " cr_type=local" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "
" >> $OUTPUT
echo >> $OUTPUT
#echo "" >> $OUTPUT
#echo " ct_name=$DOMAIN-access-log.[1-4]" >> $OUTPUT
#echo " ct_affiliation=(NONE)" >> $OUTPUT
#echo " ct_loglocation=/home/virtual/$DOMAIN/var/log/httpd/access_log.[1-4]" >> $OUTPUT
#echo " cs_logformat=ncsa" >> $OUTPUT
#echo " cr_type=local" >> $OUTPUT
#echo " cs_rlist=$DOMAIN" >> $OUTPUT
#echo "
" >> $OUTPUT
#echo >> $OUTPUT
echo "" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_fullname="$DOMAIN"" >> $OUTPUT
echo " ct_name=$USER" >> $OUTPUT
echo " ct_password=$PASSWORD" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "
" >> $OUTPUT

$URCHINPATH/util/uconf-import -f $OUTPUT
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.