# Monitor CPU load of DB Server

**URL:** <https://forum.inductiveautomation.com/t/monitor-cpu-load-of-db-server/43939>\
**Category:** Ignition\
**Created:** [March 1, 2021, 1:14pm UTC](https://forum.inductiveautomation.com/t/monitor-cpu-load-of-db-server/43939 "2021-03-01T13:14:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 1, 2021, 1:14pm UTC](https://forum.inductiveautomation.com/t/monitor-cpu-load-of-db-server/43939/1 "2021-03-01T13:14:24Z")

</div>

Is there a good way to monitor the CPU load of my database server? I just recently moved my DB to another server previously hosted on the same server has Ignition. I would like setup a tag to contain and monitor the CPU load. DB server is Windows Server 2019.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 1, 2021, 5:05pm UTC](https://forum.inductiveautomation.com/t/monitor-cpu-load-of-db-server/43939/2 "2021-03-01T17:05:03Z")

</div>

I think I got it. I will use a `system.util.execute()` function in a gateway script to invoke

```auto
wmic /node:<ip address> cpu get deviceid, name, numberofcores, maxclockspeed, status, loadpercentage

```

which will return info to be parsed and written to tags.

```auto
def cpuLoad():
	import subprocess
	proc = subprocess.Popen(['powershell.exe', "wmic /node:<ipaddr> cpu get loadpercentage"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
	output = proc.stdout.read()
	print output	
cpuLoad()

```
