| Server IP : 138.197.176.125 / Your IP : 216.73.217.54 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/python3/dist-packages/landscape/lib/__pycache__/ |
Upload File : |
U
���c� � @ sl d dl mZ d dlZd dlZd dlmZmZ d dlmZ d dlm Z d dl
mZ G dd� de�Z
d d
� ZdS )� )�absolute_importN)� timedelta�datetime)�sysstats)�to_timestamp)�detect_jiffiesc @ s* e Zd ZdZd
dd�Zdd� Zdd � ZdS )�ProcessInformationaI
@param proc_dir: The directory to use for process information.
@param jiffies: The value to use for jiffies per second.
@param boot_time: An alternate value to use for the last boot time. If
None, the system last boot time will be used.
@param uptime: The uptime value to use (for unit tests only).
�/procNc C sH |d krt �� �� }|d k r&t�|�}|| _|| _|p:t� | _|| _ d S )N)
r Z BootTimesZget_last_boot_timer Zutcfromtimestamp�
_boot_time� _proc_dirr �_jiffies_per_sec�_uptime)�selfZproc_dirZjiffiesZ boot_time�uptime� r �7/usr/lib/python3/dist-packages/landscape/lib/process.py�__init__ s
zProcessInformation.__init__c c sP t �| j�D ]>}zt|�}W n tk
r4 Y qY nX | �|�}|r|V qdS )z8Get process information for all processes on the system.N)�os�listdirr �int�
ValueError�get_process_info)r �filename�
process_id�process_infor r r �get_all_process_info s
z'ProcessInformation.get_all_process_infoc C s� d}t j�| jt|��}d|i}�z*tt j�|d�d�}z"|�� }t j�|� d�d �}W 5 |�� X tt j�|d�d�}�z|D ]�}|� dd �}|d d
kr�|�
� p�|d �
� |d<