Server IP : 184.107.3.203 / Your IP : 216.73.216.51 Web Server : Apache System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64 User : adminteladeoro ( 1015) PHP Version : 8.2.28 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
3 ~ �g� � @ sb d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl m Z mZmZ G dd� de e�Z dS ) � N)�HTTPResponse)�Any)�request)�URLError)�Plugin�IndependentPlugin� PluginOptc @ s� e Zd ZdZdZdZedddd�gZdZd Z d Z dZdZd d� Z dd� Zdd� Zed�dd�Zeeed�dd��Zdd� Zeeed�dd��ZdS )�GCPzGoogle Cloud Platform�gcp�virtzkeep-piiFzyStop the plugin from removing PIIs like project name or organization ID from the metadata retrieved from Metadata server.)�defaultZdescz3http://metadata.google.internal/computeMetadata/v1/zBhttp://metadata.google.internal/computeMetadata/v1/?recursive=truez[--REDACTED--]NzDDMI: Google Google Compute Engine/Google Compute Engine, BIOS Googlec C s( | j d�}|d dkrdS | j|d kS )z� Checks if this plugin should be executed at all. In this case, it will check the `dmesg` command output to see if the system is running on a Google Cloud Compute instance. �dmesgZstatusr F�output)Zexec_cmd� GOOGLE_DMI)�selfr � r �/usr/lib/python3.6/gcp.py� check_enabled) s zGCP.check_enabledc C s$ | j ddgd� | jddgd� dS )z� Collect the following info: * Metadata from the Metadata server * `gcloud auth list` output * Any google services output from journal zgcloud auth listr )�tagszgoogle*)Zunitsr N)Zadd_cmd_outputZadd_journal)r r r r �setup4 s z GCP.setupc C s~ | j ddgd��d}y,| j� | _| j� |jtj| jdd�� W n0 tk rn } z|jt|�� W Y d d }~X nX W d Q R X d S )Nz metadata.jsonr )r � )�indent) Zcollection_file�get_metadata�metadata�scrub_metadata�write�json�dumps�RuntimeError�str)r Zmfile�errr r r �collectB s zGCP.collect)�returnc C s"