billmax documentation   BillMax Billing Solutions
  877.245.5629
  sales@billmax.com
 

Chapter 2. Provisioning for a Service

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:

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 RUNHOOK_USER will have to be set up ahead of time for this to work.

(5)

A new set of entries, this time for Resource 4 - the radius2 resource.

[Note] Note

This is example is specific to /usr/local/billmax/local/service_hook-example. In addition, the commands listed (i.e. /usr/sbin/userdel) are examples only.

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.



Document Revision A for BillMax 2.2.0   -   Copyright © 1997-2006 The iSpark Group, Inc.

All rights reserved. No part of this documentation may be reproduced or transmitted in any fashion without written permission by The iSpark Group, Inc. This documentation is for the sole use of licensees of the BillMax billing software created by The iSpark Group, Inc. Making the documentation available to a non-licensee of BillMax without written permission of The iSpark Group, Inc. is a violation of the use of this documentation.

While precautions have been taken in the preparation of this documentation, The iSpark Group, Inc. assumes neither liability nor responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

All terms mentioned that are known to be trademarks have been appropriately capitalized. Use of the a trademark does not affect the validity of any trademark or service mark.

Links to third-party Web sites are provided for convenience. The iSpark Group, Inc. is not responsible for any content contained in the third-party Web sites.

Comments about this documentation may be sent to doc@billmax.com