Get Started
Company
Copyright © 2022. Logaholic Web Analytics BV
The Logaholic Cloud Manager allows you to bundle multiple Logaholic installations (on the same or on multiple servers) into a “cloud” of servers which you can manage as a single Logaholic installation. This allows you to create centralized management of Logaholic accounts, profiles and subscriptions for hundreds of thousands of users.
The API for Logaholic Cloud Manager provides a framework that allows you to integrate Logaholic server, user, profile and subscription management features into your existing back-end systems.
The API has the following features:
To install the Logaholic Cloud Manager, simply copy the contents of the www folder from your download file to a web accessible location on your server.
Next open a browser and navigate to the install.php file, for example:
http://localhost/cloud_manager/install.php
Follow the steps on the screen.
Next, go to Global Settings and click “Enable Cloud Manager” and provide the information requested.
This Logaholic installation is now ready to act as the Cloud Manager UI.
1. To install the Logaholic Cloud API, simply copy the cloud_api folder from your download file to a location on your server.
* If you want to be able to access the API’s functions via HTTP requests, place the “cloud_api” folder in a web accessible directory.
* If you only want command line access to the API’s functions, choose an non web accessible location on your server and ensure the api folder has the appropriate permission levels.
2. Open the following file in an editor and enter the appropriate values.
The values in red above are examples and should be replaced with your actual values.
That’s it. You are now ready to use the API for server management tasks.
In the examples below, we’ll pretend the Logaholic Cloud Manager API files are installed in /var/www/cloud_api and can be reached via “http://localhost/cloud_api”.
When accessing the API via HTTP, requests should look something like this:
When accessing the API via the command line shell, commands should look something like this:
Possible values for action and other key/value pairs will be described below. For the sake of simplicity, we’ll only provide examples of HTTP requests below, but these can all be transformed into the command line equivalents using the example above.
The API always returns json encoded data as output that contains if it succeeded or not and for which installation the call was made.
Examples:
To connect a Logaholic to your cloud system, you’ll need to make a request using the following parameters:
Parameter | Value | Notes |
---|---|---|
action | addserver | Tells the API we want to add a server |
install_name | string | Give your Logaholic installation a name (this is used as an identifier). |
install_url | string | The url to the Logaholic Installation you want to connect with |
server_api_password | string | The API password of the installation |
server_api_path | string | For local installs (hosted on the same machine as the Cloud manager) provide the absolute path to the API of the installation. For remote installs (logaholic installation hosted on a different physical server) provide the HTTP address to the remote cloud API |
A simple API request to add an installation could look like this:
To edit a Logaholic connection, you’ll need to make a request using the following parameters:
Parameter | Value | Notes |
---|---|---|
action | editserver | Tells the API we want to edit a server |
edit_install_name | string | This is the name of the installation you want to edit. |
install_name | string | Give your Logaholic installation a name (this is used as an identifier). |
install_url | string | The url to the Logaholic Installation you want to connect with |
server_api_password | string | The API password of the installation |
server_api_path | string | For local installs (hosted on the same machine as the Cloud manager) provide the absolute path to the API of the installation. For remote installs (logaholic installation hosted on a different physical server) provide the HTTP address to the remote cloud API |
A simple API request to edit an installation could look like this:
To delete a Logaholic connection, you’ll need to make a request using the following parameters:
Parameter | Value | Notes |
---|---|---|
action | removeserver | Tells the API we want to remove a server |
install_name | string | Give the Logaholic installation name you want to delete. |
A simple API request to delete an installation could look like this:
The Logaholic Cloud Api accepts the parameter install_name with all the user/profile requests to define which installation the action must be completed for.
If there is no install_name given with the request; The system chooses the best installation for you. This is done by selecting the installation with the least amount of profiles.
To add users to your logaholic system, you’ll need to make a request using the following parameters:
Parameter | Value | Notes |
---|---|---|
action | adduser | Tells the API we want to add a user |
username | string | – Any alphanumeric string up to 100 characters length |
password | string | Any md5 of your password. |
Optionally, you can add the following parameters: | ||
fullname | string | – The users full name, e.g. John Doe – Any alphanumeric string up to 100 characters length |
string | – The users email address – Any alphanumeric string up to 100 characters length |
|
accessEditProfile | 0 or 1 | – Controls whether the user can Edit certain profile settings – 0 = No, 1 = Yes – Default 1 |
accessAddProfile | 0 or 1 | – Controls whether the user can add new profiles from the Logaholic UI – 0 = No, 1 = Yes – Default 0 |
accessUpdateLogs | 0 or 1 | – Controls whether the user can manually Update statistics from the Logaholic UI – 0 = No, 1 = Yes – Default 0 |
active | 0 or 1 | – Controls whether the user account is active and can log in – 0 = No, 1 = Yes – Default 1 |
expires | 0 or timestamp | – Controls whether the user account expires at a certain point in time. If left to ‘0’, the account never expires. Otherwise, it expires when the unix timestamp value is met. – Default 0 |
subscriptionid | int | – The id of the subscription you want to add to the user. – Default 0 |
subscriptionname | string | – The name of the subscription you want to add to the user. – Default ” |
install_name | string | – With this you can tell the api to add the user to a specific installation |
A simple API request to add a user could look like this:
If the operation is successful the script will return the following string:
If the request fails, it will output an error message.
To Edit a Logaholic user account with the API, you can follow the instructions for adding users above, with these exceptions:
Parameter | Value | Notes |
---|---|---|
action | edituser | Tells the API we want to edit a user |
new_username | string | – Any alphanumeric string up to 100 characters length – This can be the same as the original username, or a different string, but the parameter must be present |
A simple API request to edit a user could look like this:
If the operation is successful the script will return the following string:
If the request fails, it will output an error message.
To delete a user account, use the following parameters:
Parameter | Value | Notes |
---|---|---|
action | deleteuser | Tells the API we want to delete a user |
username | string | The username of the user you want to delete |
A simple API request to delete a user could look like this:
If the operation is successful the script will return the following string:
If the request fails, it will output an error message.
When adding a website profile to Logaholic through the API, it’s important to note the following:
* If no profile name is given, the API automatically generated a profile name based on the site’s (sub) domain. For example, adding a profile for www.test-me.com, would generate a profile name called ‘wwwtestmecom’.
* Using the API only a limited number of profile settings can be set. Other settings must be changed via the regular UI.
* When a log file location is not provided, we assume the profile will be using javscript tags to collect data.
To add a website profile via the API, you can use the following parameters:
Parameter | Value | Notes |
---|---|---|
action | addprofile | Tells the API we want to add a profile |
username | string | – The username of the account that owns this site – The username must exist, so always add users before adding profiles |
site | string | Any (sub)domain, e.g. www.mysite.com |
Optionally, you can add the following parameters: | ||
profile_name | string | – The name you want to give this profile in the logaholic system – If this parameter is missing, the profile name is automatically derived from the site parameter |
logfilelocation | string | – The system path to the log file or the directory that contains the log files for this site – If this parameter is missing, the profile is set up to use Javascript data collection |
splitlogs | 0 or 1 | – Indicates whether the logfilelocation parameter points to a single log file, or to a directory containing multiple log files – 0 = Single file, 1 = Directory (multiple files) – Default 1 |
splitfilter | string or (regular expression) | This parameter can be used to avoid unwanted files in the directory to be analyzed. For example, if all your log file names start with “access_log”, use that as the value for this parameter. Only files that (partially) match this value will be analyzed. Leave this blank if all files in the logfilelocation directory need to be analyzed. If you require more complex filtering capabilities, you may also enter a regular expression, between parenthesis. For example (^www\.[xyz|abc.xyz].log.*) |
activated | 0 or 1 | – Use this option to activate an profile. (1 = active or 0 = not active) – default 0 |
An API request to add a profile could look like this:
If the operation is successful, the script will return the following string:
If the request fails, it will output an error message.
To edit a website profile via the API, you can use the following parameters:
Parameter | Value | Notes |
---|---|---|
action | editprofile | Tells the API we want to edit a profile |
username | string | – The username of the account that owns this site – The username must exist, so always add users before adding profiles |
site | string | Any (sub)domain, e.g. www.mysite.com |
Optionally, you can add the following parameters: | ||
profile_name | string | – The name you want to give this profile in the logaholic system – If this parameter is missing, the profile name is automatically derived from the site parameter |
logfilelocation | string | – The system path to the log file or the directory that contains the log files for this site – If this parameter is missing, the profile is set up to use Javascript data collection |
splitlogs | 0 or 1 | – Indicates whether the logfilelocation parameter points to a single log file, or to a directory containing multiple log files – 0 = Single file, 1 = Directory (multiple files) – Default 1 |
splitfilter | string or (regular expression) | This parameter can be used to avoid unwanted files in the directory to be analyzed. For example, if all your log file names start with “access_log”, use that as the value for this parameter. Only files that (partially) match this value will be analyzed. Leave this blank if all files in the logfilelocation directory need to be analyzed. If you require more complex filtering capabilities, you may also enter a regular expression, between parenthesis. For example (^www\.[xyz|abc.xyz].log.*) |
activated | 0 or 1 | – Use this option to activate an profile. (1 = active or 0 = not active) – default 0 |
An API request to add a profile could look like this:
If the operation is successful, the script will return the following string:
If the request fails, it will output an error message.
To delete a profile from the logaholic system, you can use the following parameters:
Parameter | Value | Notes |
---|---|---|
action | deleteprofile | Tells the API we want to delete a profile |
username | string | – The username of the account that owns this site – The username must exist, or the profile will not be deleted |
site | string | The (sub)domain you want to delete the Logaholic profile for |
An API request to delete a profile could look like this:
If the operation is successful the script will return the following string:
If the request fails, it will output an error message.
Within Logaholic you can create subscriptions for your users. To be able to share your subscriptions with your other Logaholic installations we added this option to do so.
To use this you first need to have created a subscription on one of your installations.
Click here for more information.
To synchronize subscriptions over your logaholic systems, you can use the following parameters:
Parameter | Value | Notes |
---|---|---|
action | syncsubscription | Tells the API we want to synchronize subscriptions |
install_name | string | – Select the source installation from you wish to synchronize the subscription packages. |
Optionally, you can add the following parameters: | ||
include | array | – Select the installations you wish to synchronize the subscriptions to. ( if this is not set it synchronizes to all installations ) |
For the next example we say we have three installations and we want to synchronize the subscriptions from ‘Test’ to the other installations.
An API request to synchronize the subscriptions could look like this:
If the operation is successful the script will return the following string:
If the request fails, it will output an error message.
With the Logaholic Cloud Manager you have multiple installation and you want to give your users a quick login url without searching for it.
The api provides two actions to let your user login:
To successfully use these actions the api accepts the two following parameter methods:
The Logaholic Cloud Manager keeps user and profile data local to be able give you a fast overview and api result. But if there are changes made in an installation without using the Cloud Api then the Cloud Manager could be wrong or incomplete from that moment.
The “cloudCron.php” command line script allows you to automatically keep the Cloud Manager up to date. The script is located in the following directory:
This script can only be started from the command line and will update the data in your Cloud Manager.
Usage:
Example: In a scheduled cron job, this command can be set up to run every hour at minute 55 like this: