Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 3.147.60.62
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
lib /
fm-agent /
plugins /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
0
B
-rw-r--r--
apache.py
19.06
KB
-rw-r--r--
apache_kafka.py
12.9
KB
-rw-r--r--
apache_zookeeper.py
6.26
KB
-rw-r--r--
bandwidth.py
21.3
KB
-rw-r--r--
cassandra.py
9.21
KB
-rw-r--r--
cert.py
2.78
KB
-rw-r--r--
couch.py
9.5
KB
-rw-r--r--
cpu_usage.py
33
KB
-rw-r--r--
dem_plugin.py
6.08
KB
-rw-r--r--
disk.py
16.48
KB
-rw-r--r--
docker.py
38.41
KB
-rw-r--r--
elasticsearch.py
2.83
KB
-rw-r--r--
entropy.py
900
B
-rw-r--r--
exim.py
1.01
KB
-rw-r--r--
file_presence.py
5
KB
-rw-r--r--
haproxy.py
13.37
KB
-rw-r--r--
io_stats.py
13.41
KB
-rw-r--r--
jboss.py
13.46
KB
-rw-r--r--
jmx.py
8.02
KB
-rw-r--r--
linux_logs.py
3.4
KB
-rw-r--r--
lm_sensors.py
2.51
KB
-rw-r--r--
logstash_forwarder.py
1.58
KB
-rw-r--r--
memcache.py
5.99
KB
-rw-r--r--
memory_usage.py
26.11
KB
-rw-r--r--
mongo.py
15.96
KB
-rw-r--r--
mysql.py
19.74
KB
-rw-r--r--
nagios.py
5.36
KB
-rw-r--r--
nginx.py
11.96
KB
-rw-r--r--
nodejs.py
6.29
KB
-rw-r--r--
ntp.py
1.98
KB
-rw-r--r--
opcache.py
2.26
KB
-rw-r--r--
oracle.py
15.15
KB
-rw-r--r--
package_upgrade.py
8.08
KB
-rw-r--r--
phpfpm.py
5.51
KB
-rw-r--r--
ping.py
2.45
KB
-rw-r--r--
postfix.py
1.98
KB
-rw-r--r--
postgresql.py
19.13
KB
-rw-r--r--
process.py
16.32
KB
-rw-r--r--
rabbitmq.py
19.33
KB
-rw-r--r--
redis.py
11.19
KB
-rw-r--r--
sendmail.py
2.39
KB
-rw-r--r--
sysctl.py
1.46
KB
-rw-r--r--
tcp.py
6.26
KB
-rw-r--r--
template.py
3.28
KB
-rw-r--r--
tomcat.py
6.79
KB
-rw-r--r--
tomcat_jmx.py
15.82
KB
-rw-r--r--
unbound_dns.py
4.54
KB
-rw-r--r--
uptime.py
3.46
KB
-rw-r--r--
users.py
1.09
KB
-rw-r--r--
uwsgi.py
4.57
KB
-rw-r--r--
varnish.py
4.79
KB
-rw-r--r--
weblogic.py
13.38
KB
-rw-r--r--
weblogic12c.py
18.75
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : dem_plugin.py
import agent_util from os import path from datetime import datetime import json import logging import sys import speedtest class DEMPlugin(agent_util.Plugin): textkey = "dem" label = "Digital Experience" log = logging.getLogger(__name__) @classmethod def get_metadata(self, config): status = agent_util.SUPPORTED msg = None dem_configured = True if config.get('enabled', 'false').lower() != 'true': status = agent_util.UNSUPPORTED msg = 'DEM not configured' dem_configured = False if dem_configured: info = config.get('wifi_results') if not info: status = agent_util.UNSUPPORTED msg = 'No wifi info found' metadata = { 'dem.agrCtlRSSI' : { 'label' : 'Wifi signal strength', 'options' : None, 'status' : status, 'error_msg' : msg, 'unit' : 'dBm' }, 'dem.lastTxRate' : { 'label' : 'Last transmission rate', 'options' : None, 'status' : status, 'error_msg' : msg, 'unit' : 'mbps/s' }, 'dem.agrCtlNoise' : { 'label' : 'Noise', 'options' : None, 'status' : status, 'error_msg' : msg, 'unit' : 'dBm' }, 'dem.MCS' : { 'label' : 'MCS Index', 'options' : None, 'status' : status, 'error_msg' : msg, 'unit' : 'index' }, 'dem.downloadspeed' :{ 'label' : 'Download Speed', 'options' : None, 'status' : agent_util.SUPPORTED, 'error_msg' : None, 'unit' : 'Mbit/s' } } speedtest_upload = agent_util.SUPPORTED speedtest_msg = None if config.get('speedtest_mode', 'speedtest').lower() != 'iperf3' or not dem_configured: speedtest_upload = agent_util.UNSUPPORTED speedtest_msg = 'Upload speed not supported' metadata['dem.uploadspeed'] ={ 'label' : 'Upload Speed', 'options' : None, 'status' : speedtest_upload, 'error_msg' : speedtest_msg, 'unit' : 'Mbit/s' } battery_status = agent_util.SUPPORTED battery_msg = None if not dem_configured: battery_status = agent_util.UNSUPPORTED battery_msg = 'DEM not configured' else: battery_pct = self.get_battery_remaining() if battery_pct is None: battery_status = agent_util.UNSUPPORTED battery_msg = 'Battery metric unavailable' metadata['dem.battery_percent_remaining'] ={ 'label' : 'Battery Percent Remaining', 'options' : None, 'status' : battery_status, 'error_msg' : battery_msg, 'unit' : 'percent' } return metadata def check(self, textkey, data, config): if config.get('enabled', 'false').lower() != 'true': return None if textkey in ('dem.downloadspeed', 'dem.uploadspeed'): return self._measureNetworkSpeed(textkey, config) if 'dem.battery_percent_remaining' == textkey: return self.get_battery_remaining() try: info = config.get('wifi_results') key = textkey[len('dem.'):] metric_value = info.get(key, None) if metric_value is None: raise Exception("Missing key {}".format(key)) return float(metric_value) except: self.log.exception('Wifi metrics:') return None def _run_iperf3_test(self, textkey, config): speedtest_bin = '/usr/local/FortiMonitor/agent/latest/bin/iperf3' try: start_url = config.get( 'iperf3_start_url', None ) from iperf3 import Iperf3Runner runner = Iperf3Runner(iperf3_bin=speedtest_bin, start_url=start_url) result = None if 'dem.downloadspeed' == textkey: result = runner.get_download_speed() elif 'dem.uploadspeed' == textkey: result = runner.get_upload_speed() return float(result / (1000 * 1000)) except: self.log.exception('Iperf3 error:') def _measureNetworkSpeed(self, textkey, config): if config.get('speedtest_mode', 'speedtest').lower() == 'iperf3': return self._run_iperf3_test(textkey, config) if 'dem.uploadspeed' == textkey: raise Exception('Service does not support upload speed') try: start = datetime.now() s = speedtest.Speedtest() s.get_best_server() k = s.download() rv = float(k / 1000000) self.log.info('Download speed {} in {:.2f}'.format( rv, (datetime.now() - start).total_seconds() )) return rv except Exception as ste: self.log.error('Speedtest exception: {}'.format(ste)) return None @classmethod def get_battery_remaining(self): try: sp = agent_util.which('system_profiler') power_tk = 'SPPowerDataType' from subprocess import Popen, PIPE d = Popen([sp, '-json', power_tk], stdout=PIPE) data = json.loads(d.stdout.read()) for d in data[power_tk]: if d.get('_name', '') == 'spbattery_information': mv = d.get('sppower_battery_charge_info', None) if not mv: return None return float(mv['sppower_battery_state_of_charge']) return None except Exception as e: self.log.error('Battery exception: {}'.format(e)) return None
Close