# Tips & Tricks

<div id="bkmrk-"><div><div>  
</div></div></div>##### When was xroad-securityserver package last upgraded

```
ls -t /var/log/dpkg* | xargs zgrep "upgrade xroad-securityserver"
```

##### Editing keyconf

1. On master node, stop xroad-signer process
2. Edit keyconf
3. On master node, start xroad-signer process
4. Restart xroad-signer on slave nodes

##### Grep packet loss

```
cat /var/log/xroad/*.log|grep -v "org.eclipse.jetty.io.EofException: null"|wc -l
```

##### Time opmonitor database read

```
time echo "select count(id) from operational_data;" | psql -h 127.0.0.1 -U opmonitor -W op-monitor
```

##### Keyconfist välja parseda serdid normaliseeritud kujul

```
cat /etc/xroad/signer/keyconf.xml | python -c "exec(\"import sys, xml.etree.ElementTree as ET\\nroot=ET.fromstring(sys.stdin.read())\\nfor cert in root.findall('.//cert/contents'):\\n print '-----BEGIN CERTIFICATE-----\\\\n'+str('\\\\n').join([cert.text[i:i+64] for i in range(0, len(cert.text), 64)])+'\\\\n-----END CERTIFICATE-----'\")"
```

##### Logback location

```
/etc/xroad/conf.d/
```

##### Global conf location in ss

```
/etc/xroad/globalconf/<environment>/shared-params.xml
```

##### List xroad services status

```
`systemctl list-units "xroad*"`
```

##### Stop all xroad processes

```
systemctl stop xroad-*
```

##### Environmental monitoring

is the monitoring of the X-Road environment: details of the security servers such as operating system, memory, disk space, CPU load, running processes and installed packages, etc.

##### Operational monitoring

is the monitoring of operational statistics such as which services have been called, how many times, what is the average response time, etc.

##### Count proxy open files

```
lsof -p `systemctl show -p MainPID xroad-proxy.service|cut -d'=' -f2`|wc -l
```