Personal tools
Namespaces

Variants
Actions

IP Manager For WHMCS

From ModulesGarden Wiki
Revision as of 15:29, 5 March 2014 by Gregor (Talk | contribs)

Jump to: navigation, search

Contents

About IP Manager For WHMCS

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.
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
✔ Export IP Pools With The Information Assignment To XML And CSV Format
✔ Import Single Or Multiple IP Addresses Into Pools
✔ View Whole IP List From 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 List
✔ Create An IP Pool By A Range Instead Of A CIDR (For IPv4)
✔ Exclude Selected IP Addresses From A Pool
✔ Delete Single IP Address Or A Bunch Of IP Addresses From A Pool
✔ Integrate IP Through Assigning With The 3rd Party Applications: cPanel, Plesk, Parallels Cloud Server and Parallels Cloud Server Virtual Datacenter
✔ 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' Field For Selected Configuration
✔ Switch Between Usage Of 'Assigned IPs' Field And 'IP Addresses' Custom Field
✔ Intelligent IP Assigning For Related Configurable Options With The 'Quantity' Type
✔ Email Reminder When Percentage Usage Of Any Pool Will Be Exceeded
✔ Assign Custom Field To IP Address
✔ 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
  • Additionally:
✔ Supports IPv4 and IPv6
✔ Multi-Language Support (Both Admin 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 at '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 at your client area → 'My Products' .

IPM4.png
5. Now you have to activate the module in your WHMCS system.

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

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

To do so click on 'Configure' button, tick 'Full Administrator' and press 'Save Changes' .

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

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

IPM6.1.png
8. 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 also 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 database only assigned IP addresses.
Therefore free IPv6 addresses will not be visible at pool overview.

Adding IP Pool in CIDR Notation

Go to 'IP Pools' tab, select 'Classless Inter-Domain Routing (CIDR)' .

Select IP version, type first IP from a pool you want to add and netmask (in prefix notation).
Note: First IP from 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 creation of IP pool through pressing 'Add Pool' button.

IPM8 2.png

Adding IP Pool as IP Range

Go to 'IP Pools' tab and select 'IP Range' .

Type first and last IP from pool you want 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
Enter nameservers and gateway address into textboxes as shown on the screen below (This step is optional).

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

IPM8 5.png

Adding IP Pool as 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

Management of IP Pools

You can edit IP pools advanced settings even after creation.

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
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
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
You can also remove IP addresses from the IP pool.

Simply select checkboxes next to IP address, select 'Delete From The Pool' from 'Action For Selected IP Addresses:' .
Afterwards, confirm through pressing 'Save Changes' button.

File:IPM11.1.png
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. At 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 want 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 by 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 configuration.

IPM14.png

Advanced Configuration

Lets say, that you want to set multiple IP assignment to specyfic 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, next press 'Save Changes' .

IPM16.png

Usage Graph

At each configuration you can find graph of usage, which shows you statistics of IP addresses assignment in time.
IPM17.png

3rd Party Integration

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

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

Enabling 3rd Party Integration

Activation of all integration modules looks similar.

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

IPM18.png
Press 'Configure' button, select configuration to apply module for and confirm through clicking 'Save Changes' .
IPM19.png
As you can see on the following screen, you can easily check quantity of configurations assigned to each 3rd party integration.
IPM19 1.png

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 server of 'Autorelease' type, 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 at '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 same as file name.
2. Submodule name visible in IP Manager.
3. Submodule description you want to display.
4. Place here module name you are integrating ( best way is to copy folder name of 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 submodule you have just created, log in to your WHMCS and go to 'Addons' 'IP Manager' '3rd Party Integration' .
IPM19.6.png

Integration Code

Integration described below is not obligatory.

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

File:IPM22.png
Correctly placed code is presented on the following screen.
File:IPM23.png
In the client area it should look like on the screen below.
File:IPM24.png
To allow your customers to buy new IP addresses you need to set up product addon for product and add this addon to configuration in IP Manager.

Export

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

To export, go to 'Export' tab, choose IP pool to export and file format.
Confirm through pressing 'Save Changes' button. Download 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

At 'Import' tab you can find cron commands which allows you to synchronize all (or only specific) products with IP Manager pools.

Any IP address which is assigned to synchronized product and exist in any of IP Manager pools will be assigned in that pool to synchronized product.
If there wont be pool with that IP address, new IP pool will be created.
There are three available cron commands:
1. This cron command synchronize all products (it will require confirmation).
2. This cron command synchronize all products (it will not require any confirmation).
3. This cron command synchronize only products which IDs have been provided as another arguments separated by comma.

IPM24 1.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 send 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

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' .

File:IPM24.1.png
Afterwards, enter addon name, description and select applicable products.

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

File:IPM24.2.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.

File:IPM24.3.png
Tick checkbox next to addon and enter quantity of IP addresses to add.

Afterwards, click 'Save Changes' button.

File:IPM24.4.png
If you enabled integration for the client area, your client should see something similar to the screen below.

To view product addon you previously created, press 'Buy an IP for Service' button.

File:IPM24.5.png
As you can see, your client can order 'Additional IP' addon from here.
File:IPM24.6.png

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:

File:IPM25.png

How To Update

In order to upgrade your module, follow these steps:

1. Upload and extract IP Manager module to your WHMCS server.

File:IPM25.1.png
2. Go to 'your_whmcs/template_c' , refresh content and remove all files except 'index.php' .
File:IPM25.2.png

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 is not blocking ports.
2. If you see something like this at 'Addon' 'IP Manager' , remove content of 'template_c' (except 'index.php' file).
File:IPM26.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