# Labs

> psutil is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network)in Python. [Psutil Library](https://pypi.python.org/pypi/psutil)

Install the required python library

```bash
root@edison:~# opkg install python-pip
root@edison:~# pip install psutil
```

```bash
root@edison:~# vi sensors.py
```

```python
#!/usr/bin/python

import psutil
import time

if __name__ == '__main__':

    while True:
        netdata = psutil.net_io_counters()
        data = netdata.packets_sent + netdata.packets_recv
        print "Data: %s " % data
        time.sleep(5)

# End of File
```

```bash
root@edison:~# python sensors.py 
Data: 1877 
Data: 1881
...
```
