OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
landscape
/
sysinfo
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/14/2020 08:21:47 AM
rwxr-xr-x
📄
__init__.py
0 bytes
02/22/2018 02:19:04 PM
rw-r--r--
📁
__pycache__
-
10/14/2020 08:21:47 AM
rwxr-xr-x
📄
deployment.py
4.86 KB
02/20/2020 05:35:22 PM
rw-r--r--
📄
disk.py
2.52 KB
02/22/2018 02:19:04 PM
rw-r--r--
📄
landscapelink.py
336 bytes
02/22/2018 02:19:04 PM
rw-r--r--
📄
load.py
264 bytes
02/22/2018 02:19:04 PM
rw-r--r--
📄
loggedinusers.py
497 bytes
02/22/2018 02:19:04 PM
rw-r--r--
📄
memory.py
606 bytes
02/22/2018 02:19:04 PM
rw-r--r--
📄
network.py
1.14 KB
02/22/2018 02:19:04 PM
rw-r--r--
📄
processes.py
896 bytes
02/22/2018 02:19:04 PM
rw-r--r--
📄
sysinfo.py
9.72 KB
02/22/2018 02:19:04 PM
rw-r--r--
📄
temperature.py
806 bytes
02/22/2018 02:19:04 PM
rw-r--r--
📄
testplugin.py
541 bytes
02/22/2018 02:19:04 PM
rw-r--r--
Editing: network.py
Close
from twisted.internet.defer import succeed from landscape.lib.network import get_active_device_info class Network(object): """Show information about active network interfaces. @param get_device_info: Optionally, a function that returns information about network interfaces. Defaults to L{get_active_device_info}. """ def __init__(self, get_device_info=None): if get_device_info is None: get_device_info = get_active_device_info self._get_device_info = get_device_info def register(self, sysinfo): """Register this plugin with the sysinfo system. @param sysinfo: The sysinfo registry. """ self._sysinfo = sysinfo def run(self): """ Gather information about network interfaces and write it to the sysinfo output. @return: A succeeded C{Deferred}. """ for info in self._get_device_info(): interface = info["interface"] ip_address = info["ip_address"] self._sysinfo.add_header("IP address for %s" % interface, ip_address) return succeed(None)