## 8.4.2  Monitoring SAP HANA System Replication with hdbnsutil
You can monitor SAP HANA system replication using hdbnsutil .
## Standard System Replication
To view the status of the system replication topology configuration on both systems, execute hdbnsutil -sr\_state on the primary and the secondary:
```
tedadm@ld2131:/usr/sap/TED/HDB07> hdbnsutil -sr_state checking for active or inactive nameserver ... System Replication State
```
```
~~~~~~~~~~~~~~~~~~~~~~~~ mode: primary site id: 1 site name: SITEA Host Mappings: ~~~~~~~~~~~~~~ ld2131 -> [SITEA] ld2131 ld2131 -> [SITEB] ld2132 done.
```
## Multitier System Replication
For a multitier system replication the mappings of all three systems are displayed:
```
ut1adm@ld2131:/usr/sap/UT1/HDB01> hdbnsutil -sr_state checking for active or inactive nameserver ... System Replication State ~~~~~~~~~~~~~~~~~~~~~~~~ mode: primary site id: 1 site name: SITEA Host Mappings: ~~~~~~~~~~~~~~ ld2131 ->[SITEA] ld2131 ld2131 ->[SITEC] ld2133 ld2131 ->[SITEB] ld2132 done.
```
When using the additional option --sapcontrol=1 , the key value pair output can be parsed by a script line by line.
Here is the output where the -sr\_state command was executed on a primary system of a multitier system replication:
```
ut1adm@ld2131:/usr/sap/UT1/HDB01> hdbnsutil -sr_state --sapcontrol=1 checking for active or inactive nameserver ... SAPCONTROL-OK: <begin> mode=primary site id=1 site name=SITEA mapping/ld2131=SITEA/ld2131 mapping/ld2131=SITEC/ld2133 mapping/ld2131=SITEB/ld2132 SAPCONTROL-OK: <end> Done
```
Here is the output where the -sr\_state command was executed on a tier 2 secondary site of a multitier system replication:
```
ut1adm@ld2132:/usr/sap/UT1/HDB01> hdbnsutil -sr_state --sapcontrol=1 checking for active or inactive nameserver ... SAPCONTROL-OK: <begin> mode=sync site id=2 site name=SITEB active primary site=1 mapping/ld2132=SITEA/ld2131 mapping/ld2132=SiteC/ld2133
```
mapping/ld2132=SITEB/ld2132 primary masters=ld2131 SAPCONTROL-OK: &lt;end&gt; done.
## Output Reference
| Output                | Description                                                                                                                                                                                                                                                                                                                           |
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Mode                  | Can have the values primary , sync , async , and syncmem to represent the mode relevant on the system where the command is executed. For example, in a multitier system replication on the primary the mode would be primary , on the tier 2 secondary it could be either sync or syncmem , and on the tier 3 secondary it is async . |
| Site ID               | A unique identifier of a system which is incremented for each system attachedtoaSAPHANA system replication. It is removed, when system replication is disabled.                                                                                                                                                                       |
| SiteName              | The name you give your systems during the enable and register steps of the system replica­ tion configuration.                                                                                                                                                                                                                         |
| Mapping/<currentHost> | Shows which hosts are involved in this SAP HANAsystem replication together with their sys­ tem name. If the SAP HANAdatabase is offline, this host mapping cannot be shown on the secondaries.                                                                                                                                         |
| Active primary site   | Shows the system ID of the currently active system.                                                                                                                                                                                                                                                                                   |
| Primary masters       | Shows the host names of the currently active master candidates of the primary.                                                                                                                                                                                                                                                        |
##  Note
When running hdbnsutil -sr\_state on an offline SAP HANA, no host mapping will be available. For more information, see SAP Note 2315257 .
## Related Information
<!-- image -->
SAP Note 2315257