ADD zls_check.py

This commit is contained in:
2023-10-25 12:26:46 +02:00
parent 76c2e83117
commit 04ae5bd6e8
4 changed files with 32 additions and 10 deletions
+11 -7
View File
@@ -44,6 +44,9 @@ check_hostname = request("host/get",{"hostname":hostname,"dbname":database}) ##G
system_type = system_info.get_client_info()
if system_type == "Client":
if system_info.get_smb_credential() == False:
request("user/get", {"hostname": hostname, "dbname": database})
print(request("user/get", {"hostname": hostname, "dbname": database}))
user = system_info.get_smb_credential()
### Check User
@@ -79,6 +82,7 @@ else:
print(i[2])
if i != "-":
if not os.path.isdir(f"{i[1]}"):
errorcode = ""
try:
subprocess.run(["net", "use", f"{i[1]}:", f"{i[0]}"], capture_output=True, check=True) ## MOUNT VOLUME
script = fr'''$shell = New-Object -ComObject Shell.Application
@@ -100,10 +104,10 @@ else:
errorcode = f"{time} - Unknow ERROR Code {str(e.stderr)}"
with open("log.txt", "a") as datei:
datei.writelines(f"{errorcode}" + "\n") ## WRITE TO ERRORLOG
# # pushover_send(errorcode, hostname) ## SEND ERROR LOG TO PUSHOVER
#
# while True:
# check_volume_exist()
# time.sleep(60)
with open("log.txt", "a") as datei:
datei.writelines(f"{errorcode}" + "\n") ## WRITE TO ERRORLOG
# # # pushover_send(errorcode, hostname) ## SEND ERROR LOG TO PUSHOVER
# #
# # while True:
# # check_volume_exist()
# # time.sleep(60)