I'm consulting for a Google Ads reseller. They use WHM and cPanel to interactively administer their client accounts. All of their client accounts use WordPress and have the Sucuri plugin installed. Sucuri stores logs in a php file in the /wp-content/uploads/sucuri/ folder. They want to be able to pull those files using a task scheduler and dump them into a database.
I didn't get very far with the Perl library -- it doesn't like Windows. I'm currently using the PHP but have tried the C# (the preferred option.)
I've worked out how to get the list of accounts from WHM. With that data I can then log into cPanel on the client sites.
What I'm trying to work out now is how to dig into the file tree on the client site. At present, even though I'm looking at the public_html folder,
I'm not seeing any of the WordPress folders or files.
Where to from here?
I didn't get very far with the Perl library -- it doesn't like Windows. I'm currently using the PHP but have tried the C# (the preferred option.)
I've worked out how to get the list of accounts from WHM. With that data I can then log into cPanel on the client sites.
What I'm trying to work out now is how to dig into the file tree on the client site. At present, even though I'm looking at the public_html folder,
Code:
$data = $cpanel->execute_action(
'3',
'Fileman',
'list_files',
'sshostin', array(
'dir'=>'/home/sshostin/public_html',
'type'=>'file|dir'
)
);
Code:
{
"module": "Fileman",
"result": {
"metadata": {
"transformed": 1
},
"messages": null,
"data": [{
"exists": 1,
"humansize": "4 KB",
"fullpath": "/home/sshostin/public_html/cgi-bin",
"file": "cgi-bin",
"size": "4096",
"absdir": "/home/sshostin/public_html",
"ctime": 1512349235,
"uid": 1059,
"gid": 1062,
"type": "dir",
"nicemode": "0755",
"mode": 16877,
"mtime": 1512349235,
"path": "/home/sshostin/public_html"
}
],
"errors": null,
"status": 1,
"warnings": null
},
"apiversion": 3,
"func": "list_files"
}