Community discussion is present here: http://community.pbspro.org/t/pp-838-support-for-logging-via-syslog-in-pbs/591
...
We should make sure that the user running the tests will have permissions to read syslog file and decompress it. For eg - in test bed machine pbsroot shoud be able to read from syslog file.
...
facility = //PBS_SYSLOG from pbs.conf
serverity = // PBS_SYSLOGSEVR from pbs.conf (by default NONE)
Methods:
def get_log_config_values(syslog=false)
...
1) read from PBS.conf - PBS_SYSLOG & PBS_LOCALLOG.
a) First check Check if the PBS_SYSLOG & PBS_LOCALLOG are set in the pbs.conf file
b) If PBS_SYSLOG is not set, we will locally in code set variable PBS_SYSLOG=0
c) If PBS_LOCALLOG is not set, we will locally in code set variable PBS_LOCALLOG=1
Therefore this will check into the local logs only if values are not set (see line 3 in below table)
2) Logic for whether to read local logs/ syslog we will follow this table -
...
Note: The error thrown will be PtlLogMatchError
Return:
self.file_to_check (/ / file_to_check =1 for syslog, file_to_check=2 for local logs and file_to_check=3 for both)
...
- get type of syslog utility (rsyslog/syslog-ng) running on host and syslog conf file. Currently we are only supporting rsyslog and not syslog-ng
- get PBS_SYSLOGSEVR from pbs.conf. If it is not set throw error PBSConfigError that set PBS_SYSLOGSEVR
- According to utility get list_of_priorites[] (severity + facility) - get_rsyslog_priorites(), def get_syslogng_priorites()
- With the priorities get list_of_syslog_files[] (if there is no list of files returned, throw PTL error) get_rsyslog_files(), get_syslogng_files()
- Get lines from each of the files in list_of_syslog_files[] - def get_syslog_lines()
If no lines are returned throw PTLerror - Combine and Sort lines by datetime
...
return: Sorted + combined_lines (This list of lines will be used by the match_msg() for log_match
def get_rsyslog_priorites(self, severity=None, facility=None)
Summary: Returns the priorities. Since the syslog messages can be stored in multiple files, a list is returned
# If facility and severity mentioned return the file for that combination from rsyslog.conf
Input: severity and facilty values
return list_of_priorities[]
def get_syslogng_priorites(self, severity=None, facility=None)
Summary: Returns the priorities. Since the syslog messages can be stored in multiple files, a list is returned
# If facility and severity mentioned return the file for that combination from rsyslog.conf
Input: severity and facilty values
return list_of_priorities[]
...
Input:
list_of_priorities[]
return list_of_files[]
def get_syslogng_files(self, list_of_priorities[])
Summary: Returns the path of files to be read on basis of the priorities. Since the syslog messages can be stored in multiple files, a list is returned
Input:
list_of_priorities[]
return list_of_files[]
...