Onapp_CDN_billing_tool
1.0.0
Get CDN statistics from Onapp API, create a csv file and mail it to billing admin . Accounts deatils in billingSettings.xml
sudo apt-get -y install git
Make tmp directory and clone
cd /
sudo mkdir /tmp
cd /tmp
git clone https://github.com/Caripson/Onapp_CDN_billing_tool.git
sudo apt-get install php7.2
sudo apt-get install php7.2-xml
vi /tmp/Onapp_CDN_billing_tool/settings.php
$my_email = "[email protected]";
$my_apiKey = "API_KEY_FROM_ONAPP_CP";
$my_onappURL = "https://YOUR.URL.TO.ONAPP.CP";
$GMAILusername = "[email protected]";
$GMAILpassword = "PASSW0RD";
$GMAILfrom ="[email protected]";
$billingMAIL = "[email protected]";
$csvURL='/tmp/Onapp_CDN_billing_tool/' . getDateYear(). '-'. fixdate(getDateMonth()-1) . '_ouput.csv';
$MAILrecipient=array("[email protected]","[email protected]","[email protected]");
$MailaddCC=array("[email protected]");
$MailaddBCC=array("[email protected]");
vi /tmp/Onapp_CDN_billing_tool/billingSettings.xml
You are now done, run the script
php /tmp/Onapp_CDN_billing_tool/runme.php > /tmp/Onapp_CDN_billing_tool/ouput.csv
if you want latest update. Make sure to backup your settings before running the command.
/tmp/Onapp_CDN_billing_tool# git pull origin master
Setup crontab, Running the cronjob every first Monday of a Month.
crontab -e
0 9 1 * * /usr/bin/php /tmp/Onapp_CDN_billing_tool/runme.php
CSV Screenshot
Mail Screenshot
Unless stated otherwise all works are licensed under MIT License. PHPMailer is licensed under GNU Lesser General Public License v2.1
Become a contributor to this project!
No sponsors yet! Will you be the first?
Become a contributor to this project!
Hey dude! Help me out for a couple of ?!