| Server IP : 162.19.112.25 / Your IP : 216.73.216.88 Web Server : LiteSpeed System : Linux qamar.tasjeel.ae 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64 User : archiart ( 1428) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/usr/lib/check_mk_agent/plugins/ |
Upload File : |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
__version__ = "2.3.0p38"
# Lists all domains configured in plesk
#
# <<<plesk_domains>>>
# <domain>
import sys
try:
import MySQLdb # type: ignore[import] # pylint: disable=import-error
except ImportError as e:
sys.stdout.write(
"<<<plesk_domains>>>\n%s. Please install missing module via `pip install mysqlclient`.\n"
% e
)
sys.exit(0)
with open("/etc/psa/.psa.shadow") as pwd_file:
pwd = pwd_file.read().strip()
try:
db = MySQLdb.connect(
host="localhost",
db="psa",
user="admin",
passwd=pwd,
charset="utf8",
)
except MySQLdb.Error as e:
sys.stderr.write("MySQL-Error %d: %s\n" % (e.args[0], e.args[1]))
sys.exit(1)
cursor = db.cursor()
cursor.execute("SELECT name FROM domains")
sys.stdout.write("<<<plesk_domains>>>\n")
sys.stdout.write("%s\n" % "\n".join([d[0] for d in cursor.fetchall()]))
cursor.close()