UCMDB and UD Practitioners Forum (Previously CMS)
cancel

uCMDB import CIs from database

Highlighted
Bednar
Occasional Advisor

uCMDB import CIs from database

Hello everyone,

I'm trying to import CIs from SQL Server 2005. I wrote jython script and I have problem with jdbc driver. I have errors like this:
File "IP_from_DB", line 27, in DiscoveryMain
DatabaseError: driver not found

I tried to add CLASSPATH on server (windows 2003) with new driver and I have the same error.

This is my script (with driver from ucmdb):

import logger
import modeling

from com.ziclix.python.sql import zxJDBC
from appilog.common.system.types import ObjectStateHolder
from appilog.common.system.types.vectors import ObjectStateHolderVector

##############################################
######## MAIN ##########
##############################################
def DiscoveryMain(Framework):
OSHVResult = ObjectStateHolderVector()
newIPOSH = ObjectStateHolder('ip')

IP = None
MASK = None

logger.info("It works")

newIPOSH.setStringAttribute('ip_address',IP)
newIPOSH.setStringAttribute('ip_domain',None)
newIPOSH.setStringAttribute('ip_netmask',MASK)

#path = Framework.getParameterValue('Path')
try:
d, u, p, v = "jdbc:mercury:sqlserver://10.0.0.180:1433", "user", "pass", "com.mercury.jdbc.sqlserver.SQLServerDriver"
db = zxJDBC.connect(d, u, p, v)
logger.info('DB connected')
cursor = db.cursor()
cursor.execute("SELECT * FROM network")

for row in execute.fetchall():
newIPOSH=modeling.createIpOSH(row[0],row[1])
OSHVResult.add(newIPOSH)
except:
logger.errorException('Cannot connect to DB')

return OSHVResult


Can somebody help me with this?

Best regards,
Bednar

 

 

P.S. This thread has been moevd from Application Perf Mgmt (BAC / BSM) Support and News Forum to CMS and Discovery Support and News Forum. - Hp Forum Moderator

8 REPLIES

Re: uCMDB import CIs from database

Hi Bednar,

Is there any reason why you are using this specific driver?

As far as I remember, uCMDB can find the topology of SQL 2005, therefore the driver should already be in the Discovery Probe. Have you tried to have a look in the SQL topology and use the same command to get your information?

Just to let you know as well, you could use as well the federation adapter (using the duplication)if it suits you. It is a bit more complicated to start using, but once you know it, it become more efficient because the engine is on the uCMDB server.

Regards,
Olivier Lauret
uCMDB and BAC Expert
EOH Europe
www.eoh-europe.com
Bednar
Occasional Advisor

Re: uCMDB import CIs from database

Hello Olivier.

In uCMDB is limitation to Oracle, MS SQL Server and MySQL. I don't know yet what has my customer.

I think I can use the federation adapter (genericDBAdapter?) but the description in hp documentation is obscure (like a whole uCMDB documentation) for me.

I've got script which works outside uCMDB and I think it could work in uCMDB (as another script to getting data from flat files).

Thank you, I will try to check federation adapter more precisely.

Best regards,
Bednar
Dmitry Shevchenko
HPE Expert

Re: uCMDB import CIs from database

Don't be confused with terminology. Federation adapter doesn't do any actual replication job. It's just a run-time query engine allowing to see CIs from different physical repositories in one view. But those CIs keep residing in separate places - no actual importing takes place.

Re: uCMDB import CIs from database

Hi Dimitry,

I thought we had a replication option in the federation part (replication Job). What this replication job used for?

Regards,
Olivier
Dmitry Shevchenko
HPE Expert

Re: uCMDB import CIs from database

Hi Olivier,

This is all about terminology that changes too fast. With current uCMDB terminology Federation != Replication. Replication option for making integrations is still in place but don't call it "federation" to avoid confusion.
Skazal
Regular Collector

Re: uCMDB import CIs from database

Bednar,

I was curious how you resolved what you were trying to do. Were you able to find a good simple solution?
Cesar Resendiz
Acclaimed Contributor

Re: uCMDB import CIs from database

Hello Guy

I'm in a similar situation, right now I have BAC 8.01 and the uCMDB installed in a different server, what I want to do is to see the CI's form the HP OVSD form the BAC, in small words want I want to do is connect this two CMDB's, So I wonder if the best method to do this is Using the Fedaration Adapter?? also I wonder if you have a guide about how to do this, becuase the CMDB is quite poor about this topic.

Thanks
Cesar
Bednar
Occasional Advisor

Re: uCMDB import CIs from database

Thomas,

I didn't make it. The project wasn't begin and I didn't continue work on this.

Best regards,
Bednar
//Add this to "OnDomLoad" event