listaccts, Fetch CSV, CPanel::Accounting

bradandersen

Active Member
Oct 6, 2003
42
0
156
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
 

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
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
 

benito

Well-Known Member
Jan 8, 2004
398
14
168
Mar del Plata - Argentina
cPanel Access Level
Root Administrator
Twitter
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.
 

Salman75

Well-Known Member
Jan 20, 2004
102
0
166
benito said:
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.
This is very painful is you have over 1000 accounts on a server.

Salman
 

WestBend

Well-Known Member
Oct 12, 2003
173
0
166
Salman75 said:
This is very painful is you have over 1000 accounts on a server.

Salman
This method works the same for 1 account or 10,000
Same number of steps. Same number of files. Same easy way.
 

Salman75

Well-Known Member
Jan 20, 2004
102
0
166
WestBend said:
This method works the same for 1 account or 10,000
Same number of steps. Same number of files. Same easy way.

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
 

WestBend

Well-Known Member
Oct 12, 2003
173
0
166
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.
 

WestBend

Well-Known Member
Oct 12, 2003
173
0
166
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.
 

bradandersen

Active Member
Oct 6, 2003
42
0
156
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
 

anton_latvia

Well-Known Member
PartnerNOC
May 11, 2004
410
17
168
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?
 

[email protected]

Well-Known Member
Mar 5, 2002
487
0
316
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.
 
Last edited:

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
I get all accounts on servers;

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

Aric1

Well-Known Member
Oct 15, 2003
324
0
166
cPanel Access Level
DataCenter Provider
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.
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... :)
 

anton_latvia

Well-Known Member
PartnerNOC
May 11, 2004
410
17
168
Latvia
cPanel Access Level
Root Administrator
asmithjr said:
I get all accounts on servers;
I don't argue, most of our servers with similar configuration works fine, but not all. :-(