[ SEA-GHOST MINI SHELL]
Path : /proc/3/cwd/var/lib/zabbix/ |
|
Current File : //proc/3/cwd/var/lib/zabbix/lld-pacemaker-resourcegroups.py |
#!/usr/bin/python
import os
import json
import sys
OUTPUT = {"data": []}
list_groups = []
groups = os.popen("sudo pcs resource group list").readlines()
result = [resource.rstrip() for resource in groups]
def get_pacemaker_resource():
for item in result:
list_groups.append(item)
for x in list_groups:
y = x.split(":")
for i in y[1].split():
OUTPUT["data"].append({"{#PCSRESOURCE}":i})
return json.dumps(OUTPUT)
if __name__ == "__main__":
print(get_pacemaker_resource())
SEA-GHOST - SHELL CODING BY SEA-GHOST