MSP Evolution - Autotask Configuration Items

We are pleased to provide a brief tutorial for extracting meaningful, contextual information from the Autotask Data Warehousing service.

This tutorial assumes an active Autotask Data Warehousing connection, a web server running PHP, as well as some programming and SQL knowledge.

Questions and Comments? Please post them here: https://community.autotask.com/forums/t/10493.aspx
DISCLAIMER:
The code and samples provided on this site, are offered as-is, where-is, with no implied level of support, maintenance, or accuracy.

The code presented is developed as proof of concept - not optimized for production use.

Pre-work 1 - Configure an Autotask Configuration Item.

For this example, we will build a Configuration Item called 'Internet Connection' that has several valuable User-Defined Fields.

  1. Log into Autotask with adminsitrative permissions.
  2. Click Admin > Products and Services > Products > Configuration Items > Configuration Item Types
  3. Click 'New Configuration Item Type'.
  4. Assign it a name - 'Internet Connection'.
  5. Click 'New' below User-Defined Fields.
  6. In the new window that pops up, assign the following:
    • Name: Circuit ID
    • Description: The Carrier Provided Circuit ID
    • Sort Order: 1
    • Field Type: Text (Single Line)
    • Default Value: Blank
    • Variable Name: varCircuitID
  7. Click 'Save and New'.
  8. Repeat for the following:
    • Circuit type: - This one can be a 'list type'! Cable, DSL, T1, Fiber, etc.
    • Download Speed
    • Upload Speed
    • Public IP Address
    • Public Subnet Mask
    • Public Default Gateway
    • Useable Public IP Range
  9. When you are finished adding each UDF, make sure you hit 'Save and Close' on the initial window.
When you are finished, it should look like this.

Configuration Item - Internet Connection

Pre-work 2 - Configure an Autotask Product.

Build a corresponding product called 'Internet Connection'.

  1. Log into Autotask with adminsitrative permissions.
  2. Click Admin > Products and Services > Products > Products
  3. Click 'New'. A new window will pop up.
  4. Configure the following fields:
    • Name: Internet Connection
    • Category: Select the appropriate product category (if desired).
    • Product Description: Provide a meaningful description.
    • Default Configuration Item Type: Internet Connection
    • Product Allocation Code: Select appropriate code.
    • Fill out the remaining fields as necessary.
    • We recommend filling out 'Vendors' at the bottom of the window for ease of use.
  5. Click 'Save and Close'.
When finished, the product should look like this.

Product - Internet Connection

Pre-work 3 - Configure an Installed Product on an Account.

Within the CRM module, locate a customer to add an Installed Product to.

  1. Log into Autotask with adminsitrative permissions.
  2. Click CRM > Accounts > Select an Account
  3. Click 'New' > 'Account Configuration Item'.
  4. In the new window, configure the following fields:
    • Product: Internet Connection
    • Configuration Item Type: This will pre-populate with 'Internet Connection' and change the UDF in the window.
    • Enter the Installed On and Warranty Expiration if you know them.
    • Reference Title: Primary Internet Connection
    • Vendor: Select appropriate vendor from the dropdown. If not listed, add a new account of type 'vendor' via CRM.
    • Fill out the remaining fields as necessary.
    • Use the NOTES only for things that don't fit in existing UDF.
  5. Click 'Save and Close'.
When finished, the Installed Product should look like this. Repeat for all customers with this product type.

 Installed Product - Primary Internet Connection
 Installed Product - Primary Internet Connection

Step 1 - Set Up Data Warehousing.

Contact your Autotask Sales Representative and tell them you want to enable Data Warehousing. Please note, additional fees may apply.

They will request a range of public IPs that you will be connecting from. If you use cloud based servers, you may need to contact your provider to get this information.

Step 2 - Web Server Requirements.

PHP 5.2.6 (http://www.php.net)
Native MSSQL Libraries + any other libraries you wish to use.

This will work with IIS or Apache - there are a number of tutorials online to assist in this setup.
PHP MSSQL APACHE
PHP MSSQL IIS

If setting up webservers are not your thing, there are also a large number of cloud based providers with servers already ready to go!
http://www.nearlyfreespeech.net

Step 3 - Connection String for Data Warehousing.

Autotask will provide you with an email containing your Data Warehouse Connection information.

You can copy and paste the code below to a new file called 'connect.php' - or download the file here.
connect.php - save as connect.php

	
<?php
/*
// Autotask Data Warehousing is served from a MS SQL Server.  
// Populate the variables below with the information they provide when 
// Data Warehousing is set up.
//
// Microsoft SQL Server, TCP Port as provided by Autotask
    $mssqlHost = "host,portnumber"; #It is MSSQL Instance name
//
// Warehouse Login as provided by Autotask
    $mssqlUser = 'username';
//
// Warehouse Password as provided by Autotask
    $mssqlPass = 'password';
//
// Database Name as provided by Autotask
    $mssqlATDB = 'database name';
//
// pull all of that together into the connect string
$SQLConnect = mssql_connect($mssqlHost,$mssqlUser,$mssqlPass) 
    or die('Could not connect to SQL Server on '.$mssqlHost
    .' '. mssql_get_last_message());
*/

$mssqlHost "Reports.autotask.net,1433"#It is MSSQL Instance name
$mssqlUser 'user';
$mssqlPass 'password';
$mssqlATDB 'TF_8125000_WH';
$SQLConnect mssql_connect($mssqlHost,$mssqlUser,$mssqlPass
    or die(
'Could not connect to SQL Server on '.$mssqlHost
    
.' 'mssql_get_last_message());


?>

Step 4 - Checking Connection for Data Warehousing.

Once you have built your 'connect.php' file, you can test your connection to the Data Warehouse using the file below.

You will see one of the two messages below, or additional PHP error messages.

checkConnection.php - save as checkConnection.php


Connection to AT Data Warehouse Succeeded. OR Connection to AT Data Warehouse failed.

Step 5 - Enumerating Autotask Accounts - Customers

Autotask uses a data structure called 'Accounts' to store information about Customers, Vendors, Competitors, etc. This section focuses on how to pull information from the Data Warehouse related to 'Accounts' of type, 'Customer'.

In this example, we will build a simple list of customers that will look like this. (baby steps)


5 Currently Active Customers
Customer Name 1
Customer Name 2
Customer Name 3
Customer Name 4
Customer Name 5
You can copy and paste the code below to a new file called 'listCustomers.php' - or download the file here.
listCustomers.php - save as listCustomers.php

For simplicity in these examples, all files are 'self-contained' and do not reference common includes - aside from the previously mentioned 'connect.php' file.

	
<?php
//Include connect.php as it stores all remote database connection variables.
require_once("connect.php");

// simple function to take a query, run it against the data warehouse 
// and return a multi-indexed array of the results, if any.
// if there are no results, the function returns 0.
function queryToArray($query){
    
$result mssql_query($query); 
    
$numRows mssql_num_rows($result);      
            
        if(
$numRows 0){
            while(
$row mssql_fetch_assoc($result)){
                
$arrayOfCustomerInformation[] = $row;
            }
                return 
$arrayOfCustomerInformation;                                
        }
        else {
                return 
0;
             }
}

//generic query to pull top 100 values from the wh_account table
//where the account_type_id = 1 (Customer)
// and is_active = 1 (Currently Active)
$query "select 
            top(100)* 
          from 
            wh_account 
          where 
            account_type_id = '1' AND
            is_active = '1'
         "
;

//generic query to pull all values from the wh_account table 
//(commented out)
//$query = "select * from wh_account";

//create an array of values that are returned by the query
$myCustomerArray queryToArray($query);

//If there are results from the query, print them out to the 
//screen. 
// Brief explanation of this array:
// $myCustomerArray stores a multi-indexed array of accounts.
// each index ($k) is a unique customer account.
// each index ($k) has an associative array of key, value pairs
// that can be referenced by name like this
//
// $myCustomerArray[$k]["address_1"]
//
//NOTE: These may change over time!
/*
    [account_id] => 0
    [owner_resource_id] => 4
    [create_time] => May 16 2002  6:56AM
    [external_id] =>  
    [account_name] => Name
    [directory_account_id] => 0
    [address_1] =>  1234 Fake St
    [address_2] =>  
    [city] =>  Fakerton
    [state] =>  VA
    [zip_code] =>  12345
    [country] =>  
    [phone_number] =>  (555)555-1234
    [alternate_phone_1] =>  
    [alternate_phone_2] =>  
    [fax_number] =>  
    [web_url] => http://www.customer.com
    [account_type_id] => 1
    [key_account_icon_id] => 
    [territory_id] => 
    [market_segment_id] => 29682845
    [competitor_id] => 
    [parent_account_id] => 
    [stock_symbol] =>  
    [stock_market] =>  
    [sic_code] =>  
    [asset_value] => 
    [last_activity_time] => Sep 26 2009  3:31PM
    [external_accounting_id] =>  
    [is_active] => 1
    [is_costed_client] => 0
    [is_tax_exempt] => 0
    [uses_parent_account_contracts] => 0
*/
    
echo "<hr>";
    if(
$myCustomerArray != 0){
        echo 
"<b>".count($myCustomerArray)." Active Customers</b>\n<br/>";
        for(
$k=0;$k<count($myCustomerArray);$k++){    
                echo 
" ".$myCustomerArray[$k]["account_name"]."\n<br/>";
            }
    }
    echo 
"<hr>";

//to quickly see all values returned, use the print_r function. 
//(commented out.)    
        
echo "<pre>\n";
            
print_r($myCustomerArray);
        echo 
"</pre>\n";

?>

Step 6 - Enumerating Autotask Accounts - Vendors

As you saw in the previous example, Autotask uses a data structure called 'Accounts' to store information about Customers, Vendors, Competitors, etc. This section focuses on how to pull information from the Data Warehouse related to 'Accounts' of type, 'Vendor'.

In this example, we will build a simple list of Vendors that will look like this. (more baby steps)


4 Currently Active Vendors
Vendor Name 1 - Phone Number - Website
Vendor Name 2 - Phone Number - Website
Vendor Name 3 - Phone Number - Website
Vendor Name 4 - Phone Number - Website

In comparing the source for Vendors and Customers, there is only a minor difference - the 'account_type_id'.
For Vendors, this value is 7.
For Customers, this value is 1.

The other major difference is the output - there is more information about the vendors printed back to the screen.
You can easily do this with Customer Accounts as well.

You can copy and paste the code below to a new file called 'listVendors.php' - or download the file here.
listVendors.php - save as listVendors.php

For simplicity in these examples, all files are 'self-contained' and do not reference common includes - aside from the previously mentioned 'connect.php' file.
	
<?php
//Include connect.php as it stores all remote database connection variables.
require_once("connect.php");

// simple function to take a query, run it against the data warehouse 
// and return a multi-indexed array of the results, if any.
// if there are no results, the function returns 0.
function queryToArray($query){
    
$result mssql_query($query); 
    
$numRows mssql_num_rows($result);      
            
        if(
$numRows 0){
            while(
$row mssql_fetch_assoc($result)){
                
$arrayOfCustomerInformation[] = $row;
            }
                return 
$arrayOfCustomerInformation;                                
        }
        else {
                return 
0;
             }
}

//generic query to pull top 100 values from the wh_account table
//where the account_type_id = 7 (Vendor)
// and is_active = 1 (Currently Active)
$query "select 
            top(100)* 
          from 
            wh_account 
          where 
            account_type_id = '7' AND
            is_active = '1'
         "
;


//create an array of values that are returned by the query
$myVendorArray queryToArray($query);

//If there are results from the query, print them out to the 
//screen. 
// Brief explanation of this array:
// $myVendorArray stores a multi-indexed array of accounts.
// each index ($k) is a unique customer account.
// each index ($k) has an associative array of key, value pairs
// that can be referenced by name like this
//
// $myCustomerArray[$k]["address_1"]
//
//NOTE: These may change over time!
/*
    [account_id] => 0
    [owner_resource_id] => 4
    [create_time] => May 16 2002  6:56AM
    [external_id] =>  
    [account_name] => BestISP
    [directory_account_id] => 0
    [address_1] =>  987 Service Lane
    [address_2] =>  
    [city] =>  Fakerton
    [state] =>  VA
    [zip_code] =>  12345
    [country] =>  
    [phone_number] =>  (555)555-1984
    [alternate_phone_1] =>  
    [alternate_phone_2] =>  
    [fax_number] =>  
    [web_url] => http://www.bestISP.com
    [account_type_id] => 7
    [key_account_icon_id] => 
    [territory_id] => 
    [market_segment_id] => 29682845
    [competitor_id] => 
    [parent_account_id] => 
    [stock_symbol] =>  
    [stock_market] =>  
    [sic_code] =>  
    [asset_value] => 
    [last_activity_time] => Sep 26 2009  3:31PM
    [external_accounting_id] =>  
    [is_active] => 1
    [is_costed_client] => 0
    [is_tax_exempt] => 0
    [uses_parent_account_contracts] => 0
*/
    
echo "<hr>";
    if(
$myVendorArray != 0){
        echo 
"<b>".count($myVendorArray)." Active Vendors</b>\n<br/>";
        for(
$k=0;$k<count($myVendorArray);$k++){    
                echo 
" ".$myVendorArray[$k]["account_name"]." - "
                
.$myVendorArray[$k]["phone_number"]." - "
                
.$myVendorArray[$k]["web_url"]."\n<br/>";
            }
    }
    echo 
"<hr>";

//to quickly see all values returned, use the print_r function. 
//(commented out.)    
    //    echo "<pre>\n";
    //        print_r($myVendorArray);
    //    echo "</pre>\n";

?>

Step 7 - Enumerating Autotask Assets and their UDF

One of the more powerful components of Autotask is how it handles Assets (Installed Products or Configuration Items.)

In this example, we will display a list of assets and some key information about each.

It will appear like this.


3 Currently Active Assets
Vendor Vendor Phone Reference Title Serial Number Warranty Exp Date Notes Product ID
TWC18005551234Primary Internet26hcgs123456Sep 1 2011No Notes.123456
TWC18005551234Primary Internet789ad7458Jan 1 2010Need to renew123459
TWC18005551234Primary Internet12457898Oct 15 2010No Notes.123421

You can copy and paste the code below to a new file called 'listVendors.php' - or download the file here.
listAssets.php - save as listAssets.php

For simplicity in these examples, all files are 'self-contained' and do not reference common includes - aside from the previously mentioned 'connect.php' file.
	
<?php
//Include connect.php as it stores all remote database connection variables.
require_once("connect.php");

// simple function to take a query, run it against the data warehouse 
// and return a multi-indexed array of the results, if any.
// if there are no results, the function returns 0.
function queryToArray($query){
    
$result mssql_query($query); 
    
$numRows mssql_num_rows($result);      
            
        if(
$numRows 0){
            while(
$row mssql_fetch_assoc($result)){
                
$arrayOfCustomerInformation[] = $row;
            }
                return 
$arrayOfCustomerInformation;                                
        }
        else {
                return 
0;
             }
}

//generic query to pull top 100 values from the Installed Product table
// where is_active = 1 (Currently Active)
// in this query, we are JOINING with the account table to provide a 
// meaningful link between assets and accounts.  We are using a LEFT 
// Join to show any assets without a 'Vendor Name' 
// (to show only assets with vendor names, change LEFT to INNER

//This query shows all assets assigned to the '0' account.
// (your internal Autotask account)
$query "select 
            top(100)
                wh_installed_product.reference_title,
                wh_installed_product.serial_number,
                wh_installed_product.installed_product_id, 
                wh_installed_product.warranty_expiration_date,
                wh_installed_product.notes, 
                wh_installed_product.vendor_name,
                wh_installed_product.account_id,
                wh_account.account_name,
                wh_account.phone_number,
                wh_account.web_url
          from 
            wh_installed_product LEFT JOIN
            wh_account ON wh_installed_product.vendor_name
                = wh_account.account_name
          where 
            wh_installed_product.is_active = '1' AND
            wh_installed_product.account_id = '0'
          order by
            wh_installed_product.warranty_expiration_date
         "
;
    

/*
//uncomment this query to show All Assets for All accounts.
$query = "select 
            top(100)
                wh_installed_product.reference_title,
                wh_installed_product.serial_number,
                wh_installed_product.installed_product_id, 
                wh_installed_product.warranty_expiration_date,
                wh_installed_product.notes, 
                wh_installed_product.vendor_name,
                wh_installed_product.account_id,
                wh_account.account_name,
                wh_account.phone_number,
                wh_account.web_url
          from 
            wh_installed_product LEFT JOIN
            wh_account ON wh_installed_product.vendor_name 
                = wh_account.account_name
          where 
            wh_installed_product.is_active = '1' 
          order by
            wh_installed_product.warranty_expiration_date
         ";
*/
    
//create an array of values that are returned by the query
$myAssetArray queryToArray($query);

//If there are results from the query, print them out to the 
//screen. 
// Brief explanation of this array:
// $myAssetArray stores a multi-indexed array of accounts.
// each index ($k) is a unique customer asset / Installed Product.
// each index ($k) has an associative array of key, value pairs
// that can be referenced by name like this
//
// $myAssetArray[$k]["reference_title"]
//
//NOTE: These may change over time!
/*
    [installed_product_id] => 29683402
    [product_id] => 29683401
    [account_id] => 29683321
    [start_date] => Mar 27 2009 12:00AM
    [warranty_expiration_date] => Mar 27 2010 12:00AM
    [serial_number] => 26hcgs1234567
    [reference_number] =>  
    [reference_title] => Guest Wireless Internet
    [number_of_users] => 0.0000
    [hourly_cost] => 0.0000
    [monthly_cost] => 0.0000
    [daily_cost] => 0.0000
    [per_use_cost] => 0.0000
    [setup_fee] => 0.0000
    [account_link] =>  
    [notes] =>  
    [project_cost_id] => 
    [quote_item_id] => 
    [is_active] => 1
    [create_time] => Mar 27 2009 11:32PM
    [installed_product_type] => 
    [location] =>  
    [contact_first_name] => 
    [contact_last_name] => 
    [vendor_name] => 
    [contract_id] => 
    [service_id] => 
    [service_bundle_id] => 
    [installed_by_resource_id] => 29682885
    [is_swapped_out] => 0
    [inventory_transfer_id] => 
*/
    
echo "<hr>";
    if(
$myAssetArray != 0){
        echo 
"<b>".count($myAssetArray)." Active Assets</b>\n<br/>";
        echo 
"<table style=\"border:1px black solid; 
            border-collapse:collapse;\">\n"
;
        echo 
"<tr><td>Vendor</td>".
                  
"<td>Vendor Phone</td>".
                  
"<td>Reference Title</td>".
                  
"<td>Serial Number</td>".
                  
"<td>Warranty Exp Date</td>".
                  
"<td>Notes</td>".
                  
"<td>Product ID</td>".
             
"</tr>";
        for(
$k=0;$k<count($myAssetArray);$k++){    
                echo 
"<tr> ".
                     
"<td style=\"border:1px black solid;\">".
                        
$myAssetArray[$k]["account_name"]."</td>".
                     
"<td style=\"border:1px black solid;\">".
                        
$myAssetArray[$k]["phone_number"] ."</td>".
                     
"<td style=\"border:1px black solid;\">".
                        
$myAssetArray[$k]["reference_title"]."</td>".
                     
"<td style=\"border:1px black solid;\">".
                        
$myAssetArray[$k]["serial_number"] ."</td>".
                     
"<td style=\"border:1px black solid;\">".
                        
$myAssetArray[$k]["warranty_expiration_date"].
                            
"</td>".
                     
"<td style=\"border:1px black solid;\">".
                        
$myAssetArray[$k]["notes"] ."</td>".
                     
"<td style=\"border:1px black solid;\">".
                        
$myAssetArray[$k]["installed_product_id"] ."</td>".
                     
"</tr>\n<br/>";
                
            }
        echo  
"</table>\n";
    }
    else{
        echo 
"There were 0 results returned.  
        There are no assets associated with this account.\n<br/>"
;
    }
    echo 
"<hr>";

//to quickly see all values returned, use the print_r function. 
//(commented out.)    
        
echo "<pre>\n";
            
print_r($myAssetArray);
        echo 
"</pre>\n";

?>

Step 8 - Putting it together.

In this example, we will combine the previous steps to display a list of customers, with each of their active Assets and related Vendor Contact Information.

It will appear like this.
Sample Asset Report You can copy and paste the code below to a new file called 'listVendors.php' - or download the file here.
listAssetsByCust.php - save as listAssetsByCust.php

For simplicity in these examples, all files are 'self-contained' and do not reference common includes - aside from the previously mentioned 'connect.php' file.
	
<?php
//Include connect.php as it stores all remote database connection variables.
require_once("connect.php");

// simple function to take a query, run it against the data warehouse 
// and return a multi-indexed array of the results, if any.
// if there are no results, the function returns 0.
function queryToArray($query){
    
$result mssql_query($query); 
    
$numRows mssql_num_rows($result);      
            
        if(
$numRows 0){
            while(
$row mssql_fetch_assoc($result)){
                
$arrayOfCustomerInformation[] = $row;
            }
                return 
$arrayOfCustomerInformation;                                
        }
        else {
                return 
0;
             }
}
?>

<html>
<head><title>Assets per Customer</title></head>
<STYLE type="text/css">
        html{
            background: 
             transparent url(img/background.gif) repeat scroll 0 0;
        }

        body{
            background:#fff;
            color:#333;
            margin:2em auto 0 auto;
            width:850px;
            padding:1em 2em;
            border:1px solid #dfdfdf;
            }

        table { border: 1px solid #aaa; 
                border-collapse: collapse; 
                padding: 4px;
                } 
        td { border: 1px solid;
             padding: 6px;} 
        
</style>        
<body>


<?php


echo "<h2>List of Assets per customer</h2>";

//Part 1: Obtain list of Active Customers.
$query "select 
            top(100)* 
          from 
            wh_account 
          where 
            account_type_id = '1' AND
            is_active = '1'
         "
;
         

    
$myCustomerArray queryToArray($query);

//Part 2: Per Customer, enumerate All assets

//generic query to pull top 100 values from the Installed Product table
// where is_active = 1 (Currently Active)
// in this query, we are JOINING with the account table to provide a 
// meaningful link between assets and accounts.  We are using a LEFT 
// Join to show any assets without a 'Vendor Name' 
// (to show only assets with vendor names, change LEFT to INNER
for($i 0$i<count($myCustomerArray); $i++){

    echo 
"".$myCustomerArray[$i]["account_name"] ."\n<br/>";
    echo 
"P:".$myCustomerArray[$i]["phone_number"] ."\n<br/>";
    echo 
"W:<a href=\"".$myCustomerArray[$i]["web_url"]."\"
        target=\"_blank\">"
.$myCustomerArray[$i]["web_url"] .
            
"</a>\n<br/>";

    
//This query shows all assets assigned to the '0' account.
    // (your internal Autotask account)
    
$query "select 
            top(100)
                wh_installed_product.reference_title,
                wh_installed_product.serial_number,
                wh_installed_product.installed_product_id, 
                wh_installed_product.warranty_expiration_date,
                wh_installed_product.notes, 
                wh_installed_product.vendor_name,
                wh_installed_product.account_id,
                wh_account.account_name,
                wh_account.phone_number,
                wh_account.web_url
          from 
            wh_installed_product LEFT JOIN
            wh_account ON wh_installed_product.vendor_name
                = wh_account.account_name
          where 
            wh_installed_product.is_active = '1' AND
            wh_installed_product.account_id = '"
.
                
$myCustomerArray[$i]["account_id"]."'
          order by
            wh_installed_product.warranty_expiration_date
         "
;
    
//create an array of values that are returned by the query
$myAssetArray queryToArray($query);

//If there are results from the query, print them out to the 
//screen. 
echo "<br/>";
    if(
$myAssetArray != 0){
        echo 
"<b>".count($myAssetArray)." Active Asset(s)</b>\n<br/>";
        echo 
"<table>\n";
        echo 
"<tr><td>Vendor</td>".
                  
"<td>Vendor Phone</td>".
                  
"<td>Reference Title</td>".
                  
"<td>Serial Number</td>".
                  
"<td>Warranty Exp Date</td>".
                  
"<td>Notes</td>".
                  
"<td>Product ID</td>".
                  
"<td>Product UDF</td>".
             
"</tr>";
        for(
$k=0;$k<count($myAssetArray);$k++){    
                echo 
"<tr> ".
                     
"<td>".
                        
$myAssetArray[$k]["account_name"]."</td>".
                     
"<td>".
                        
$myAssetArray[$k]["phone_number"] ."</td>".
                     
"<td>".
                        
$myAssetArray[$k]["reference_title"]."</td>".
                     
"<td>".
                        
$myAssetArray[$k]["serial_number"] ."</td>".
                     
"<td>".
                        
$myAssetArray[$k]["warranty_expiration_date"].
                            
"</td>".
                     
"<td>".
                        
$myAssetArray[$k]["notes"] ."</td>".
                     
"<td>".
                        
$myAssetArray[$k]["installed_product_id"] ."</td>";
            
//NOTE:  the values listed in the 'CAST' parends below must match the names 
//you used for the UDF in Autotask.  Replace spaces with '_'
//Also- list types must append '_visible_value' to the end of the variable.
        
$query "select 
            CAST(circuit_id as TEXT) as circuit_id,
            CAST(circuit_type_visible_value as TEXT) as circuit_type,
            CAST(download_speed as TEXT) as download_speed,
            CAST(upload_speed as TEXT) as upload_speed,
            CAST(public_ip_address as TEXT) as public_ip_address,
            CAST(public_subnet_mask as TEXT) as public_subnet_mask,
            CAST(public_default_gateway as TEXT) as public_default_gateway,
            CAST(useable_public_range as TEXT) as useable_public_range
          from 
            wh_installed_product_udf
          where 
            installed_product_id = '"
.
                
$myAssetArray[$k]["installed_product_id"]."'
             "
;
             
        
$myUDFArray queryToArray($query);
            
            echo 
"<td style=\"border:1px black solid;\"><pre>\n";
                
print_r($myUDFArray);
            echo 
"</pre>\n</td>";
            
            echo 
"</tr>";
        }
                
        echo  
"</table>\n";
    }
    else{
        echo 
"There were 0 results returned.  
        There are no assets associated with this account.\n<br/>"
;
    }
    echo 
"<hr>";

//to quickly see all values returned, use the print_r function. 
//(commented out.)    
    //    echo "<pre>\n";
    //        print_r($myAssetArray);
    //    echo "</pre>\n";
}

?>
</body>
</html>

Step 9 - Next Steps

What to do next. . .
  1. Identify an information champion in your company! They must be meticulous!
  2. Identify the trouble spots in your existing documentation system.
  3. Organize your data into Autotask, using vendor accounts, products, and Configuration Items.
  4. Build some CSS to apply your own style to this code.
  5. Build some classes - you will be glad you did! (simple 'DWAccount.class' provided for your use)
You can copy and paste the code below to a new file called 'DWAccount.class' - or download the file here.
DWAccount.class - save as DWAccount.class

Extra Credit!

What will you automate today?
  • Build a Google Earth mash-up showing all customers on the globe.
  • Build an Outage Assistant - list neighboring customers with similar ISP or power services during outage.


What can you automate today?

Interested in having your technology managed by a team that is obsessed with data organization?
Creative Commons License