0 - Version Disclaimer / Clarification
This article covers the creation / use of custom data files with the LANDesk MAP-agent for Linux, used predominantly between versions of LANDesk Management Suite 9.5 and up to (and including) Ivanti Enterprise Manager 2017.1 !
Please be aware that as of Ivanti Enterprise Manager 2017.3, a freshly architected Linux agent (the "component architecture" agent) exists, which operates quite differently.
A separate article will be created for the new component agent architecture and its use of custom data overe here -- How to scan custom data on Linux Platforms in detail (EPM 2017.3 onwards) !
I - Introduction
The purpose of this article is to familiarise the user with the ways in which the LANDesk *-IX inventory scanner picks up / process custom-data - and to do so in a manner to help people who may not necessarily have had a lot of experience with *-IX OS'es.
So whilst this has effectively very similar content to the Article here this one goes through the process without assuming any significant experience with either XML files and/or *-IX OS'es
This is a new feature that is currently only available with the 64-bit agent, the 32-bit agent is not able to pick up Custom Data by means of reading files. A "workdaround" for 32-bit agents up to LANDesk Management Suite 9.5 is provided towards the end of this document for anyone interested.
II - Getting Started
Before we begin - a few things to be aware of:
- Case sensitivity (depends on your DBMS / its settings)
- PLAN FIRST ... changing this stuff on the fly tends to lead to a huge mess. Knowing *WHAT* you want to collect and *WHERE* you want it to show up (ideally you're aiming for consistency with any Custom Data with your Windows-devices, if that is applicable) up-front reduces the considerable headaches involved in cleaning up overly enthusiastic but unplanned approaches.
- Test and test thoroughly. Once you've set this "live", any changes other than "new additions" can be quite painful.
- The file(-s) must be located in "/opt/landesk/var/customdata/". The "customdata" directory does *NOT* exist by default under "/opt/landesk/var/" - so you need to create it.
- REMEMBER - you must change the ownership ownership of the following to landesk of:
- The directory containing the custom data XML's (i.e. -"customdata")
- any XML's themselves that you create.
You do this via running:
chown landesk:landesk <DIRECTORY_OR_FILE>
so for instance, if we want to change the ownership of the "customdata" directory, we can do so via:
chown landesk:landesk customdata
- or, if you want to use the full path, you can do so as well:
chown landesk:landesk /opt/landesk/var/customdata
- REMEMBER - CUSTOM DATA GETS BLOCKED BY DEFAULT!
Whilst the data may be sent to your Core Server, remember that you need to "un-block" it as per this document HERE.
- To test / debug your XML's, run
./opt/landesk/bin/map-reporter -V 255
This will launch the part of the inventory scanner that (among other things) processes the custom data. The "-V 255" flag enabled maximum verbosity. This way, you can easily check whether there are any problems with the files themselves (usually the act of forgetting to change ownership of the files), or with their data structure (and there's a few potential gotchas here to stumble into).
III - The Custom Data XML-file structure
Here's a generic template for the format you need to follow (in essence - you're looking at a pretty standard XML file)::
<?xml version="1.0"?>
<!-- OPTIONAL COMMENT #1 -->
<!-- OPTIONALCOMMENT #2 -->
<!-- OPTIONALCOMMENT #3 -->
<NAME_OF_CONTAINER_UNDER_CUSTOM_DATA>
<OPTIONAL_CONTAINER_SHORTNAME name="Some Optional Container Name">
<MyData1>VALUE</MyData1>
<MyData2>VALUE</MyData2>
(...)
<MyLastData>VALUE</MyLastData>
</OPTIONAL_CONTAINER_SHORTNAME>
</NAME_OF_CONTAINER_UNDER_CUSTOM_DATA>
... and we would aim to achieve something like the following for our custom data:
![]()
Note that you can EITHER use "your intended names" directly (as we do in the case of "<LongWindedWay>"-line below), or you can use a shorthand variable inside the XML whose 'full display name' you define (such as in the line "<LDCF name="LANDesk Custom Fields">"-line below)
A filled out Custom Data XML-file can then look like so:
* Note - for ease of readbility, I'm marking XML comments in THIS COLOUR.
<?xml version="1.0"?>
<!-- LANDesk Unix/Linux Agent - Custom Data XML Example File -->
<!-- Version 1.2.3.4 -->
<!-- My Team / My Date -->
<!-- You can use long-names in the XML for your categories / attributes, such as for "Asset Information"-->
<!-- Note that you MUST NOT have spaces in your object-names/tags! -->
<!-- Addition of White Space for added readability is fine -->
<Asset_Information2>
<LDCF name="LANDesk Custom Fields_2">
<!-- Note that I use "REL-L-NUM" here! -->
<RELLNUM name="Location RELEASE NUMBER">9.5.0.1</RELLNUM>
<LOC name="Location In The World">London</LOC>
<LongWindedWay name="Comment">
This is me. Aren't I pretty?
</LongWindedWay>
</LDCF>
<!-- Note that you *CANNOT* use multiple "root" categories in a single XML. -->
<!-- So you cannot have both the "ASSET_INFORMATION" and the "USERINFO" groups in a single XML. -->
<!-- Just use multiple XML's in this case - the inventory scan will pick them all up.-->
<SC name="Some Other Category_2">
<!-- Note that I use "REL-U-NUM" here! Beware of similar attributes (such as REL-L-NUM above), it can make mistakes more likely -->
<RELUNUM name="User RELEASE NUMBER">9.5.0.1</RELUNUM>
<ORGUNIT name="Organisational Unit">MyUnit</ORGUNIT>
</SC>
</Asset_Information2>
This would then present itself in inventory as per the following two screenshots:
![New_Part1.jpg]()
![New_Part2.jpg]()
PLEASE NOTE:
It does *NOT* matter in what order you add the custom inventory data. By default, LANDesk will sort things alphabetically for you in the console anyway (as you can see in the screenshot used above). The below version of the very same XML-data has been reformatted to closer represent the inventory scan showing on the screenshot.
Keeping to such an alphabetic theme might make things easier for you to work with whilst your designing your custom data / if you have to edit it, but is not a requirement in the slightest.
IV - How to get multiple bits of Custom Data in
IV.1 - Option 1 - Multiple files (recommended)
This is a favourable option because it's easier to control & modify and you can have segragated data (i,e, a "Asset Information" and a "User Information" category for instance).
Also this makes it a lot more manageable if you need to update anything - if you have different scripts collecting different bits of custom data, it's much easier to just have "one function/script change one small file" rather than having a singular, massive XML.
This is by far the more manageable an friendly option.
IV.2 - Option 2 - A really long file
This is less recommended for two reasons:
* You're more likely to make mistakes (more lines == more likelihood, after all), and ...
* A single error would effectively prevent ALL of your custom data from being processed, rather than "just the particular part file".
* More complex to update and manage via scripts.
I'm not saying "it can't be done" (as I'm certain some people might take it as a challenge) - I'm merely highlighting the fact that you're inviting a lot of considerable problems with really no benefit in return.
V - Don't-s and Do-s
Just a recap and listing of experiences made.
V.1 - Don't-s...
* Don't forget to run "chown" and change ownership over to "landesk:landesk" on the directory as well as the XML file(-s), else we may not be able to read the contents of the file(-s).
* Don't assume that you get everything right the first time round. Test & re-test as it's it's simple to do. Remember - all it takes is "map-reporter -V 255". The verbose option will generally be your best friend to highlight problems with your XML's.
* Don't be adventurous with naming your XML-tags or object names. Generally, sticking to the following list is "safe":
- Characters from "a-z"
- Characters from "A-Z"
- Numbers (so 0-9)
- Using a dash ( - ) and an underscore ( _ )
XML doesn't necessarily deal very well with certain characters outside of those listed above - so try and avoid that risk.
Just to clarify, I'm talking about the XML-tags and object-names only here. So in the example given above in Section III, XML-tags would be things such as:
- The "LDCF" and the 'LANDesk Custom Fields_2" in ... <LDCF name="LANDesk Custom Fields_2">
- The "RELLNUM" as well as the LOCATION in ... <RELLNUM name="Location RELEASE NUMBER">9.5.0.1</RELLNUM>
Whilst certain characters such as ( & ) or ( * ) are relatively commonly avoided, some unexpected stumbling blocks do occur. For instance, I was reading out a certain piece of hardware information and the data that was given to me was a single string with a few ( : ) colons in it ... due to uniqueness concerns, we ended up trying auto-naming the attribute with such a ( : ) in it ... such as "Disk:0" for instance ... and this can get you into trouble.
Using such characters in the DATA VALUE tends to be fine (so that'd be for instance the "9.5.0.1" string in the above example of RELLNUM) but outside of that, be mindful that XML can scupper your well-laid plans. Test and re-test.
V.2 - Do...
* ... think carefully about what custom data you WANT to collect and what you may want to collect in the future / further down the line.
* ... design your XML's sensibly with this in mind will save you headaches further down the line (moving data from "place A" to "place B" is a pain - not only would it need to be done in the database, but in the XML's as well, and you'd be potentially facing some clients that don't update properly, etc. - so all sorts of fun to go wrong with data in (potentially) multiple places for different devices. Data consistency is your friend!
VI - What about 32-bit agents?
Due to current differences in architectural differences between the 64-bit MAP agent and the 32-bit agent the above process is not applicable to 32-bit agents.
If you end up being in a situation where you do need to add custom data to a current (up to LANDesk Management Suite version 9.5 at the time of writing) is essentially the following:
1 - Run inventory with the option to create an output file.
2 - Append your desired data in regulard inventory scanner format to the output file.
For the example used here, the correspondonding format data would look like so:
Custom Data - Asset_Information2 - LANDesk Custom Fields_2 - Location RELEASE NUMBER = 9.5.0.1
Custom Data - Asset_Information2 - LANDesk Custom Fields_2 - Location In The World = London
Custom Data - Asset_Information2 - LANDesk Custom Fields_2 - Comment = This is me. Aren't I pretty?
Custom Data - Asset_Information2 - Some Other Category_2 - User RELEASE NUMBER = 9.5.0.1
Custom Data - Asset_Information2 - Some Other Category_2 - Organisational Unit = MyUnit
VI.A - 32-bit MAP agent with IEM 2016 onwards
Please note that as of IEM 2016, the MAP-agent does come in 32-bit format, so the use of the XML's described here is fine with that.
VII - In Conclusion
This article should provide all of the information that you might require to work with custom data on *-IX operating systems, even if you have very little experience with it.