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.

listaccts, Fetch CSV, CPanel::Accounting

Discussion in 'General Discussion' started by bradandersen, Mar 24, 2005.

  1. bradandersen

    bradandersen Active Member

    Joined:
    Oct 6, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I would simply like to get a CSV listing of all of my accounts. Fetch CSV only appears to print "/var/cpanel/root.accts" which only appears to be the first 30 accounts. Can someone fix this or do you have CPanel::Accounting script or simple Perl script that will dump the list account screen out in CSV format?

    Thanks,
    Brad
     
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Same here, any solution yet?
     
  3. Salman75

    Salman75 Well-Known Member

    Joined:
    Jan 20, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    Yes, I have the same problem too - on ALL servers.

    Even when i already clicked on showall, fetchcsv still shows the first 30 accounts.

    Salman
     
  4. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Using the accounting method I only get a return of 13 lines

    equire '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = "localhost";
    $user = "root";
    $accesshash = 'hash_goes_here';

    $accts = listaccts($host,$user,$accesshash,0);
    foreach ($accts as $label => $content) {
    echo "$label: $content[0]<BR>\n";
    }

    Any ideas why so few. there are 100 domains listed on the server.

    30 when I do the fetcsv
     
  5. benito

    benito Well-Known Member

    Joined:
    Jan 8, 2004
    Messages:
    296
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Mar del Plata - Argentina
    I have one method to extract all account info.

    1 - Open your WHM on FIREFOX <<<--- important, explorer do not work
    2 - Go to list acounts
    3 - List ALL
    4 - Select all and copy
    5 - In a good text editor ( ultraedit 32 ) paste all the copied text.
    6 - Save as list.txt
    6 - Open Excel
    7 - Open File
    8 - Choose TXT or CSV files.
    9 - Open your List.txt file.
    10 - Choose TAB delimited.
    11 - Done, you got your nice list on excel.

    Internet Explorer do not save the columns separated by tabs, so if you use it, in excel cannot import correctly yout CSV.
     
  6. ckizer

    ckizer Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    129
    Likes Received:
    0
    Trophy Points:
    16
    heh a true "cpanel" style workaround. hackish to the extreme :P
     
  7. Salman75

    Salman75 Well-Known Member

    Joined:
    Jan 20, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    This is very painful is you have over 1000 accounts on a server.

    Salman
     
  8. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    This behavior has changed in the latest EDGE, fetchcsv will now always show all accounts.
     
  9. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    This method works the same for 1 account or 10,000
    Same number of steps. Same number of files. Same easy way.
     
  10. Salman75

    Salman75 Well-Known Member

    Joined:
    Jan 20, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16

    Have you tried to do this on a box with over a 1000 accounts? I tried and my laptop (Centrino 1.7 GHz, 1 GB RAM) took quite some time to copy and transfer to an excel sheet.

    Salman
     
  11. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    I frequently use this method with text files that have 30-50K lines of data when I want to parse them up. Doesn't take my laptop long to do it at all.
     
  12. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    You can go another method too.

    View Source.
    Save as .html
    Open as html in XLS
    Manipulate as needed.

    Another method. Open in Excel as HTML. Save as Tab Delimted Text.
    Re-open in Excel so you get rid of all the web formatting.


    Should take 5 minutes tops.

    Using the original method your storing it in RAM. Much faster to save it as an html page and then follow the steps here.
     
  13. bradandersen

    bradandersen Active Member

    Joined:
    Oct 6, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Thanks all

    Thanks everyone for the suggestions and thank you CPanel team for getting it into the EDGE, however, I will wait for it to trickle down to STABLE before I can verify it.

    Thanks again,
    Brad
     
  14. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    So what should I do to make my CPanel server (WHM 10.0.0 cPanel 10.0.0-R143 Fedora i686 - WHM X v3.1.0) display all records, and not only first 30 of 600?
     
  15. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    495
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Los Angeles California
    Aren't we slow?!!
    This bug has been around for a long time and we only noticed it now. LOL

    And the Fetch CSV doesn't show the contact email.
    Was it deliberate?
    I just want to know if the Contact Email is going to be fixed or not.I am tempted to create my own fetchCSV module using regex.
     
    #15 Roy@ENHOST, Apr 5, 2005
    Last edited: Apr 5, 2005
  16. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I get all accounts on servers;

    WHM 10.0.0 cPanel 10.1.0-C7
    RedHat 8.0 i686 - WHM X v3.1.0
     
  17. Aric1

    Aric1 Well-Known Member

    Joined:
    Oct 15, 2003
    Messages:
    324
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    For as long as I've used CPANEL, the Fetch CSV hasn't ever included all the information that you get from the display itself in WHM. The only thing that works is copying the list all output from WHM.

    Some day they will fix this... I hope... :)
     
  18. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    I don't argue, most of our servers with similar configuration works fine, but not all. :-(
     
  19. rhodesy

    rhodesy Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    305
    Likes Received:
    0
    Trophy Points:
    16
    How would you like a script that does this for $10?
     
  20. rhodesy

    rhodesy Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    305
    Likes Received:
    0
    Trophy Points:
    16
Loading...

Share This Page