DX Infrastructure Management

 View Only

How to identify Elements using the same IP Address and Delete them on eHealth using the command line. 

Feb 19, 2015 03:03 PM

as the eHealth User, NH_USER from the $NH_HOME/bin on the command line or Terminal follow the instructions below:

 

1. nhListElements -where "ipAddr matches  *<ip address>*" -outFile elements.txt

(this will generate the output file containing the elements name associated with the Ip address listed)

 

2. Vi elements.txt to review the Elements names.

 

 

3. nhListElements -where "ipAddr matches  *<ip address>*" |nhDeleteElements

 

 

Note that deleting elements removes all historical data for the deleted elements as well as the elements configuration. There is no way to undo this action. The only recourse to restore the data is to restore a backup of the eHealth database. Any data collected between the time of the save and the load would be lost for all elements, not just the deleted ones.

Statistics
0 Favorited
1 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Feb 20, 2015 02:38 AM

Hello

 

  • Deleted elements are "transfered" to the nh_deleted_elements table. Basically you have to transfer them back to nh_element, fix nh_elem_assoc and restart eHealth. Perhaps I forgot one step (rediscover? I'm not sure anymore), but it is possible to restore deleted elements without full DB restore (even if it's not an simple task). Attention: Elements are removed from nh_deleted_elements after a few days.
  • Statistical/Historical data is not removed from database by deleting elements. Data will be "aged out" during rollup (i.e. depending on rollup job or nhModifyTimeAlignSettings). So you can access this information for a long time as long as you know element_id

 

Regards

  Leo

Feb 19, 2015 03:18 PM

This is a good solution!  I would like to add one additional note for you…

 

This is a little safer method with a very important bonus - if you find elements in your elements.txt file that you DON’T want to delete, you can remove those entries from your file and then run the delete command.

 

After you check your element.txt file that you created in the first step with nhListElements, you can run the nhDeleteElements command and simply feed it your file:

 

nhDeleteElements –inFile elements.txt

 

HTH,

Chris

Related Entries and Links

No Related Resource entered.