HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/sapnw.cpython-36.pyc
3

3��d	�@s&ddlmZmZGdd�dee�ZdS)�)�Plugin�RedHatPluginc@s4eZdZdZdZdZdZdd�Zdd�Zdd	�Z	d
S)
�sapnwz
SAP NetWeaver�sap�/usr/sapcs�|jddd�}|ddkrdSd}d}d}d	}t�}�xL|d
j�D�]:}d|ko\|jd�rD|j�j�}t|�d
krxqD|d}	|d}
|d}|j|	�d|	}|j|�s�qDx�|j	|�D]‰t
�fdd�|	|
|gD��r�d|	}
d|	}�j�}|j||
||	|fd|d�|j||
||
fd|	|
fd�|j||
||
fd|	|
fd�|	j�}d|	||
f}|j|||
f|d�q�WqDWx|D]}	|j
d|	��q�WdS)Nz9/usr/sap/hostctrl/exe/saphostctrl -function ListInstancesZSAPInstances)�suggest_filename�statusrz7env -i %s %s/sappfpar all pf=/usr/sap/%s/SYS/profile/%sz7env -i %s %s/sapcontrol -nr %s -function GetProcessListz7env -i %s %s/sapcontrol -nr %s -function GetVersionInfoz:su - %sadm -c "sapcontrol -nr %s -function GetEnvironment"�outputZDAAzNo instances found����z/usr/sap/%s/SYS/profile/c3s|]}|�kVqdS)N�)�.0�f)�liner�/usr/lib/python3.6/sapnw.py�	<genexpr>3sz/sapnw.collect_list_instances.<locals>.<genexpr>z'LD_LIBRARY_PATH=/usr/sap/%s/SYS/exe/runz"/usr/sap/%s/SYS/exe/uc/linuxx86_64z
%s_parametersz%s_%s_GetProcListz%s_%s_GetVersInfoz%s_%sadm_%s_userenvz/usr/sap/%s/*DVEB*/work/dev_w0)�collect_cmd_output�set�
splitlines�
startswith�strip�split�len�add�path_exists�listdir�all�add_cmd_output�lower�
add_copy_spec)�selfZinst_outZprof_cmdZinst_cmdZvers_cmdZuser_cmdZ
sidsuniqueZ	inst_line�fields�sidZinstZvhost�pathZldenvZptZprofileZlowsidZfnamer)rr�collect_list_instancessX



zsapnw.collect_list_instancescCs |jddd�}|ddkrdS�x�|dj�D]�}d|kr.|j�j�}|ddd�}|d
dd�}|dd�j�}|dkr�|jd
|d||fd�q.|dkr�|ddd�}|jd||f�q.|dkr�|ddd�}|jd|�q.|dkr.|ddd�}|jd||f�q.WdS)Nz9/usr/sap/hostctrl/exe/saphostctrl -function ListDatabasesZSAPDatabases)rrrr	z
Instance name��r
rZdb6zsu - %s -c "db2 get dbm cfg"z%s_%s_db2_inforz/sapdb/%s/data/config/%s.pahZoraz/oracle/%s/*/dbs/init.oraZsybz/sybase/%s/ASE*/%s.cfg���r)r)r)r))rrrr�upperrr!)r"Zdb_outrr#ZdbadmZdbtyper$rrr�collect_list_dbsXs2zsapnw.collect_list_dbscCs6|j�|j�|jd�s$|jd�r2|jddd�dS)Nz)/etc/security/limits.d/99-sap-limits.confZallow_system_changesz
sapconf -nZsapconf_checkmode)r)r&r+rZ
get_optionr)r"rrr�setup�s

zsapnw.setupN)r)r)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofiles�filesr&r+r,rrrrrsE)rN)Zsos.report.pluginsrrrrrrr�<module>	s