Priyankasingh
New Member.

Re: UCMDB - WMI_Connection_Util.py - Custom Attribute for current date\time

Hi,

 

For RHEL unix servers, I got the command to get osinstall date

 

rpm -qi basesystem | grep -i "Install Date"

 

 

I need to modify the Unix discovery script to get the osinstalldate on the Unix CI and then updating the custom attribute.

 

So, Please tell me which scipts needs to be modified to discover osinstalldate.

 

Thanks

Priyanka

 

0 Likes
Highlighted
Absent Member.. jowillia Absent Member..
Absent Member..

Re: UCMDB - WMI_Connection_Util.py - Custom Attribute for current date\time

I would suggest you write a custom script and package it separately. As I mentioined in the first post, modifying OOB scripts is not a great idea.

The package you need to create can then also be used for the next custom attribute you decide you want. 

0 Likes
Acclaimed Contributor.. Dima Gomel Acclaimed Contributor..
Acclaimed Contributor..

Re: UCMDB - WMI_Connection_Util.py - Custom Attribute for current date\time

To elaborate on previous post.

When we saying that changing of OOTB script isn't a good practice, we are not meaning you can't implement what ever you want. You can and system sypporting it.

HP takes OOTB files as our zone of responsibilities. They will be owerride with every CP update you will install. So,  If you need to implement a change to OOTB job, do a copy, call it CustomerX_WMI_Connection_Util.py. This will presave results of your work.

Remember, that you could raise enhancement request for the product. If the request is not unique for other customers, it will be implemented by HP.

 

As a general guidelines for debugging of created code.

1. Do the change in the script.

2. Retrive  a communication log with results. Check that results contains information that need to be populated as value for appropriate attribute on expected CIT. (it's in XML form at the end of the script).

3. Go to server and check mam.autodicovery.audit.log. Every data-in operation (AKA bulk in case of dicovery) will have two strings of printouts. search by Job name/timestamp. The fisrt string will show what you sending from the script, the second will either show success of reconciliation of sended data, or error.

4.  In case of error, please check reconciliation.log  for specific problem. It could be needed to be moved to DEBUG in /UCMDBServer/conf/log/cmdb.reconciliation.properties.

 

Be also aware about redundancy filter on the probe side. If you are on UCMDB 9, be sure that the attribute you sending will have Probe_Side_ID qualifier on the class model. In UCMDB 10 all attributes are monitored for the change in redundancy filter.

 

Hope this helps.

Regards
-Dmitry Gomel, PMP
Click the Like button at the bottom to say 'Thanks'.
0 Likes
PriyankaSingh2 Regular Contributor.
Regular Contributor.

Re: UCMDB - WMI_Connection_Util.py - Custom Attribute for current date\time

Hi Dima,

 

To Disocover osinstalldate for unix, I have modified the TTY_Connection_Utils.py script.

 

But in communication log, getting the error as 

 

AttributeError: class HostDataObject has no attribute 'ATTRIBUTE_OS_INSTALLDATE'

 

Please help me to resolve this.

 

 

Thanks

Priyanka

 

 

 

0 Likes
Acclaimed Contributor.. Dima Gomel Acclaimed Contributor..
Acclaimed Contributor..

Re: UCMDB - WMI_Connection_Util.py - Custom Attribute for current date\time

Is 'ATTRIBUTE_OS_INSTALLDATE' a new attribute you're willing to populate?

If yes, was it added to the class model?

Regards
-Dmitry Gomel, PMP
Click the Like button at the bottom to say 'Thanks'.
0 Likes
PriyankaSingh2 Regular Contributor.
Regular Contributor.

Re: UCMDB - WMI_Connection_Util.py - Custom Attribute for current date\time

Hi,

 

I have added OS_INSTALLDATE attribute in class model and it works.

 

Thanks for the help.

 

Priyanka

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.