Automatic import CMDB data from AD

Moderator: crythias

Locked
Kris
Znuny newbie
Posts: 49
Joined: 28 Mar 2013, 13:02
Znuny Version: 3.2.3
Real Name: Kris ten Hoedt
Company: Prominent

Automatic import CMDB data from AD

Post by Kris »

Hiya all,

I'm working on the following:

I managed to build a VBS script that will fill a custom attribute for computer objects in AD.
This script uses WMI data to get the required data from the machine and stores it in 'ExtensionAttribute1' as a semicolon seperated text-string.
This script runs during the logon script, so every time a user logs on, the computer data is updated.
Then I created a script that retreives the 'ExtensionAttribute1' attribute for all computer objects and stores it in a CSV file.
Which obviously is a semicolon CSV file :-)
I have this script scheduled to run once every hour
It takes less than a second to run... (mind you, our AD is single domain, and we only have about 250 computers)
So I created an Import template, which maps the fields from the file to the fields in CMDB.
Et voila, I can populate the CMDB with the IMPORT function.

So the question is: Can I run the import automatically, like maybe once an day, or even once an hour?
I tried the Generic Agent, but I cant quite see how that would work...

Any help would be greatly appreciated.

And if someone would like to have the scripts n stuff I'd be happy to share :D

Thanks!
Kris
Version: OTRS 3.2.3 + ITSM
OS: Win XP Pro SP3
DB: MySQL
Webserver: Apache
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Automatic import CMDB data from AD

Post by crythias »

Check out the otrs.ImportExport.pl script.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Kris
Znuny newbie
Posts: 49
Joined: 28 Mar 2013, 13:02
Znuny Version: 3.2.3
Real Name: Kris ten Hoedt
Company: Prominent

Re: Automatic import CMDB data from AD

Post by Kris »

Brilliant! Thanks!

Although it throws some errors (on a import file that runs fine from the manual Import thingy) it does seem to import records.
Any ideas on the errors?

Code: Select all

C:\OTRS\OTRS\bin>perl otrs.ImportExport.pl -n 000001 -a import -i /otrs/CMDB_Import/cmdb_from_ad.txt

Read File /otrs/CMDB_Import/cmdb_from_ad.txt.
Import in process...
ERROR: OTRS-ImportExport-10 Perl: 5.12.3 OS: MSWin32 Time: Fri Jun  7 15:25:28 2013

 Message: ImportError at line 76, ErrorCode: 2012 'EOF - End of data in parsing input stream'

 Traceback (3952):
   Module: Kernel::System::ImportExport::FormatBackend::CSV::ImportDataGet (v1.29) Line: 325
   Module: Kernel::System::ImportExport::Import (v1.44) Line: 2188
   Module: otrs.ImportExport.pl (v1.3) Line: 128


Import of 75 ITSMConfigItem records: 0 failed, 75 succeeded
Import of 75 ITSMConfigItem records: 2 Changed
Import of 75 ITSMConfigItem records: 73 Skipped
Version: OTRS 3.2.3 + ITSM
OS: Win XP Pro SP3
DB: MySQL
Webserver: Apache
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Automatic import CMDB data from AD

Post by crythias »

unknown. Look here: viewtopic.php?f=62&t=17205
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked