Commit f141af4b authored by Joshua Tauberer's avatar Joshua Tauberer
parent 3d8ea0e6
......@@ -6,6 +6,7 @@ in development
Control panel:
* Status checks would fail to load if openssh-sever was not pre-installed, but openssh-server is not required.
* The local DNS cache is cleared before running the status checks using 'rncd' now rather than restarting 'bind9', which should be faster and wont interrupt other services.
v0.05 (November 18, 2014)
......
......@@ -29,8 +29,17 @@ def run_checks(env, output):
def run_system_checks(env):
env["out"].add_heading("System")
# Check that SSH login with password is disabled.
check_ssh_password(env)
check_software_updates(env)
check_system_aliases(env)
check_free_disk_space(env)
def check_ssh_password(env):
# Check that SSH login with password is disabled. The openssh-server
# package may not be installed so check that before trying to access
# the configuration file.
if not os.path.exists("/etc/ssh/sshd_config"):
return
sshd = open("/etc/ssh/sshd_config").read()
if re.search("\nPasswordAuthentication\s+yes", sshd) \
or not re.search("\nPasswordAuthentication\s+no", sshd):
......@@ -41,6 +50,7 @@ def run_system_checks(env):
else:
env['out'].print_ok("SSH disallows password-based login.")
def check_software_updates(env):
# Check for any software package updates.
pkgs = list_apt_updates(apt_update=False)
if os.path.exists("/var/run/reboot-required"):
......@@ -52,10 +62,12 @@ def run_system_checks(env):
for p in pkgs:
env['out'].print_line("%s (%s)" % (p["package"], p["version"]))
def check_system_aliases(env):
# Check that the administrator alias exists since that's where all
# admin email is automatically directed.
check_alias_exists("administrator@" + env['PRIMARY_HOSTNAME'], env)
def check_free_disk_space(env):
# Check free disk space.
st = os.statvfs(env['STORAGE_ROOT'])
bytes_total = st.f_blocks * st.f_frsize
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment