![]() |
BillMax Billing Solutions 877.245.5629 sales@billmax.com |
As delivered, BillMax processing does not do any Provisioning. However, BillMax does provide a file called /usr/local/billmax/local/service_hook-example. This file is a PERL script that may be used as a basis for Provisioning. To use this file, copy the file to /usr/local/billmax/local/service_hook and make the appropriate modifications to instantiate Provisioning.
/usr/local/billmax/local/service_hook-example is written to execute Provisioning programs when basic Provisioning events occur. These events are:
Creation of a Service.
Change in the service.d01 (username) field of a Service.
Change in the service.d02 (password) field of a Service.
Change in the service.resources field of a Service.
As noted in "Configuring a Service Definition", Resources may be used for Provisioning as well as namespace management. The Resources defined when creating a Service Definition are copied to a Service and are available for use when Provisioning. The /usr/local/billmax/local/service_hook-example is designed to execute different Provisioning based of the settings of the Service Resources.
Example 2.1. Example Code using /usr/local/billmax/local/service_hook-example
Assume that the Service being created has been created from a Service Definition where the second and fourth resource flags are selected.

The following entries may be used to provision RADIUS authentication and a mail server.
$SERVICES{2}{name} = "mail"; (1)
$SERVICES{2}{provision} = "yes"; (2)
$SERVICES{2}{data} = [ "-p", "\$ENV{NEW_d02}" ];
$SERVICES{2}{cmd}{create}= "/usr/local/bin/userldapadd -M -g email" . "
-s /bin/true -c " .
escR("$ENV{USER_fname} $ENV{USER_lname}") .
" -p $ENV{NEW_d02} $ENV{NEW_d01}"; (3)
$SERVICES{2}{cmd}{delete}= "/usr/local/bin/userldapdel $ENV{NEW_d01}";
$SERVICES{2}{cmd}{disable}= "/usr/local/bin/userldapmod -L $ENV{NEW_d01}";
$SERVICES{2}{cmd}{enable}= "/usr/local/bin/userldapmod -U $ENV{NEW_d01}";
$SERVICES{2}{cmd}{rename}= "/usr/local/bin/userldapmod " . "
-l $ENV{NEW_d01} $ENV{OLD_d01}";
$SERVICES{2}{cmd}{update}= "/usr/local/bin/userldapmod";
$SERVICES{2}{remotecmd} = "/usr/bin/ssh 192.168.1.1"; (4)
$SERVICES{4}{name} = "radius2"; (5)
$SERVICES{4}{provision} = "yes";
$SERVICES{4}{data} = [ "-p", "\$ENV{NEW_d02}" ];
$SERVICES{4}{cmd}{create}= "/usr/sbin/useradd -M -g radius " .
"-s /bin/true -c " .
escR("$ENV{USER_fname} $ENV{USER_lname}") .
" -p $ENV{NEW_d02} $ENV{NEW_d01}";
$SERVICES{4}{cmd}{delete}= "/usr/sbin/userdel $ENV{NEW_d01}";
$SERVICES{4}{cmd}{disable}= "/usr/sbin/usermod -L $ENV{NEW_d01}";
$SERVICES{4}{cmd}{enable}= "/usr/sbin/usermod -U $ENV{NEW_d01}";
$SERVICES{4}{cmd}{rename}= "/usr/sbin/usermod -l $ENV{NEW_d01} $ENV{OLD_d01}";
$SERVICES{4}{cmd}{update}= "/usr/sbin/usermod";
$SERVICES{4}{remotecmd} = "/usr/bin/ssh 192.168.1.2";
| (1) | The name of the Resource to be provisioned. Used for documentation purposes. Does not have to match the Resource name in BillMax. |
| (2) | Defines whether or not this Resource (resource 2) will be provisioned. "no" may be used to turn off provisioning for this Resource. |
| (3) | Example of a command to execute when a Service with Resource 2 is created. In this instance, the /usr/local/bin/userldapadd will be executed. Note that is will be executed on the host addressed by IP 192.168.1.1. |
| (4) |
If not the empty string, the command to use to execute a remote command on another server. In this example, ssh is used to execute the create, delete, etc. commands. Note that ssh access for |
![]() |
Note |
|---|---|
This is example is specific to |
It is also instructive to note that in /usr/local/billmax/local/service_hook-example, every Provisioning event is logged in /usr/local/billmax/logs/service_hook.logs.