Personal tools
Namespaces

Variants
Actions

IP Manager For WHMCS

From ModulesGarden Wiki
(Difference between revisions)
Jump to: navigation, search
(Integration Code)
(Create IP Pool)
Line 195: Line 195:
 
===Create IP Pool===
 
===Create IP Pool===
 
{|
 
{|
|style="padding: 10px 0px 30px 15px;"|In order to add a new IP addresses pool, go to '' 'IP Pool' '' → '' 'Create IP Pool' ''.
+
|style="padding: 10px 0px 20px 15px;"|In order to add a new IP addresses pool, go to '' 'IP Pool' '' → '' 'Create IP Pool' ''.
 +
|}
 +
{|
 +
|style="padding: 0px 0px 30px 25px;"|[[File:IPM7_1.png]]
 
|}
 
|}
 
====CIDR Notation====
 
====CIDR Notation====

Revision as of 16:53, 18 December 2014

Contents

About IP Manager For WHMCS

Article update is ongoing on this page, watch out for broken links and unclear descriptions!
We are sorry for the inconvenience caused.

IP Manager For WHMCS allows you to conveniently add and manage IP pools, and automatically assign IP addresses to your servers, products, addons or configurable options.

With our module you will be also able to assign an IP pool for a specified client, integrate with 3rd party applications like cPanel, export IP pools or view clear graphs.
You will also be able to synchronize IP addresses used by products in your WHMCS system with IP Manager IP pools.
What is more, IP Manager For WHMCS will allow your customers to easily manage their IP addresses from the WHMCS client area.

  • Admin Area Features:
✔ Create Multiple Configurations For The Multiple Scenarios Of The Assigning
✔ Create Multiple Relations In One Configuration For Products, Addons, Configurable Options Or Servers
✔ Assign Pool For Specified Client
✔ Add Pool In CIDR Notation
✔ Add Pool By An IP Addresses Range (IPv4 Only)
✔ Add Pool By An IP Addresses List (IPv4 Only)
✔ Export IP Pools With The Information Assignment To XML And CSV Format
✔ View Whole IP List From A Specified Pool
✔ IPv6 Pools Relying On IP Addresses Range And Assigned IP Addresses (Free IPv6 Addresses Are Not Stored In Database)
✔ Synchronize IP Addresses Used By Products In WHMCS System With IP Manager
✔ Filter Data In The IP Addresses List
✔ Exclude Selected IP Addresses From A Pool During Pool Creation
✔ Delete Single IP Address Or A Bunch Of IP Addresses From An Existing Pool
✔ Integrate IP Through Assigning With The 3rd Party Applications: cPanel, cPanel Extended, Plesk and Parallels Cloud Server
✔ Create New Integration Modules
✔ Manual Assigning/Unassigning The IP From Pool For Specified Client Service
✔ Automatic Choosing The First Free IP Address In The Configuration Related Pools
✔ Automatic Creating Of Pools If Required During The Import Process
✔ View Information When The Configuration Assigned Pools Has No More Free IP Addresses Inside
✔ Omit Dedicated IP Fields For Specific Configuration
✔ Usage Of Selected Custom Field
✔ Intelligent IP Assigning For Related Configurable Options With The 'Quantity' Type
✔ Email Reminder When Percentage Usage Of Any Pool Will Be Exceeded
✔ Configuration Of Integration Method (cPanel & cPanel Extended)
✔ Clean Graphs That Shows Current Usage Of The IP Pool Grouped By Months
✔ IP Pool Usage Statistics Presented By Numbers And Progress Bars With Different Colors Dependant On The Usage Of The Pool
  • Client Area Features:
✔ Manage IP Addresses
✔ Integration With WHMCS Client Area
  • General Info:
✔ Supports IPv4 and IPv6
✔ Multi-Language Support (Both Admin Area and Client Area)
✔ Supports WHMCS V5 and Later
✔ Supports PHP 5.0 and Later

Installation

This tutorial will show you how to successfully install and configure IP Manager For WHMCS.

We will guide you step by step through the whole installation and configuration process.

1. Log in to your client area and download IP Manager For WHMCS.
IPM1.png
2. Upload and extract the module into the main WHMCS directory.

Files in your WHMCS directory should look like this.

IPM2.png
3. When you install IP Manager for the first time you have to rename 'license_RENAME.php' file.

File is located in 'modules/addons/ipmanager2/license_RENAME.php' . Rename it from 'license_RENAME.php' to 'license.php' .

IPM3.png
4. In order to configure your license key, you have to edit a previously renamed 'license.php' file.

Enter your license key between quotation marks as presented on the following screen. You can find your license key in your client area → 'My Products' .

IPM4.png
5. Remove all files from 'tempates_c' folder located in your WHMCS root directory.
6. Now you have to activate the module in your WHMCS system.

Log in to your WHMCS admin area and go to 'Setup' 'Addon Modules' .
Afterwards, find 'IP Manager' and press 'Activate' button.

IPM5.png
7. In the next step you need to permit the access to the module.

Click on 'Configure' button, tick desired admin roles and press 'Save Changes' .

IPM6.png
8. Last step is setting chmod 755 to 'storage' folder.

Folder is located in 'you_whmcs/modules/addons/ipmanager2' .

IPM6.1.png
9. You have just successfully installed IP Manager!

You can access your module at 'Addons' 'IP Manager' .

IPM7.png

Configuration and Management

IP Manager For WHMCS allows you to manage dedicated IP addresses pool, automatically assign it to clients/products/servers/addons/configurable options.

IP Manager supports both IPv4 and IPv6.
Module enables clients to manage and order dedicated IP addresses.
In this short guide we will present you the possibilities of our module.

IP Pools

To manage any IP pool via IP Manager you have to add it first.

They are three ways to do that. You can use CIDR notation, enter IP range or IP addresses list.
Note 1: IP range and IP list are supported only for IPv4.
Note 2: IPv6 pools are relying on IP addresses range and store in the database only assigned IP addresses.
Therefore free IPv6 addresses will not be visible in the IP pool overview.

Create IP Pool

In order to add a new IP addresses pool, go to 'IP Pool' 'Create IP Pool' .
IPM7 1.png

CIDR Notation

Select 'Classless Inter-Domain Routing (CIDR)' .

Select IP version, type first IP from a pool and a netmask (in prefix notation).
Note: First IP from the pool should be compatible with CIDR notation.

IPM8.png
You can exclude any number of IP addresses from the pool.

To do so, enter them into 'Excluded IP Addresses:' textbox, one IP address or IP range per line.
Additionally, you can exclude boundary IP addresses through marking 'Exclude Boundary IPs' checkbox.
If you want to set nameservers and gateway click on 'Toggle Advanced Settings' .
Otherwise, press 'Add Pool' button and your IP pool will be created.

IPM8 1.png
Enter nameservers and gateway address into textboxes as shown on the screen below (This step is optional).

Afterwards, confirm the creation of an IP pool through pressing 'Add Pool' button.

IPM8 2.png

IP Addresses Range

Select 'IP Range' .

Type the first and the last IP address of a pool you wish to add.

IPM8 3.png
You can exclude any number of IP addresses from the pool.

To do so, enter them into 'Excluded IP Addresses:' textbox, one IP address or IP range per line.
Additionally, you can exclude boundary IP addresses through marking 'Exclude Boundary IPs' checkbox.
You should also enter netmask in which your IP pool fits in.
If you want to set nameservers and gateway click on 'Toggle Advanced Settings' .
Otherwise, press 'Add Pool' button and your IP pool will be created.

IPM8 4.png
Fill out nameservers and gateway address textboxes as shown on the screen below (This step is optional).

Afterwards, the confirm creation of a IP pool through pressing 'Add Pool' button.

IPM8 5.png

List of IP Addresses

Go to 'IP Pools' tab and select 'One or more single IP Addresses' .

Type IP addresses you want to add, separated by comma, after typing last IP address press 'Enter' button.
Afterwards, confirm creation of IP pool through pressing 'Add Pool' button.
Note 1: Using this option, you can only add IPv4 addresses.
Note 2: For each IP address added by this method, one IP pool will be created.

IPM8 8.png

Show IP Pools

To manage a previously created pools, proceed to 'IP Pool' 'Show IP Pools' .

As you can see on the following scree, you can find here details of each IP pool.

IPM8 6 1.png

Additional Information

You can edit IP pools additional information even after creation of a pool.

To do so, press on option you want to alter.

IPM8 6.png
Afterwards, enter new value and press save button as shown on the screen below.
IPM8 7.png

Custom Fields

IP Manager allows you to specify custom fields per IP pool.

To add a new custom field, press 'Create a New Custom Field' .
Afterwards, fill out the form with custom field name and value.

IPM8 9.png

Assign To A Client

If you want to assign a pool of IP to specific client, our module makes it available to you.

You can achieve that through using auto-complete textbox to find and choose client and pressing 'Save Changes' button.
Note: IP addresses will be added to all products ordered by client.

IPM9.png

IP Pool Details

To view IP pool details press on its address as shown on the following screen.
IPM10.png
In IP pool view you can find information about current assignment of IP addresses from pool and manually manage their assignment.

To facilitate the management of addresses we also added records filters.
Note: The screen below presents IP pool view with manually assigned service 'mytestingdomain.com'.

IPM11.png

Bulk Actions

Our module supports actions on multiple IP addresses.

To issue such action, mark involved IP addresses and choose desired action from 'Action For Selected IP Addresses' dropdown menu.

File:IPM10xx.png
*Delete From The Pool as its name suggest removes IP addresses from a pool.
  • Unassign removes IP addresses from products they were assigned to, IP addresses stays in the pool.
  • Unassign Using Submodules works in the same way as Unassign does.

Additionally, it removes IP addresses from external servers.

  • Assign is the most interesting option, it allows you to:
    • Choose a product to which IP addresses should be assigned.
    • Define whether or not to use 3rd party integration module.
    • Set them as assigned without assigning them to any product. You can also add a note to involved IP addresses.
File:IPM11.1xx.png

Custom Fields For IP Addresses

Additionally, you can assign custom field to IP address.

Some 3rd party integration submodules may need additional information provided along with IP address (like MAC address) this it place to add them.
To add custom field, press 'Add a New Custom Field' next to IP address you want to assign custom field to.

IPM11 2.png
Afterwards, fill 'Custom Field Name' and 'Custom Field Value' fields and press 'Save Changes' .
IPM11 3.png

IP Assignment Mechanism

It is crucial to understand mechanism of automatic IP addresses assignment. In this section we will clarify it to you.

'IP Quantity' field defines quantity of IP addresses added to ordered product by triggering a specific relation.
Two and more relations from one configuration can be triggered for the same product (therefore, multiple quantity of IP addresses can be assigned).
Additionally, if you set up two configurations with the same relation, IP addresses from both configurations will be added.
Therefore, if you set up these two configurations at IP Manager:

  • Configuration 1: Addon A (IP Quantity = 2), Product C (IP Quantity = 1)
  • Configuration 2: Addon A (IP Quantity = 2), Addon B (IP Quantity = 2), Product D (IP Quantity = 3)

Orders listed below will trigger different relations:

  • Order 1: Product C with addon A: 5 IP addresses assigned
  • Order 2: Product C with addon B: 3 IP addresses assigned
  • Order 3: Product D with addon A: 7 IP addresses assigned
  • Order 4: Product F with addon A: 4 IP addresses assigned

Automatic IP Assignment

Main reason for creating this module was to automatize the assignment of IP addresses.

Here we will show you how to set up configuration for it. In order to start, go to 'Configuration' 'Create Configuration' .
Type your configuration name, press textboxes corresponding to options you wish to add and select them from dropdown menus.
Afterwards, press 'Create New Configuration' button. On the screen below you can see sample configuration with two products.

IPM12.png
Now you have to assign at least one IP pool to configuration. You can do it through pressing 'Assigned Pools' button.
IPM13.png
Next, choose IP pool from a dropdown menu and press 'Add Pool' button.

Keep in mind that you can assign multiple pools to a single configuration.

IPM14.png

Advanced Configuration

Lets say, that you want to set multiple IP assignment to specific product or so on, it is available with our module!

Here we will show you how to set up multiple IP addresses assignment to configurable option 'Extra IP Addresses' .
Create a new configuration as while setting up standard configuration.
When you are done press on 'Configurable Options' as shown on the screen below.

IPM15.png
Afterwards, mark checkboxes next to configurable options you want to assign IP addresses to.

Enter quantity of IP addresses which will be assigned to each configurable option and press 'Save Changes' .

IPM16.png

Usage Graph

In each configuration you can find graph, which shows the statistics of IP addresses assignment.
IPM17.png

3rd Party Integration

In this tab you can set up 3rd party integration which allows you to manage IP through our module in your WHMCS and synchronize changes on 3rd party servers.

Note 1: Some of these integration submodules requires to set up free IP pools (cPanel) or IP addresses (Plesk) on servers.
Note 2: IP Manager can integrate multiple IP addresses to a single product.

Enabling 3rd Party Integration

Activation of all integration modules looks similar, there is only a difference for cPanel and cPanel Extended integration submodules.

Start by pressing 'Activate' button next to a module you want to activate.

IPM18.png
Press 'Configure' button and assign configurations to it.

Confirm through clicking 'Save Changes' .

IPM19.png
cPanel and cPanel Extended additionally allows you to choose a method of the integration.

1. Creates a DNS zone for each IP address assigned to a product.
2. First IP address assigned to a product is set up as a site dedicated IP address.

IPM19 1.png
As you can see on the following screen, you can easily check quantity of configurations assigned to each 3rd party integration.
IPM19 2.png

Integration With Proxmox VPS/Cloud For WHMCS

Integration with Proxmox VPS For WHMCS & Proxmox Cloud For WHMCS are the only integrations which are set up on both IP Manager For WHMCS and integrated module.

Due to that, setting up integration consist of 3 steps:
1. Create IP addresses pool which will be used for product.
2. Create configuration & assign previously created pool to it. No additional action is required in this step.
3. Go to product → 'Module Settings' tab and assign a previously created configuration in 'IP Manager' section.
Important: Assigning anything beyond the IP pool to the configuration in the IP Manager For WHMCS may cause unexpected effect in your WHMCS environment.

Integration With SolusVM Extended VPS For WHMCS

Integration with SolusVM Extended VPS For WHMCS is tricky.

IP Manager For WHMCS cannot inject the first IP address for the VPS, due to the way SolusVM API works.
After the creation of a VPS, IP Manager is able to add additional IP addresses.
Therefore, if you are using this integration, we advise seting up IP Manager synchronization as a cron job.

Test Integration Module

This module logs information about IP processing for 'Autorelease' type products.

Your order should look similar to the one on the screen below.
Note: You need to set up 'Autorelease' type server, otherwise logs will not show up.

IPM19.1.png

Creation of Integration Submodule

You can create your own integration, all you need is knowledge of PHP programming language.

You can do it through using 'Autorelease' submodule file.
1. To begin, make copy of 'AutorelaseIntegration.php' located in 'your_whmcs/modules/addons/ipmanager2/app/modules' .

IPM19.2.png
2. Rename copy to your new submodule name.

Note: File name has to end with 'Integration', for example 'NewSubmoduleIntegration.php'.

IPM19.3.png
3. Edit the file, start by entering basic setting.
1. Class name should be the same as the file name.
2. Submodule name visible in IP Manager.
3. Submodule description you wish to display.
4. Place here a module name that you are integrating ( best way is to copy a folder name of the module ).
IPM19.4.png
4. Now it is time to implement integration part, you will need integrated module documentation for it.
1. Configuration of 3rd party integration submodule.
2. Place code here assigning IP address to module product.
3. You can add code to unassign IP address here.
IPM19.5.png
4. In order to view a submodule you have just created, log in to your WHMCS and go to 'Addons' 'IP Manager' '3rd Party Integration' .
IPM19.6.png

Export

You can export your IP pools to .csv and .xml files.

To export, go to the 'Export' tab, choose IP pool to export and file format.
Confirm through pressing 'Save Changes' button. Downloading of file will start shortly.
Note: Your 'storage' folder located at 'your_whmcs/modules/addons/ipmanager2' should have chmod set to 755.

IPM25.3.png

Import

In 'Import' tab you can find tools to synchronize IP addresses from your WHMCS as well as import them from a file.

Synchronization
Synchronization will confirm relations in your system with relations in IP Manager pools.

  • IP address is used by a product, but inside of IP Manager pool is marked as unassigned - record inside of a pool will be updated.
  • IP address is used by a product, but do not exist in any IP Manager pool - a new pool will be created.

There are three available cron commands:
1. This cron command synchronizes all products (it will require confirmation).
2. This cron command synchronizes all products (it will not require any confirmation).
3. This cron command synchronizes only products which IDs have been provided as arguments separated by comma.
Import
To import IP addresses from a file, select it, chose its format and press 'Import'.

IPM24 1.png

IP Logs

'Logs' page stores the history of actions ordered on IP addresses.
IPM24 5.png

Settings

You can set up custom field 'IP Addresses' used in place of 'Assigned IPs' , disable usage of 'Dedicated IP' field or set up email reminder.

Disabling 'Dedicated IP' field is crucial for VPS where IP address is bounded to physical machine.
Therefore we allow you to disable usage of 'Dedicated IP' field for specific configuration.
To do so, fill field marked on the following screen with configuration name and pressing 'Update Settings' button.

IPM24 2.png
To enable usage of 'IP Addresses' custom field instead of 'Assigned IPs' field, mark checkbox as shown on the screen below and click 'Update Settings' button.
IPM24 3.png
Last but not least important feature is setting up email reminder which will be sent to all admins.

To enable email reminder, mark checkbox as shown on the following screen.
Afterwards, using textbox or slider, define value which exceeding will trigger email reminder.
Confirm changes by pressing 'Update Settings' button.

IPM24 4.png

Integration Code

Integration described below is not obligatory.

Module allows your customers to view IP addresses assigned to their product any order new ones.
To enable it, follow these simple steps:

IPM 49.png
Correctly placed code is presented on the following screen.
IPM 50.png
In the client area it should look like on the screen below.
IPM 51.png
To allow your customers to buy new IP addresses you need to set up product addon for product and assign the addon to a configuration in IP Manager.

Client Area

Your client can view and manage his IP addresses owing to IP Manager For WHMCS.

To remove an IP address from a product, press 'Unassign' .

IPM 52.png
Your client can also order a new IP address.

Press 'Order Additional IP Addresses' as shown below.
Your client will be moved to order form containing previously configured addons.

IPM 53.png
As soon the addon became active, new IP addresses will be granted.
IPM 54.png

Add IP via Addon

Setting up addon allows your client to add IP address to their product using integration.

Go to 'Setup' 'Products/Services' 'Product Addons' and press 'Add New Addon' .

IPM 55.png
Afterwards, enter addon name, addon description and select applicable products.

Set pricing for addon by choosing 'Billing Cycle' and typing price.
Confirm through pressing 'Save Changes' button.

IPM 56.png
Now, go to 'Addons' 'IP Manager' and use configuration you created before or create new one.

Remember to add previously created addon as a configuration relation.
You can do it by pressing 'Addon' button as shown on the following screen.

IPM 57.png
Tick checkbox next to addon and enter quantity of IP addresses to add.

Afterwards, click 'Save Changes' button.

IPM 58.png
If you enabled integration for the client area, your client should be able to order new IP addresses.

Management of Custom Hooks

Our module allows you to use custom hooks. All you have to do is to create some functions using PHP programming language.

Here you can see the possible hooks:

before_ip_assign_hook($ip, $serviceid, $relation, $configid)
after_ip_assign_hook($ip, $serviceid, $relation, $configid)
before_ip_integrating_hook($ip, $service, $server)
after_ip_integrating_hook($ip, $service, $server)
before_ip_disintegrating_hook($ip, $service, $server)
after_ip_disintegrating_hook($ip, $service, $server)
To find details about hooks read file 'custom_hooks.php' .

You can find there hook, information about its time of run, return values and parameters.
For example, if you want to throw message to activity log after IP address assignment find hook 'after_ip_assign_hook($ip, $serviceid, $relation, $configid)' and type:

Logger::factory()->log('Custom hook was triggered');

It should look like on the screen below:

IPM 59.png

How To Update

In order to upgrade your module, follow Modules Update article.

Tips

1. If your client will order a product bonded to two configurations (e.g. by product type and configurable option), IP Manager will add IP addresses from both configurations.

Common Problems

1. When you have problems with connection, check whether your SELinux or firewall does not block ports.
2. If you see something like this at 'Addon' 'IP Manager' , remove content of 'template_c' (except 'index.php' file).
IPM 60.png
3. If you export file and it is empty, check your 'Storage' folder chmod, it should be set to 755. Folder is located at 'your_whmcs/modules/addons/ipmanager2' .

If you still have that problem, set chmod 777.

Navigation
WHMCS Modules
WHMCS Widgets
Translations
cPanel Modules
General
FAQ
Community
IP Manager For WHMCS