The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Urchin shuts down when WHM setting saved

Discussion in 'General Discussion' started by SiRCYRO, Mar 27, 2004.

  1. SiRCYRO

    SiRCYRO Registered

    Joined:
    Mar 27, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I'm running WHM 9.1.0 and cPanel 9.1.0-C118 with Urchin 5.5.00 and everything seems to be working properly. The only issue I have is when I make a change to a setting in WHM and save the change the Urchin Daemons stop. I have to manually run ./usr/local/urchin/bin/urchinctl start to restart the Urchin daemons. After that Urchin is up and running again, although sometimes Urchin will restart itself at random after WHM shuts it off. I already have the urchin_daemons in the /etc/rc.d/init.d/ folder.

    Any ideas how to remedy this?
     
  2. supremes

    supremes Registered

    Joined:
    Dec 15, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    CANADA
    You are lucky... My uchin only shows hits and bytes, I have only 0's everywhere else... Can anybody help me with that ?

    Thank you.
     
  3. robp

    robp Registered

    Joined:
    Mar 15, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    canada
    The cPanel backend does all the urchin processing itself; it doesn't use the urchin daemon or scheduler at all (and in fact forcibly shuts them off). Urchin profiles are created automatically (in theory) for each domain by cpanellogd, and the logs are processed by the same script at the same time that the analyzer stats etc. are updated. The actual data for each site is stored separately per-domain (normally under /home/domainname/tmp/urchin), not in the global urchin location (normally under /usr/local/urchin). The urchin stats link available for each site via the cPanel interface uses the per-site data (under /home/domainname/tmp/urchin), not the data stored under the global urchin directory.

    So there are basically two ways to use urchin with cpanel:

    1. Install urchin and run the urchin daemon (usually on port 9999) and scheduler; set up profiles for the domains you care about manually using the urchin administration interface, and schedule periodic updates via the urchin scheduler --- users can log into the urchin interface on port 9999 and view their stats that way, but not via the link in their cPanel interface: that link will point to the per-domain urchin data created by cPanel and show zeroes (at best) or errors (at worst) for the domain. You'll also have to live with cpanellogd shutting down your urchin daemons every time it processes the logs; alternatively you can hack cpanellogd to have it skip urchin processing or install a monitoring script to restart the urchin daemons as required. Obviously this approach is not the one intended by cpanel.

    2. Use the cPanel urchin integration. Shut off the urchin daemons and remove them from your startup scripts so they won't get started. Let cPanel process urchin data and store it per-domain, for each domain on your site. Users can see their urchin stats via the urchin link in their cPanel interface.


    I suspect that most people would opt for #2 if it actually worked. Unfortunately it really doesn't, for the following reasons:

    1. There's a bug in cpanellogd (not sure if it's corrected as of 9.1.0-C118) that prevents the profiles from getting created automatically for each domain, leading to errors of the "unable to find profile" variety when users click on the urchin stats link. That problem can be worked around -- simply create the profiles manually in the urchin interface, or via /usr/local/urchin/util/uconf-driver. Profiles must be named the same as the domain, without the leading www, e.g. mydomain.com, and log file sources must be labelled the same way, i.e. mydomain.com.

    2. Urchin can't actually read the log files in a default cPanel installation -- log files are by default 640 permission and need to be 644 for urchin to read them. Change that in your cPanel settings if you need to. If you don't, no urchin data will be generated for any of the profiles. Manually chmoding the log file permissions won't work -- cpanel will just change it back to 640 (or whatever you've got it set to).

    3. To use cpanel's Urchin integration, direct-linking must be enabled in Urchin. It's not clear whether cPanel's setting this flag in the urchin database -- it's supposed to, but if you're experiencing problem #1 you may be experiencing this problem as well. Solution: enable direct-linking from the urchin admin interface (or uconf-driver) if necessary.

    3. Assuming you fix problems #1, #2 and #3, Urchin itself seems to have an error creating backup data when run from the per-domain locations set up by cPanel. The same error doesn't exist if you run it from the global urchin location. You can see this yourself as follows:

    cd /usr/local/urchin
    bin/urchin -p mydomain.com


    That should process the logs for the profile called "mydomain.com", in the global urchin data location (which is actually unusable by cpanel). Then for the sake of comparison try this:

    cd /home/mydomain/tmp/urchin
    bin/urchin -p mydomain.com


    That does the same thing, only storing the urchin data under /home/mydomain/tmp/urchin, and it results in errors of the "unable to create backup" variety. In Urchin 5.1 the error is fatal -- the data remains "locked" for that profile and when the logs are next processed for that profile Urchin attempts an auto-rollback (which also fails, actually). In Urchin 5.5 the error still occurs but it's not fatal; you'll get no backups or rollback capability but you should at least be able to see the data that was generated. Solution: upgrade to Urchin 5.5, or keep 5.1 but edit each profile manually to turn off the backup and auto-rollback functions.

    Long story short, urchin and cpanel don't really play very well together at this time... mostly because cpanel's doing a bunch of things that don't quite work, and partly because of an issue in urchin 5.1. You can work around the problems using the info above if you're industrious or bored and you really, really must have urchin stats available from cpanel, or if you can live with running the urchin daemons yourself and screwing the cpanel integration. But people running the urchin daemons themselves should at least be aware that they're not operating in the way cpanel's designed to. I suspect (from reading various forums) that a lot of people are trying to get things to work by running the urchin daemons themselves, processing the logs manually or via the urchin scheduler and storing the resulting data in the global urchin location, and then seeing zeroes when they try to view urchin stats in cpanel (because the right profile exists but the data can't be found in /home/domain/tmp/urchin/data). If I hadn't already spent a bit of time this weekend getting things to work I wouldn't advise exerting a lot of effort here -- just wait for cPanel to fix the broken urchin integration or better yet use a different stats/reporting package (one that isn't so heavyweight and slow).

    helpfully,
    robp
     
  4. SiRCYRO

    SiRCYRO Registered

    Joined:
    Mar 27, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your reply robp. I'm going to try and use cpanel urchin integration. I was wondering if the urchin cpanel integration uses all the same profile information as the urchin daemon. My main concern is the stats updating frequency, since some sites I would like to process stats more often to provide more realtime stats. However the integrated urchin stats only seem to update when I run

    cd /home/mydomain/tmp/urchin
    bin/urchin -p mydomain.com

    I also get the "unable to create backup" error, which is not a huge deal to me. Is there any way to set the profile settings or even some urchin settings for the cpanel integration?

    Also, I'm noticing that when I use the urchin cpanel integration I get a "Reference Error: showInfo is not defined" error when I mouse over on the graph which it wasn't doing for the urchin daemons.

    Any insight?

    Matt
     
  5. robp

    robp Registered

    Joined:
    Mar 15, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    canada
    Whichever way you use urchin, i.e. via cPanel integration or in standalone mode, the urchin database (which contains all the profile information etc.) is the same. That's why you can set/repair broken or missing profiles for cPanel integration via the main urchin admin interface. It's the actual data from processing logs for each profile that gets stored in different locations (/home/domain/tmp/urchin/data vs. /usr/local/urchin/data).

    If you're using cPanel integration then you shouldn't be running the urchin daemon or scheduler. By extension, you're not going to get any custom per-profile scheduling -- you should get your urchin data updated when cPanel gets around to processing the log files. If you want them updated immediately you can invoke the urchin log file processor manually (as you did in your post) or you can run

    /scripts/runweblogs

    or

    /scripts/runlogsnow

    to update urchin etc. for the account(s) of your choice. You can try to manually tweak some cPanel configuration settings to have updates happen more frequently than normal if you don't mind messing with your config files. Or maybe just make your own cron job to update the stats on your own schedule; there are various things you can do.

    There are no specific settings in urchin for cPanel integration, aside from the requirement that you enable direct linking... if that's not enabled then you won't be able to view any urchin data from the cPanel interface. If you find the "unable to create backup" thing annoying you can edit the settings for each profile to turn off the backup and auto-rollback options (or invest some effort to figure out why the error occurs in the first place -- I haven't bothered as of yet).

    I hadn't noticed the "Reference Error: showInfo is not defined" error so I'm a bit mystified at the moment. I'll try to look into it later this evening from home, I don't have much access to anything at the moment.

    robp
     

Share This Page