HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //proc/self/root/usr/libexec/kcare/python/kcarectl/__pycache__/server_info.cpython-312.pyc
�

p��g����ddlZddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddlmZ	d
d	�Zd
d
�Zd�Zd�Zy)�N�)�kcare)�platform_utils)�
http_utils)�utils)�	constants)�authc���t�}t|xstj��|d<||d<tj�|d<tj
�|d<tj�|d<tj�|d<tj�|d<tj�}|d|d	<|d
|d<tj�|d<tjtj �|d
<tj"�|d<tj$�|d<tj&�|d<tj(�|d<t+j,�|d<tj.tj0��}|d|d<|d|d<|d|d<tj2�xsd|d<tj4�|d<tj6�|d<	tj8�|d<t=j>�}|r||d<tj@�}|�||d<|S#t:$rY�CwxYw) N�ts�reason�machine�	processor�release�system�versionr�distror�distro_version�euname�
kcare_version�	last_stop�node�uptime�virt�proxyzlast-update�
ltimestampzpatch-level�patch_levelz
patch-type�
patch_type��kmod�crashreporter_ts�kdump_status�kdump_ts�	server_id�state)!�dict�int�time�platformr
rrrrr�
get_distror�kcare_unamer�strip_version_timestampr�VERSION�
get_last_stop�get_hostname�
get_uptime�get_virtr�
proxy_is_used�parse_patch_description�loaded_patch_description�get_current_kmod_version�$crashreporter_latest_event_timestampr!�kdumps_latest_event_timestamp�	Exceptionr	�get_serverid�	get_state)r�now�datar�descriptionr#r$s       �1/usr/libexec/kcare/python/kcarectl/server_info.py�server_infor>s#���6�D��S�'�D�I�I�K�(�D��J��D��N��&�&�(�D��O� �*�*�,�D����&�&�(�D��O��_�_�&�D��N��&�&�(�D��O�
�
&�
&�
(�F��A�Y�D��N�#�A�Y�D�	���&�&�(�D��N�!�9�9�)�:K�:K�L�D����+�+�-�D���!�.�.�0�D��L�#�.�.�0�D��N�!�*�*�,�D��L��,�,�.�D��M��/�/��0N�0N�0P�Q�K�$�]�3�D���%�m�4�D���$�\�2�D����1�1�3�9�r�D��L�$�I�I�K�D�	�� �-�-�/�D���
� �>�>�@��Z��
�!�!�#�I��%��[���O�O��E�����W�
��K���
��
�s�I�	I�Ic�L�t�}t|xstj��|d<||d<||d<tj�}|d|d<|d|d<tj�|d<tjtj�|d	<tj�|d
<tj�|d<tj�|d<d
}tjj!d�rtjj#d�}||d<|S)Nrrrrrrrr
rrrrgz/var/lib/libcare/stop�stop_ts)r%r&r'rr)r(r
rr+rr,r.r/r0�os�path�exists�getctime)rrr:r;rr@s      r=�server_lib_inforEGs����6�D��S�'�D�I�I�K�(�D��J��D��N�%�D���
�
&�
&�
(�F��A�Y�D��N�#�A�Y�D�	���&�&�(�D��O�!�9�9�)�:K�:K�L�D���!�.�.�0�D��L�#�.�.�0�D��N�!�*�*�,�D��L��G�	�w�w�~�~�-�.��'�'�"�"�#:�;���D��O��K�c��tjtjtjtt
|�����S�N)r�nstr�base64�	b16encode�bstr�strr>)rs r=�based_server_inforN_s/���:�:�f�&�&�u�z�z�#�k�&�6I�2J�'K�L�M�MrFc
���tj|dd��}tjt	j
t
jtj|d����S)NF)�,�:)�ensure_ascii�
separatorszutf-8)	�json�dumpsrrIrJ�urlsafe_b64encode�zlib�compressrL)�infor;s  r=�encode_server_lib_inforZcsB���:�:�d��:�F�D��:�:�f�.�.�t�}�}�U�Z�Z��g�=V�/W�X�Y�YrFrH)rTrJrAr'r(rWrrrrrrr	�typing�Dict�Anyr>rErNrZ�rFr=�<module>r_sE��
�
�	�����������-�`�0N�ZrF