Hackfut Security File Manager
Current Path:
/usr/local/lib/python3.6/site-packages/agent360/plugins
usr
/
local
/
lib
/
python3.6
/
site-packages
/
agent360
/
plugins
/
📁
..
📄
__init__.py
(0 B)
📁
__pycache__
📄
apt-updates.py
(1.23 KB)
📄
asterisk.py
(1012 B)
📄
bind.py
(732 B)
📄
bird.py
(841 B)
📄
bitninja.py
(1.27 KB)
📄
cloudlinux-dbgov.py
(1.04 KB)
📄
cloudlinux.py
(1020 B)
📄
cpanel.py
(1.41 KB)
📄
cpu.py
(1.97 KB)
📄
cpu_freq.py
(583 B)
📄
dirsize.py
(617 B)
📄
diskinodes.py
(652 B)
📄
diskstatus-nvme.py
(1.58 KB)
📄
diskstatus.py
(1.96 KB)
📄
diskusage.py
(4.04 KB)
📄
docker.py
(3.36 KB)
📄
dovecot.py
(1.27 KB)
📄
elasticsearch.py
(4.24 KB)
📄
exim.py
(484 B)
📄
fail2ban.py
(831 B)
📄
gpu.py
(959 B)
📄
haproxy.py
(4.17 KB)
📄
httpd.py
(2.73 KB)
📄
iostat.py
(5.1 KB)
📄
janus.py
(705 B)
📄
kamailio.py
(556 B)
📄
litespeed.py
(3.04 KB)
📄
loadavg.py
(332 B)
📄
loggedin.py
(400 B)
📄
mailq.py
(528 B)
📄
mdstat.py
(1.36 KB)
📄
megacli.py
(2.72 KB)
📄
memcached.py
(3.09 KB)
📄
memory.py
(932 B)
📄
minecraft.py
(2.35 KB)
📄
mongodb.py
(5.63 KB)
📄
mysql.py
(5.13 KB)
📄
network.py
(2.72 KB)
📄
nginx.py
(3.2 KB)
📄
openvpn.py
(2.17 KB)
📄
phpfpm.py
(2.72 KB)
📄
ping.py
(3.09 KB)
📄
plesk-cgroups.py
(6.18 KB)
📄
plugins.py
(2.48 KB)
📄
postfix.py
(1.73 KB)
📄
powerdns.py
(4.56 KB)
📄
process.py
(4.26 KB)
📄
proftpd.py
(1.1 KB)
📄
rabbitmq.py
(3.49 KB)
📄
redis_stat.py
(5.48 KB)
📄
sleeper.py
(244 B)
📄
swap.py
(364 B)
📄
system.py
(5.67 KB)
📄
tcpports.py
(1.08 KB)
📄
temp.py
(1.45 KB)
📄
unbound.py
(3.24 KB)
📄
vms.py
(6.2 KB)
📄
wp-toolkit.py
(1.8 KB)
📄
yum-updates.py
(810 B)
Editing: litespeed.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import plugins import os import time import re import base64 class Plugin(plugins.BasePlugin): __name__ = 'litespeed' ''' Litespeed monitoring plugin. Add the following section to /etc/agent360.ini [litespeed] enabled=yes host=localhost port=7080 username=admin password=pass ''' def run(self, config): result = {} results = {} data = False prev_cache = self.get_agent_cache() # Get absolute values from previous check response = os.popen("curl -s -i -k -u %s:%s 'https://%s:%s/status?rpt=summary'"% (config.get('litespeed', 'username'), config.get('litespeed', 'password'), config.get('litespeed', 'host'),config.get('litespeed', 'port'))).read() for line in response.splitlines(): test = re.search('REQ_RATE \[(.*)\]', line) if test is not None and test.group(1): data = True try: result[test.group(1)] except KeyError: result[test.group(1)] = {} lines = line.replace('\n', '').replace(test.group(0), '').split(', ') for line in lines: keyval = line.strip(':').strip().split(':') try: result[test.group(1)][keyval[0]] += float(keyval[1]) except KeyError: result[test.group(1)][keyval[0]] = float(keyval[1]) metrics = ( 'SSL_BPS_IN', 'BPS_OUT', 'MAXSSL_CONN', 'PLAINCONN', 'BPS_IN', 'SSLCONN', 'AVAILSSL', 'IDLECONN', 'SSL_BPS_OUT', 'AVAILCONN', 'MAXCONN', 'REQ_PROCESSING' ) if data is True: for vhost, statistics in result.items(): try: prev_cache[vhost]['ts'] = prev_cache['ts'] except KeyError: prev_cache[vhost] = {} results[vhost] = {} for key, value in statistics.items(): if key == 'TOT_REQS': results[vhost]['RPS'] = self.absolute_to_per_second(key, value, prev_cache[vhost]) if key == 'TOTAL_STATIC_HITS': results[vhost]['STATIC_RPS'] = self.absolute_to_per_second(key, value, prev_cache[vhost]) if key == 'TOTAL_PUB_CACHE_HITS': results[vhost]['PUB_CACHE_RPS'] = self.absolute_to_per_second(key, value, prev_cache[vhost]) if key == 'TOTAL_PRIVATE_CACHE_HITS': results[vhost]['PRIVATE_CACHE_RPS'] = self.absolute_to_per_second(key, value, prev_cache[vhost]) if key in metrics: results[vhost][key] = value result['ts'] = time.time() self.set_agent_cache(result) return results if __name__ == '__main__': Plugin().execute()
Upload File
Create Folder