Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3.6 /
site-packages /
salt /
runners /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
26
B
-rw-r--r--
2022-05-16 09:16
asam.py
11.2
KB
-rw-r--r--
2022-05-16 09:16
auth.py
1.69
KB
-rw-r--r--
2022-05-16 09:16
bgp.py
17.5
KB
-rw-r--r--
2022-05-16 09:16
cache.py
12.72
KB
-rw-r--r--
2022-05-16 09:16
cloud.py
4.18
KB
-rw-r--r--
2022-05-16 09:16
config.py
913
B
-rw-r--r--
2022-05-16 09:16
ddns.py
8.89
KB
-rw-r--r--
2022-05-16 09:16
digicertapi.py
21.63
KB
-rw-r--r--
2022-05-16 09:16
doc.py
1.39
KB
-rw-r--r--
2022-05-16 09:16
drac.py
5.29
KB
-rw-r--r--
2022-05-16 09:16
error.py
545
B
-rw-r--r--
2022-05-16 09:16
event.py
2.1
KB
-rw-r--r--
2022-05-16 09:16
f5.py
9.58
KB
-rw-r--r--
2022-05-16 09:16
fileserver.py
17.37
KB
-rw-r--r--
2022-05-16 09:16
git_pillar.py
3.98
KB
-rw-r--r--
2022-05-16 09:16
http.py
2.35
KB
-rw-r--r--
2022-05-16 09:16
jobs.py
17.45
KB
-rw-r--r--
2022-05-16 09:16
launchd.py
1.35
KB
-rw-r--r--
2022-05-16 09:16
lxc.py
18.14
KB
-rw-r--r--
2022-05-16 09:16
manage.py
25.84
KB
-rw-r--r--
2022-05-16 09:16
mattermost.py
4.68
KB
-rw-r--r--
2022-05-16 09:16
mine.py
1.68
KB
-rw-r--r--
2022-05-16 09:16
nacl.py
8.15
KB
-rw-r--r--
2022-05-16 09:16
net.py
38.97
KB
-rw-r--r--
2022-05-16 09:16
network.py
2.42
KB
-rw-r--r--
2022-05-16 09:16
pagerduty.py
4.5
KB
-rw-r--r--
2022-05-16 09:16
pillar.py
5.14
KB
-rw-r--r--
2022-05-16 09:16
pkg.py
1.35
KB
-rw-r--r--
2022-05-16 09:16
queue.py
8.88
KB
-rw-r--r--
2022-05-16 09:16
reactor.py
4.97
KB
-rw-r--r--
2022-05-16 09:16
salt.py
4.69
KB
-rw-r--r--
2022-05-16 09:16
saltutil.py
21.5
KB
-rw-r--r--
2022-05-16 09:16
sdb.py
2.14
KB
-rw-r--r--
2022-05-16 09:16
smartos_vmadm.py
11.73
KB
-rw-r--r--
2022-05-16 09:16
spacewalk.py
9.8
KB
-rw-r--r--
2022-05-16 09:16
ssh.py
771
B
-rw-r--r--
2022-05-16 09:16
state.py
8.88
KB
-rw-r--r--
2022-05-16 09:16
survey.py
5.84
KB
-rw-r--r--
2022-05-16 09:16
test.py
1.75
KB
-rw-r--r--
2022-05-16 09:16
thin.py
1.74
KB
-rw-r--r--
2022-05-16 09:16
vault.py
10.09
KB
-rw-r--r--
2022-05-16 09:16
venafiapi.py
6.68
KB
-rw-r--r--
2022-05-16 09:16
virt.py
17.59
KB
-rw-r--r--
2022-05-16 09:16
vistara.py
5.6
KB
-rw-r--r--
2022-05-16 09:16
winrepo.py
8.57
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
""" Manage Dell DRAC from the Master The login credentials need to be configured in the Salt master configuration file. .. code-block:: yaml drac: username: admin password: secret """ import logging try: import paramiko HAS_PARAMIKO = True except ImportError: HAS_PARAMIKO = False log = logging.getLogger(__name__) def __virtual__(): if HAS_PARAMIKO: return True return ( False, "The drac runner module cannot be loaded: paramiko package is not installed.", ) def __connect(hostname, timeout=20, username=None, password=None): """ Connect to the DRAC """ drac_cred = __opts__.get("drac") err_msg = ( "No drac login credentials found. Please add the 'username' and 'password' " "fields beneath a 'drac' key in the master configuration file. Or you can " "pass in a username and password as kwargs at the CLI." ) if not username: if drac_cred is None: log.error(err_msg) return False username = drac_cred.get("username", None) if not password: if drac_cred is None: log.error(err_msg) return False password = drac_cred.get("password", None) client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: client.connect(hostname, username=username, password=password, timeout=timeout) except Exception as e: # pylint: disable=broad-except log.error("Unable to connect to %s: %s", hostname, e) return False return client def __version(client): """ Grab DRAC version """ versions = { 9: "CMC", 8: "iDRAC6", 10: "iDRAC6", 11: "iDRAC6", 16: "iDRAC7", 17: "iDRAC7", } if isinstance(client, paramiko.SSHClient): (stdin, stdout, stderr) = client.exec_command("racadm getconfig -g idRacInfo") for i in stdout.readlines(): if i[2:].startswith("idRacType"): return versions.get(int(i[2:].split("=")[1]), None) return None def pxe(hostname, timeout=20, username=None, password=None): """ Connect to the Dell DRAC and have the boot order set to PXE and power cycle the system to PXE boot CLI Example: .. code-block:: bash salt-run drac.pxe example.com """ _cmds = [ "racadm config -g cfgServerInfo -o cfgServerFirstBootDevice pxe", "racadm config -g cfgServerInfo -o cfgServerBootOnce 1", "racadm serveraction powercycle", ] client = __connect(hostname, timeout, username, password) if isinstance(client, paramiko.SSHClient): for i, cmd in enumerate(_cmds, 1): log.info("Executing command %s", i) (stdin, stdout, stderr) = client.exec_command(cmd) if "successful" in stdout.readline(): log.info("Executing command: %s", cmd) else: log.error("Unable to execute: %s", cmd) return False return True def reboot(hostname, timeout=20, username=None, password=None): """ Reboot a server using the Dell DRAC CLI Example: .. code-block:: bash salt-run drac.reboot example.com """ client = __connect(hostname, timeout, username, password) if isinstance(client, paramiko.SSHClient): (stdin, stdout, stderr) = client.exec_command("racadm serveraction powercycle") if "successful" in stdout.readline(): log.info("powercycle successful") else: log.error("powercycle racadm command failed") return False else: log.error("client was not of type paramiko.SSHClient") return False return True def poweroff(hostname, timeout=20, username=None, password=None): """ Power server off CLI Example: .. code-block:: bash salt-run drac.poweroff example.com """ client = __connect(hostname, timeout, username, password) if isinstance(client, paramiko.SSHClient): (stdin, stdout, stderr) = client.exec_command("racadm serveraction powerdown") if "successful" in stdout.readline(): log.info("powerdown successful") else: log.error("powerdown racadm command failed") return False else: log.error("client was not of type paramiko.SSHClient") return False return True def poweron(hostname, timeout=20, username=None, password=None): """ Power server on CLI Example: .. code-block:: bash salt-run drac.poweron example.com """ client = __connect(hostname, timeout, username, password) if isinstance(client, paramiko.SSHClient): (stdin, stdout, stderr) = client.exec_command("racadm serveraction powerup") if "successful" in stdout.readline(): log.info("powerup successful") else: log.error("powerup racadm command failed") return False else: log.error("client was not of type paramiko.SSHClient") return False return True def version(hostname, timeout=20, username=None, password=None): """ Display the version of DRAC CLI Example: .. code-block:: bash salt-run drac.version example.com """ return __version(__connect(hostname, timeout, username, password))