Statistics Wrong

Discussion in 'General' started by tal56, Aug 1, 2008.

  1. tal56

    tal56 Member

    Hi guys,

    I just changed the config.inc.php to allow for correct statictics according to this page : http://www.howtoforge.com/ispconfig-2.x-first-steps-p2

    However my stats seem to be wrong. For example my site Web13 says 0 disk space used, but I know it should be around 2 megs or so, in a users maildir.

    The command "repquota -avug" gets me this :

    So it seems to show a correct usage of around 2MB for Web13. So why does ispconfig stats show 0 used? Is it because the disk space stats are only updated once a day and I need to wait for the update to occur? I'm runnig the newest ispconfig and Centos 5.2. Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Maybe you run ISPConfig with mbox format instaed of maildir. mailboxes in mbox format are not shown in the statistics as they are not within the website tree.
     
  3. tal56

    tal56 Member

    Hi Till,

    Sorry I should have mentioned, I'm definitely using maildir not mbox. Before I made the change to sudo it showed around 700kb being used for Web13, which basically dosen't account for the maildir stuff, however now it shows 0 used, and the sudo change is the only thing I've done.

    Also my other websites statistics are wrong also, one show like 500kb used when it should be a few megs worth in web/email space, and the rest all show 0kb used.

    Please help with this, I can provide any log or screen prints requested. Thanks


    EDIT : From what I can see the only space ispconfig is seeing as used is the mysql space. The web/email space always shows 0kb. So the only sites that are showing anything other than 0kb are sites that have a mysql database.
     
    Last edited: Aug 1, 2008
  4. tal56

    tal56 Member

    Ok, I've changed everything back and it seems to be working again, but with the incorrect stats because it's missing the maildir space used.

    The only things i've changed back are :

    config.inc.php changed the use sudo option to a "0" again instead of 1

    config.inc.php changed the encryption back to crypt from md5

    visudo removed the admispconfig line added from the initial settings howto

    Kinda stumped why any of those would affect it, but it would seem that ispconfig can't get the files diskspace used as they are not even listed, only the mysql space is listed before I changed those settings back. Now all the folders are listed again.

    Thanks for any suggestions from anyone who's done this.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    To find out why the procedure does not work on your system:

    1) add the admispconfig settings for sudo.
    2) run:

    su admispconfig

    to become ispconfig user, so you get the same resiults as the controlpanel. Then change to a web directory:

    cd /var/www/www.domain.com

    and execute the command:

    du -h --max-depth=1

    and check if the output is correct or if you get any error messages. ISPConfig is just displaying the output of this cammend in the interface.
     
  6. tal56

    tal56 Member

    Done some more testing, this is what i've found so far :

    When I add the line :

    admispconfig ALL=(root) NOPASSWD:/usr/bin/du

    to my visudo file and run the command you suggested Till, I still don't seem to have permission to the maildir files, getting this :

    Which is exactly the same as I get without that line in visudo.

    Also what I've noticed is it seems to be this line that totally blanks out the diskspace :

    $go_info["server"]["sudo_du_enabled"] = 0; // enable sudo for gathering website file usage

    When I change that to a 1 instead of the 0, then my stats don't show anything at all except the mysql data.
     
    Last edited: Aug 2, 2008
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    It looks like your sudo is not working or installed correctly pn your system as it has no affect at all. Which Linux distribution do you use?

    Thats just the symptom and not the cause.
     
  8. tal56

    tal56 Member

    Centos 5.2 upgraded recently from 5.0

    Any chance for fixing the /etc/sudoers file? Should I reinstall sudo? Thanks
     
    Last edited: Aug 2, 2008
  9. tal56

    tal56 Member

    Till, I've done some looking around on sudo and it would seem even if I add admispconfig to the /etc/sudoers file according to the howto, I still need to type "sudo" to run the du command, the only difference is I don't need a password.

    So instead of the

    du -h --max-depth=1

    command you asked me to test with, which still says permission denied. I tried the line :

    sudo du -h --max-depth=1

    and that worked beautifully. Is this in fact how it's supposed to work? If so is there a bug in ispconfig that's calling that command incorrectly when I turn on that option in the config.inc.php file? Should it be calling it via "sudo du -h --max-depth=1" instead of just "du -h --max-depth=1" ?

    Maybe this is just for Centos as well? But it would seem my /etc/sudoers file does work as the NOPASSWD option certainly is working.

     
    Last edited: Aug 2, 2008
  10. tal56

    tal56 Member

    Ok more searching into this, I found out centos logs the sudo command to /var/log/secure and I have this error that seems to occur when I check statistics in ispconfig while the option to use sudo is set to 1 in config.inc.php

    Aug 1 10:33:14 server1 sudo: admispconfig : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/home/admispconfig/ispconfig/web/multidoc/edit ; USER=root ; COMMAND=/usr/bin/du -h --max-depth=1 /var/www/web2

    but i'm not sure what's the best way to fix this. I've found some info that suggest this :

    from the sudo man pages, and someone suggested turning those options off. Is that safe to do? Or is there any other way to fix that? Thanks
     
  11. tal56

    tal56 Member

    Well I think I resolved this, but I think it's a but that either needs to be fixed with ispconfig or an addition to the perfect install howto for Cento 5.x

    By default the "requiretty" option should be OFF, but in a Centos 5 install, it is set to ON, so I had to comment out the line to change back to it's default of OFF.

    Now my stats are working fine, however I still get lines like below each time someone checks stats on ispconfig. Is there anyway to set the TTY, so we don't get these errors?


     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    This seems to be a centos only problem. We can add a note to the perfect setup. This is nothing that can be fixed or changed in ISPConfig itself.

    No, as the user admispconfig is not logged in and so he has no tty.
     
  13. tal56

    tal56 Member

    Well thats ok, I'm just glad It should help those after me :)
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Thank you for finding a solution for the problem :)
     
  15. jbravo

    jbravo Member

    Above action should do the trick:)

    On my SLES10SP2 default config worked without above modification.
     
    Last edited: Dec 10, 2008

Share This Page