Hacked By AnonymousFox
�
)�f�� � �� � d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl m Z m
Z
d dlmZ d dl
mZ d dlmZ d dlmZ d d lmZ d d
lmZmZmZ d dlmZ d dlmZmZmZmZ d d
lm Z! d dl"m#Z$ d dl%m&Z&m'Z' d dl(m)Z) d dl*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1 d dl2m3Z3 d dl4m5Z5 d dl6m7Z7m8Z8m9Z9m:Z:m;Z; d dl<m=Z= d dl>m?Z? d dl@mAZAmBZBmCZCmDZDmEZE d dlFmGZG d dl6mHZH d dlImJZJ d dlKmLZL d dlMm#Z# n# eN$ r d� Z#Y nw xY wdZOdZPdZQd ZRd!ZSd"ZTd#ZUd$ZVd%ZW e!� � ZXd&ZYd'geCz d(gz eDz eEz ZZ e1d)d*e[fd+e[fg� � Z\ e1d,d-e]fd.e]fd/e]fd0e]fd1e]fd2e]fg� � Z^ e1d3d4e,e] fd5e,e] fd6e,e] fd7e,e] fd8e^fd9e\fd:e\fd;e,e_ fd<e,e_ fd=e_fd>e,e_ fg� � Z` e1d?d7e]fd5e]fd@e]fd8e^fd9e\fd:e\fg� � Za G dA� dBejb jc jd � � Ze G dC� dDe3� � ZfdE� ZgdS )F� )�absolute_import)�divisionN)�datetime� timedelta)�message_from_string)�Header)�
MIMEMultipart)�MIMEText)�groupby)�cpapi�clproc�clemail)�LIMIT_LVP_ID)�get_user_login_url�get_admin_locale�cpinfo�admins)�get_admin_email)�get_notification)�PrettyTable�ALL)�NameMap)�List�Optional�Tuple�Dict�Iterable�Iterator�
NamedTuple)�LveStatsPlugin)�dateutil)�merge_dicts�deserialize_lve_id�get_hostname�serialize_lve_id�gcd)�
MailHelper��mempages_to_bytes)�get_lve_version�HistoryShowUnion�FIELD_FAULT�
FIELD_AVERAGE�FIELD_LIMIT)�NotificationsHelper)�user_should_be_notified)�map)�reducec � � d S �N� ��resellers ��/builddir/build/BUILDROOT/lve-stats-4.2.8-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/statsnotifier.pyr r 8 s � ��t� �en_USzadmin_notify.txtzadmin_notify.htmlzuser_notify.txtzuser_notify.htmlzreseller_faults_notify.txtzreseller_faults_notify.htmlzreseller_notify.txtzreseller_notify.htmlz"Hosting account resources exceeded�ID�anyF�NotifySettings�NOTIFY_MIN_FAULTS�NOTIFY_INTERVAL�NotifyFaultsOptions�
NOTIFY_CPU� NOTIFY_IO�NOTIFY_IOPS�
NOTIFY_MEMORY� NOTIFY_EP�NOTIFY_NPROC�
AdminSettings�NOTIFY_ADMIN�NOTIFY_CUSTOMERS_ON_FAULTS�NOTIFY_RESELLER_CUSTOMERS�#NOTIFY_RESELLER_ON_CUSTOMERS_FAULTS�NOTIFY_FAULTS_TYPES�NOTIFY_OPTIONS_SELF�NOTIFY_OPTIONS_CUSTOMER�NOTIFY_FROM_EMAIL�REPORT_ADMIN_EMAIL�NOTIFY_SUBJECT�NOTIFY_CHARSET_EMAIL�ResellerSettings�NOTIFY_RESELLER_ON_TOTAL_FAULTSc � � e Zd ZdS )�StatsNotifierTemplateErrorN)�__name__�
__module__�__qualname__r5 r9 r8 rV rV v s � � � � � ��Dr9 rV c �� � e Zd ZdZdZdZdZdZdZd� Z d� Z
dBd
�Zd� Zd� Z
d
� Zd� Zd� Zd� Zd� Zd� Zd� Zed� � � Zed� � � ZdCd�Zed� � � Zd� Zd� Zd� Zd� Zdededeeef fd �Z dCd!e!d"ed#efd$�Z"dCd!e!d"ed#ede#fd%�Z$d&� Z%dCd!e!d"ed#efd'�Z&d(� Z'd)� Z(d*� Z)d+� Z*d,� Z+d-� Z,d.� Z-d/� Z.d0ede/fd1�Z0ed2� � � Z1d3� Z2d4� Z3dDd6�Z4d7� Z5d8� Z6d9� Z7d:� Z8d;� Z9d<� Z:d=� Z;d>� Z<d?� Z=d@� Z>dA� Z?dS )E�
StatsNotifieri�� i z/usr/share/lve/emails/z/etc/cl.emails.d/r zlocale_defines.jsonc � � d | _ d | _ d| _ t j d� � | _ | � � � t � � | _ t � � | _
i | _ t j
� � | _ t � � | _ t# t% j � � � � | _ n/# t$ j t* f$ r t# � � | _ Y nw xY wt- � � | _ d S )N� �
statsnotifier)� server_id� db_engine�lve_version�logging� getLogger�log�_load_plugin_settingsr$ �hostnamer'