How to list the retired elements by using the command?

Document ID : KB000039425
Last Modified Date : 14/02/2018
Show Technical Document Details

Question: 

Is there a way to list the retired elements using the command?

Answer: 

There are 4 possible values for nmsState:

71000 = NA (This is the default state, not retired, never un-retired)

71001 = Active (Element has been un-retired)

71002 = Deleted (You should generally not see these)

71003 = Retired (Retired)

So elements which are not retired can be Active or NA.

 

(1) To list the retired elements with basic nhListElements command:

nhListElements -where "nmsState = Retired"  //for retired

nhListElements -where "nmsState != Retired" //for not retired

 

(2)Use sql statements to query DB:

$NH_HOME/bin/sys/nhisql "select name, n.nms_state from nh_element;" > elements.txt

//71000 is polled and 71003 is retired

Example:

$NH_HOME/bin/sys/nhisql "select name, n.nms_state from nh_element where nms_state like 71003;”

$NH_HOME/bin/sys/nhisql "select name, n.nms_state from nh_element where nms_state like 71000;”