Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Custom Flags for Assets

Updated: 08 Jun 2009
MBHarmon's picture
+2 2 Votes
Login to vote

Within the helpdesk module there is a special flag for VIP contacts. This flag can be very helpful for a number of reasons. It gives us meta data that allows us to execute special options based off the result of this flag. An incident can have its priority escalated, a special notification can be sent to an IT manager to monitor the incident's progress, the incidents can be reported on individually, and a number of other benefits. Also, and perhaps more importantly, it gives a visual reminder to your service desk staff members that this person is someone who just might sign your paycheck and we all know this guy's computer has got to be working.

By expanding the usage of a VIP flag beyond the traditional understanding you can have it mean any kind of special care might be required when handling a contact's incident. A good example in our environment is using that VIP flag to also denote that person's account is in a more secure section of the domain and the average helpdesk employee may not have the appropriate level of access to perform all work required in all situations, such as a password reset.

Recently a new employee at our organization asked a manager why we used the flags and what good they were. When this information was supplied to the employee he calmly nodded and quickly asked, "So why don't you flag computers too?"

Please note all of the customizations that I will be sharing in this document will be for Helpdesk 6sp5. If you are using an older version of helpdesk you will probably need to make these changes to a different template than the ones I have specified in this document. To my knowledge the lines should remain the same, however those documents will be different.

Step 1. Develop a field to hold information

My first inclination was to dive deep and start creating a new column to track these items with the same VIP flag. My initial attempts, however, broke the helpdesk module when I added a column to the managed_object_view. So I stopped and quickly looked at what was already there.

imagebrowser image

That is when we decided to use the managed_object_external_id field. This field gives us a range of opportunities. Because it is more than just a checkbox we can develop more than one flag for our computers and flag them differently. For this example I am just going to provide one simple flag, though I will share how to expand it to more types of flags.

Step 2. Flag an asset

Flagging assets that were created within the Helpdesk solution is easily done. Simply click the pencil and edit away. However, performing an edit on an object that is managed by the Notification Server is a bit harder. I fell back to running the SQL directly.

WARNING: As with any update you should always do a Select first to make sure you get just the records you are looking to update.

Choose just one asset first as your test, then run this query on your Altiris_incidents database.

Select name, external_id
from managed_object
where name = 'Object Name Here'

Once you are sure you will only be getting the records you want you will want to run an update on that external_id flag.

Update managed_object
set external_id = 'flagged'
where name = 'Object Name Here'

Once the update has completed run the first query again to verify you have successfully updated this record's external_id field.

Step 3. Upload and configure a "Custom Flag" image

With any customization you will want to make sure to follow the rules for customizing the helpdesk solution that can be found on the Altiris knowledgebase. I have followed those steps here, but I recommend you still familiarize yourself with those steps before starting a customization of your own.

I will assume you already have an image of your own ready to go. If not open up paint and whip one up. For our example I am demonstrating the "DNR" or Do Not Reload flag. Place the image for the flag in your "custom" directory located on under the main AEXHD directory on your NS. For me it is located at "C:\Program Files\Altiris\Helpdesk\AeXHD\custom\images". We use quite a few custom images so we have created a subdirectory for those files specifically.

Now update your custom.config file with the following section:

<imgFiles>
<imgFile id="icnVip2" path="~/custom/images/" file="DNR.gif"/>
</imgFiles>

That section directly corresponds with a section on the web.config file. It would work if we modified that file directly, but any patches or reloads of the software would erase our customization so we have put it here to preserve that information.

Step 4. Modify the Workitem Edit screen to display your flag

For this step we will be modifying the subWorkItemEditGeneral.ascx file. If you have not already, make sure you include a line in your custom.config file to include a location for your custom file. It should look much like this one.

<files>
<file id="subWorkItemEditGeneral" path="~/custom/" file="subWorkItemEditGeneral.ascx"/>
</files>

Then copy a version of that file into the "custom" folder you are using. To edit this file I recommend a text editor with line numbers. There are a number of these out there and your preference may vary. If you are looking for a good one I have found that notepad++ is particularly helpful when performing Altiris Helpdesk Solution customizations.

Upon investigation you will find the code for displaying a user's VIP flag on line 628 of our template. This is the line that says:

<aw:Image ID="imgVip" RunAt="server" ImageUrl="icnVip" Width="26" Height="15" Visible='<%# DataStore("Contact").current.contact_vip_flag = "1" %>' />

The next step is to locate an appropriate place to put your computer's flag. I decided to place mine at the end of the string after the RTSM icon. On our code the new line will go at line 650, just before the </aw:ControlBar> line. Now we copy the existing vip line and edit it to check for the Asset's data store instead of the Contact's. Then we make sure we are testing for the right data from the right column and that we are displaying the new icon. Location of any subsequent tags will be immediately before or after this line.

After all is said and done for our example it will look like this:

<aw:Image ID="imgVip2" RunAt="server" ImageUrl="icnVip2" Width="26" Height="15" Visible='<%# DataStore("Asset").current.asset_external_id = "flagged" %>' />

After saving your modified file you will need to restart IIS. Now is always a good time to double check your work to make sure you have everything correct. This edit will only show up for new incidents. My result looks like this:

imagebrowser image

Step 5. Modify the subAsset page to display your flag

For this step we will be modifying the subAssetInfo.ascx file. If you have not already, make sure you include a line in your custom.config file to include a location for your custom file. It should look much like this one, simply place it before or after the line you added above

<file id="subAssetInfo" path="~/custom/" file="subAssetInfoascx"/>

Then copy a version of that file into the "custom" folder you are using. To edit this file I recommend a text editor with line numbers.

We already know what our line needs to look like we just need to decide where to put it. Just about anywhere between the <aw:Controlbar> sections will work. I chose just before the asset name, because that is where it is for the Contact's VIP flag. Location of any subsequent tags will be immediately before or after this line.

<aw:Image ID="imgVip2" RunAt="server" ImageUrl="icnVip2" Width="26" Height="15" Visible='<%# DataStore("Asset").current.asset_external_id = "flagged" %>' />

Now is another good time to double check your work to make sure you have everything correct. This edit will work for editing existing incidents and viewing incidents. My result looks like this:

imagebrowser image

Step 6. Rinse and Repeat as needed.

For each additional flag you can update objects to a new external_id and then create a new icon and line, simply update as necessary. Until you get the hang of it just up the number on those images lines and paste them right after each other.

For this example we have setup a flag for computers that should not be reimaged. You could easily setup a HSW tag for "Heightened Security Workstation" or SUW for "Shared Use Workstation" computers. Each usage will vary from organization to organization. These flags are still easily called out through the managed_object_external_id field so you can still create custom Validation, Incident, and Notification rules as your organization may need.

Hopefully this has been a help to you and if you have questions like always just feel free to send me a PM and I will do my best to help. Please note this is a first draft of the process. I hope to in the future find a better way to update managed assets than by directly modifying the database. When I do I will make sure to update everyone. If you can think of one, drop me a line I would love to hear it.