├── docs
├── FARM Specification.pdf
└── man
│ └── man8
│ └── openSeaChest_LogParser.8
├── example
├── OpenSeaChest_FARM_Log_Pull-Parser.sh
├── OpenSeaChest_LogParser_Readme.txt
└── OpenSeaChest_Logs_Readme.txt
├── .gitmodules
├── .whitesource
├── .gitignore
├── .github
└── workflows
│ ├── c-cpp.yml
│ ├── msbuild.yml
│ └── codeql-analysis.yml
├── SECURITY.md
├── .travis.yml
├── Make
├── VS.2017
│ └── openSeaChest_LogParser
│ │ ├── openSeaChest_LogParser
│ │ ├── openSeaChest_LogParser.vcxproj.filters
│ │ └── openSeaChest_LogParser.sln
│ │ └── openSeaChest_LogParser_FARM
│ │ ├── openSeaChest_LogParser_FARM.vcxproj.filters
│ │ └── openSeaChest_LogParser_FARM.vcxproj
├── VS.2019
│ └── openSeaChest_LogParser
│ │ ├── openSeaChest_LogParser
│ │ ├── openSeaChest_LogParser.vcxproj.filters
│ │ └── openSeaChest_LogParser.sln
│ │ └── openSeaChest_LogParser_FARM
│ │ ├── openSeaChest_LogParser_FARM.vcxproj.filters
│ │ └── openSeaChest_LogParser_FARM.vcxproj
├── VS.2022
│ └── openSeaChest_LogParser
│ │ ├── openSeaChest_LogParser
│ │ └── openSeaChest_LogParser.vcxproj.filters
│ │ └── openSeaChest_LogParser_FARM
│ │ ├── openSeaChest_LogParser_FARM.vcxproj.filters
│ │ └── openSeaChest_LogParser_FARM.vcxproj
└── gcc
│ └── Makefile
├── utils
└── include
│ ├── EULA.h
│ ├── parser_print_util_options.h
│ └── seachest_parser_util_options.h
├── LICENSE.md
└── LICENSE
/docs/FARM Specification.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Seagate/openSeaChest_LogParser/HEAD/docs/FARM Specification.pdf
--------------------------------------------------------------------------------
/example/OpenSeaChest_FARM_Log_Pull-Parser.sh:
--------------------------------------------------------------------------------
1 | #Example for running OpenSeaChest_Logs and OpenSeaChest_LogParser together on one cmd line
2 |
3 | sudo ./openSeaChest_Logs -d /dev/sg? --farm --logMode pipe | ./openSeaChest_LogParser_x86_64 --inputLog fromPipe --logType farmLog --printType json
4 |
5 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "libjson"]
2 | path = libjson
3 | url = ../libjson.git
4 | [submodule "opensea-common"]
5 | path = opensea-common
6 | url = ../opensea-common.git
7 | [submodule "opensea-parser"]
8 | path = opensea-parser
9 | url = ../opensea-parser.git
10 |
11 | [submodule "wingetopt"]
12 | path = wingetopt
13 | url = ../wingetopt.git
14 |
--------------------------------------------------------------------------------
/.whitesource:
--------------------------------------------------------------------------------
1 | {
2 | "scanSettings": {
3 | "configMode": "AUTO",
4 | "configExternalURL": "",
5 | "projectToken": "",
6 | "baseBranches": []
7 | },
8 | "checkRunSettings": {
9 | "vulnerableCheckRunConclusionLevel": "failure",
10 | "displayMode": "diff"
11 | },
12 | "issueSettings": {
13 | "minSeverityLevel": "LOW"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
--------------------------------------------------------------------------------
/.github/workflows/c-cpp.yml:
--------------------------------------------------------------------------------
1 | name: C/C++ CI
2 |
3 | on:
4 | push:
5 | branches: [ develop, master, release/* ]
6 | pull_request:
7 | branches: [ develop ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v2
16 | with:
17 | submodules: recursive
18 |
19 | - name: make
20 | run: |
21 | cd Make/gcc
22 | make farm && make clean_all && make release
23 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # openSeaChest Security Policy
2 |
3 | We take security seriously. If you find any security vulnerabilities in any of the source code, please report it to us as described below.
4 |
5 | ## Reporting Security Issues
6 |
7 | :warning: **Please do not publicly report any security vulnerabilities via GitHub issues.**
8 |
9 | If you have questions or general concerns, please email us at [opensea-build@seagate.com](mailto: opensea-build@seagate.com).
10 |
11 | To report an actual vulnerability, please use the form available at "[Seagate Responsible Vulnerability Disclosure Policy](https://www.seagate.com/legal-privacy/responsible-vulnerability-disclosure-policy/)"
12 |
13 | ### Reporting Format
14 |
15 | To make your reporting meaningful and help us understand the nature and scope of the issue, please include as much information as possible.
16 |
17 | ### Preferred Languages
18 |
19 | We prefer all communications to be in English.
20 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # CI for openseaChest_LogParser through Travis CI
2 | language: cpp
3 |
4 | branches:
5 | only:
6 | - master
7 | - develop
8 |
9 | matrix:
10 | include:
11 | - os: osx
12 | compiler: clang
13 | before_script:
14 | cd Make/gcc
15 | script:
16 | make farm && make clean_all && make release
17 | - os: linux
18 | sudo: false
19 | compiler: clang
20 | dist: xenial
21 | before_script:
22 | cd Make/gcc
23 | script:
24 | make farm && make clean_all && make release
25 | - os: linux
26 | sudo: false
27 | compiler: gcc
28 | dist: xenial
29 | before_script:
30 | cd Make/gcc
31 | script:
32 | make farm && make clean_all && make release
33 | - os: windows
34 | env:
35 | - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
36 | before_script:
37 | cd "Make\VS.2017\openSeaChest_LogParser\openSeaChest_LogParser"
38 | script:
39 | - export PATH=$MSBUILD_PATH:$PATH
40 | - MSBuild.exe //p:Configuration=Static-Release //p:Platform=x64
41 |
42 |
--------------------------------------------------------------------------------
/Make/VS.2017/openSeaChest_LogParser/openSeaChest_LogParser/openSeaChest_LogParser.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Make/VS.2019/openSeaChest_LogParser/openSeaChest_LogParser/openSeaChest_LogParser.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Make/VS.2022/openSeaChest_LogParser/openSeaChest_LogParser/openSeaChest_LogParser.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Make/VS.2017/openSeaChest_LogParser/openSeaChest_LogParser_FARM/openSeaChest_LogParser_FARM.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Make/VS.2019/openSeaChest_LogParser/openSeaChest_LogParser_FARM/openSeaChest_LogParser_FARM.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Make/VS.2022/openSeaChest_LogParser/openSeaChest_LogParser_FARM/openSeaChest_LogParser_FARM.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/.github/workflows/msbuild.yml:
--------------------------------------------------------------------------------
1 | name: MSBuild
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | - develop
8 | - release/*
9 | - feature/*
10 | - hotfix/*
11 | pull_request:
12 | branches:
13 | - develop
14 |
15 | env:
16 | # Path to the solution file relative to the root of the project.
17 | SOLUTION_FILE_PATH: Make/VS.2019/openSeaChest_LogParser/openSeaChest_LogParser
18 |
19 | # Configuration type to build.
20 | # You can convert this to a build matrix if you need coverage of multiple configuration types.
21 | # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
22 | BUILD_CONFIGURATION: Static-Release
23 |
24 | jobs:
25 | build:
26 | runs-on: windows-latest
27 | strategy:
28 | matrix:
29 | platform: [ x64, x86 ]
30 | language: ['cpp']
31 |
32 | steps:
33 | - uses: actions/checkout@v2
34 | with:
35 | submodules: recursive
36 |
37 | - name: Add MSBuild to PATH
38 | uses: microsoft/setup-msbuild@v1
39 |
40 | - name: Restore NuGet packages
41 | working-directory: ${{env.GITHUB_WORKSPACE}}
42 | run: nuget restore ${{env.SOLUTION_FILE_PATH}}
43 |
44 | # Initializes the CodeQL tools for scanning.
45 | - name: Initialize CodeQL
46 | uses: github/codeql-action/init@v2
47 | with:
48 | languages: ${{ matrix.language }}
49 | # If you wish to specify custom queries, you can do so here or in a config file.
50 | # By default, queries listed here will override any specified in a config file.
51 | # Prefix the list here with "+" to use these queries and those in the config file.
52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
53 |
54 | - name: Build
55 | working-directory: ${{env.GITHUB_WORKSPACE}}
56 | # Add additional options to the MSBuild command line here (like platform or verbosity level).
57 | # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
58 | run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /p:Platform=${{matrix.platform}}
59 |
60 | - name: Perform CodeQL Analysis
61 | uses: github/codeql-action/analyze@v2
62 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | name: "CodeQL"
7 |
8 | on:
9 | push:
10 | branches: [develop, master]
11 | pull_request:
12 | # The branches below must be a subset of the branches above
13 | branches: [develop]
14 | schedule:
15 | - cron: '0 12 * * 6'
16 |
17 | jobs:
18 | analyze:
19 | name: Analyze
20 | runs-on: ubuntu-latest
21 |
22 | strategy:
23 | fail-fast: false
24 | matrix:
25 | # Override automatic language detection by changing the below list
26 | # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27 | language: ['cpp']
28 | # Learn more...
29 | # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
30 |
31 | steps:
32 | - name: Checkout repository
33 | uses: actions/checkout@v2
34 | with:
35 | # We must fetch at least the immediate parents so that if this is
36 | # a pull request then we can checkout the head.
37 | fetch-depth: 2
38 | submodules: recursive
39 |
40 | # If this run was triggered by a pull request event, then checkout
41 | # the head of the pull request instead of the merge commit.
42 | - run: git checkout HEAD^2
43 | if: ${{ github.event_name == 'pull_request' }}
44 |
45 | # Initializes the CodeQL tools for scanning.
46 | - name: Initialize CodeQL
47 | uses: github/codeql-action/init@v2
48 | with:
49 | languages: ${{ matrix.language }}
50 | # If you wish to specify custom queries, you can do so here or in a config file.
51 | # By default, queries listed here will override any specified in a config file.
52 | # Prefix the list here with "+" to use these queries and those in the config file.
53 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
54 |
55 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
56 | # If this step fails, then you should remove it and run the build manually (see below)
57 | #- name: Autobuild
58 | # uses: github/codeql-action/autobuild@v2
59 |
60 | # ℹ️ Command-line programs to run using the OS shell.
61 | # 📚 https://git.io/JvXDl
62 |
63 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
64 | # and modify them (or add more) to build your code if your project
65 | # uses a compiled language
66 |
67 | - run: |
68 | cd Make/gcc
69 | make farm && make clean_all && make release
70 |
71 | - name: Perform CodeQL Analysis
72 | uses: github/codeql-action/analyze@v2
73 |
--------------------------------------------------------------------------------
/utils/include/EULA.h:
--------------------------------------------------------------------------------
1 | //
2 | // EULA.h
3 | //
4 | // Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
5 | //
6 | // This software is subject to the terms of the Mozilla Public
7 | // License, v. 2.0. If a copy of the MPL was not distributed with this
8 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 | //
10 | // ******************************************************************************************
11 | // \file EULA.h
12 | // \brief This file defines the a function to print the EULA for the license option in a tool
13 |
14 | #pragma once
15 |
16 | #if defined (__cplusplus)
17 | extern "C"
18 | {
19 | #endif
20 |
21 | #include
22 |
23 | //-----------------------------------------------------------------------------
24 | //
25 | // print_EULA_To_Screen(int showApacheLicense, int showZlibLicense)
26 | //
27 | //! \brief Description: Print the EULA to the screen
28 | //
29 | // Entry:
30 | //! \param showApacheLicense = set to non-zero value to print out the Apache 2.0 license (needed if using mbedtls/encryption - fwdl config file)
31 | //! \param showZlibLicesne = set to non-zero value to print out the ZLib license (needed if using zlib/compression - fwdl config file)
32 | //!
33 | // Exit:
34 | //! \return VOID
35 | //
36 | //-----------------------------------------------------------------------------
37 | void print_EULA_To_Screen(int showApacheLicense, int showZlibLicense);
38 |
39 | //-----------------------------------------------------------------------------
40 | //
41 | // print_Open_Source_Licenses(int showApacheLicense, int showZlibLicense)
42 | //
43 | //! \brief Description: Print the open source licenses to the screen
44 | //
45 | // Entry:
46 | //! \param showApacheLicense = set to non-zero value to print out the Apache 2.0 license (needed if using mbedtls/encryption - fwdl config file)
47 | //! \param showZlibLicesne = set to non-zero value to print out the ZLib license (needed if using zlib/compression - fwdl config file)
48 | //!
49 | // Exit:
50 | //! \return VOID
51 | //
52 | //-----------------------------------------------------------------------------
53 | void print_Open_Source_Licenses(int showApacheLicense, int showZlibLicense);
54 |
55 | //-----------------------------------------------------------------------------
56 | //
57 | // print_GNU_LGPL_License()
58 | //
59 | //! \brief Description: Print the GNU LGPL license to the screen
60 | //
61 | // Entry:
62 | //!
63 | // Exit:
64 | //! \return VOID
65 | //
66 | //-----------------------------------------------------------------------------
67 | void print_GNU_LGPL_License();
68 |
69 | //-----------------------------------------------------------------------------
70 | //
71 | // print_Apache_2_0_License()
72 | //
73 | //! \brief Description: Print the Apache 2.0 license to the screen (for mbedtls)
74 | //
75 | // Entry:
76 | //!
77 | // Exit:
78 | //! \return VOID
79 | //
80 | //-----------------------------------------------------------------------------
81 | void print_Apache_2_0_License();
82 |
83 | //-----------------------------------------------------------------------------
84 | //
85 | // print_Zlib_License()
86 | //
87 | //! \brief Description: Print the ZLib license to the screen
88 | //
89 | // Entry:
90 | //!
91 | // Exit:
92 | //! \return VOID
93 | //
94 | //-----------------------------------------------------------------------------
95 | void print_Zlib_License();
96 |
97 | //-----------------------------------------------------------------------------
98 | //
99 | // print_Win_Getopt_Licenses()
100 | //
101 | //! \brief Description: Print the Win Getopt project license to the screen
102 | //
103 | // Entry:
104 | //!
105 | // Exit:
106 | //! \return VOID
107 | //
108 | //-----------------------------------------------------------------------------
109 | void print_Win_Getopt_Licenses();
110 | //-----------------------------------------------------------------------------
111 | //
112 | // print_LibJson_Licenses()()
113 | //
114 | //! \brief Description: Print the Lib Json project license to the screen
115 | //
116 | // Entry:
117 | //!
118 | // Exit:
119 | //! \return VOID
120 | //
121 | //-----------------------------------------------------------------------------
122 | void print_LibJson_Licenses();
123 | #if defined (__cplusplus)
124 | }
125 | #endif
--------------------------------------------------------------------------------
/example/OpenSeaChest_LogParser_Readme.txt:
--------------------------------------------------------------------------------
1 | 15 4611686018427387903
2 | ./openSeaChest_LogParser_x86_64
3 | -h
4 | ===============================================================================
5 | openSeaChest_LogParser - Seagate drive utilities
6 | Copyright (c) 2018-2020 Seagate Technology LLC and/or its Affiliates
7 | openSeaChest_LogParser Version: 1.3.2-2.0.1 X86_64
8 | Build Date: Jun 16 2022
9 | Today: Thu Jul 7 14:38:58 2022
10 | ===============================================================================
11 | Usage
12 | =====
13 | openSeaChest_LogParser {arguments} {options}
14 |
15 | Examples
16 | ========
17 | openSeaChest_LogParser --inputLog --logType farmLog --printType json --outputLog
18 |
19 | Return Codes
20 | ============
21 | Generic/Common error codes
22 | 0 = No Error Found
23 | 1 = Error in command line options
24 | 2 = Invalid Device Handle or Missing Device Handle
25 | 3 = Operation Failure
26 | 4 = Operation not supported
27 | 5 = Operation Failed and was still in progress
28 | 6 = Operation Aborted
29 | 7 = Operation Failed for Bad Parameter in the log
30 | 8 = Operation had Memory Failures
31 | 9 = Operation Failed for Invaild Lengths in the log
32 | 10 = File Path Not Found
33 | 11 = Cannot Open File
34 | 12 = File Already Exists
35 | 13 = Not Valid for this parser
36 | 20 = Validation Failed
37 | 21 = Error in Header and Footer validation
38 | 22 = Parsing Failure
39 | Anything else = unknown error
40 |
41 | Utility Arguments
42 | =================
43 | --inputLog [log file name]
44 | Use this option to pass a log into the tool for parsing.
45 | Use --inputLog option to pass a farm log buffer into the tool for parsing.
46 |
47 | --logType [choose from list below]
48 | { farmLog, identify, IDDataLog, deviceStatisticsLog, extCompErrorLog
49 | sctTempLog, ncqErrorLog, powerConditionLog, extSelfTestLog
50 | scsiLogPages }
51 |
52 | Use this option to describe the type of log that is being passed in.
53 |
54 | SCSI Log Pages List -
55 | Application Client, Background Scan, Cache Statistics
56 | Background Operation, Environmental Reporting (Coming soon)
57 | Factory Log, Environmental Limits (Coming soon)
58 | Write Log Page, Read Log Page, Verify Log Page
59 | Informational Exceptions, Format Status, DST Log Page
60 | Non-Medium Error, Logical Block Provisioning
61 | Power Conditions, Pending Defects, Protocol Page
62 | Start Stop Cycle Page, Solid State Media (Coming soon)
63 | Supported Log Pages and Subpages, Supported Log Pages
64 | Temperature Log Page, Utilization (Coming soon)
65 |
66 | --showStatusBits
67 | Command Line Option for the FARM Log ONLY
68 | Use this option to set the parser to gather the status bytes for each field.
69 | For each field the Supported byte will show TRUE or FALSE
70 | For each field the Valid byte will show TRUE or FALSE
71 | Device Information will not show status bytes.
72 |
73 | --outputLog [log file name]
74 | To set a name of the output file being generated. This option will overwrite
75 | file if it exists.
76 | If no --outputLog given then data will be printed to the screen.
77 |
78 | --printType [choose from list below]
79 | {json, text, csv, flatcsv, prom}
80 | Use this option to set the output format.
81 |
82 | json - prints the data in a printable json format
83 | text - prints the data in a printable and human readable format
84 | csv - The data flows downwards
85 | flatcsv - The data is set to flow in two rows only
86 | prom - Prints the data in a format readable by Prometheus.
87 |
88 | If no output log is specified (with --outputLog), data is printed
89 | out to standard output and a file is automatically created.
90 | The output file will have the same name as the input file
91 | with the extension ".prom" which can be opened in any text editor.
92 |
93 | If an output log is specified (with --outputLog), data is printed
94 | directly to the specified file.
95 |
96 | [USAGE EXAMPLES]
97 | openSeaChest_LogParser --inputLog .bin --logType farmLog --printType prom
98 | Takes in a FARM log, .bin, prints the data in Prometheus' format
99 | to standard output, and saves the output in the current directory as .prom.
100 |
101 | openSeaChest_LogParser --inputLog .bin --logType farmLog --printType prom --outputLog .prom
102 | Takes in a FARM log, .bin, and saves the output in the current directory
103 | .prom without printing to standard output.
104 |
105 |
106 | Utility Options
107 | ===============
108 | --echoCommandLine
109 | Shows the command line above the banner in the statndard ouput.
110 | Useful when saving output to logs
111 |
112 | -h, --help
113 | Show utility options and example usage (this output you see now)
114 |
115 | --license
116 | Display the Seagate End User License Agreement (EULA).
117 |
118 | -v [0-4], --verbose [0 | 1 | 2 | 3 | 4]
119 | Show verbose information. Verbosity levels are:
120 | 0 - quiet
121 | 1 - default
122 | 2 - command descriptions
123 | 3 - command descriptions and values
124 | Example: -v 3 or --verbose 3
125 |
126 | -V, --version
127 | Show openSeaChest_LogParser version and copyright information & exit
128 |
129 |
130 |
--------------------------------------------------------------------------------
/Make/gcc/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Do NOT modify or remove this copyright and license
3 | #
4 | # Copyright (c) 2014 - 2020 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
5 | #
6 | # This software is subject to the terms of the Mozilla Public
7 | # License, v. 2.0. If a copy of the MPL was not distributed with this
8 | # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 | #
10 | # ******************************************************************************************
11 | #
12 | # Hand Written Makefile (Edit with caution) -Muhammad
13 | #
14 | NAME=openSeaChest_LogParser
15 | #Change the Major version when major interface changes are made.
16 | MAJOR=0
17 | #Change the Minor version when new features are added.
18 | MINOR=2
19 | #Change the patch version when only bug fixes are made.
20 | PATCH=4
21 |
22 |
23 | UTIL_SRC_DIR=../../utils/src
24 | UTIL_DIR=../../src
25 | CXX ?= g++
26 | STRIP ?= strip
27 | TOOL_CHAIN=gcc
28 | LIB_FILE_OUTPUT_DIR=lib
29 | CXXFLAGS = -Wall -Wextra -Werror=old-style-cast -Wshadow -Wmaybe-uninitialized -Wvla -Wfloat-equal \
30 | -Wlogical-op -Wdouble-promotion -Wformat-security -std=c++11
31 | CFLAGS ?= -Wall -Wextra
32 | ARCHIVE ?= ar
33 | ARCH=x86_$(shell getconf LONG_BIT)
34 |
35 | LFLAGS = \
36 | ../../libjson/libjson.a \
37 | ../../opensea-parser/Make/$(TOOL_CHAIN)/$(LIB_FILE_OUTPUT_DIR)/libopensea-parser.a \
38 | ../../opensea-common/Make/$(TOOL_CHAIN)/$(LIB_FILE_OUTPUT_DIR)/libopensea-common.a \
39 |
40 |
41 | INC_DIR= \
42 | -I../../utils/include \
43 | -I../../opensea-common/include \
44 | -I../../opensea-parser/include \
45 | -I../../opensea-parser/include/Seagate\
46 | -I../../libjson
47 |
48 | MACHINE := $(shell uname -m)
49 | ifeq ($(MACHINE), x86_64)
50 |
51 | endif
52 |
53 | OS := $(shell uname)
54 | ifeq ($(OS),Darwin)
55 | # Run MacOS commands
56 | else
57 | LFLAGS += -lrt
58 | endif
59 |
60 | #Add more warnings for the GCC versions that support them
61 | #gcc 5.5 and up : -Wlogical-not-parentheses
62 | # 6.5 and up : -Wnull-dereference -Wduplicated-cond -Wshift-overflow=2
63 | ifeq ($(UNAME),Linux)
64 | GCC_VERSION_STRING = $(shell $(CC) -dumpversion)
65 | GCC_VER = $(subst ., ,$(GCC_VERSION_STRING))
66 | GCC_MAJOR = $(word 1,$(GCC_VER))
67 | GCC_MINOR = $(word 2,$(GCC_VER))
68 | GCC_SUBMINOR = $(word 3,$(GCC_VER))
69 | ifeq ($(GCC_MINOR),)
70 | GCC_MINOR = 0
71 | endif
72 | ifeq ($(GCC_SUBMINOR),)
73 | GCC_SUBMINOR = 0
74 | endif
75 | ifeq ($(shell test $(GCC_MAJOR) -gt 4; echo $$?),0)
76 | ifeq ($(shell test $(GCC_MINOR) -gt 4; echo $$?),0)
77 | CXXFLAGS += -Wlogical-not-parentheses
78 | endif
79 | endif
80 | ifeq ($(shell test $(GCC_MAJOR) -gt 5; echo $$?),0)
81 | ifeq ($(shell test $(GCC_MINOR) -gt 4; echo $$?),0)
82 | CXXFLAGS += -Wnull-dereference -Wduplicated-cond -Wshift-overflow=2
83 | endif
84 | endif
85 | endif
86 |
87 | #Files for the final binary
88 | SOURCES = $(UTIL_DIR)/openSeaChest_LogParser.cpp\
89 | $(UTIL_SRC_DIR)/EULA.cpp\
90 | $(UTIL_SRC_DIR)/parser_print_util_options.cpp\
91 | $(UTIL_SRC_DIR)/seachest_parser_util_options.cpp\
92 |
93 | OUTFILE = openSeaChest_LogParser_$(ARCH)
94 | FARM_OUTFILE = openSeaChest_LogParser_FARM_$(ARCH)
95 | OBJS = $(SOURCES:.cpp=.o)
96 |
97 | #add any defines needed for tool release.
98 | PROJECT_DEFINES = -DSEACHEST\
99 | -DDISABLE_NVME_PASSTHROUGH\
100 | -DINCLUDE_FARM_LOG\
101 | -DINCLUDE_ERROR_LOG\
102 | -DINCLUDE_DEVICE_STATISTICS_LOG\
103 | -DINCLUDE_EXT_COMPREHENSIVE_LOG\
104 | -DINCLUDE_COMMON_EXT_DST_LOG\
105 | -DINCLUDE_POWER_CONDITION_LOG\
106 | -DINCLUDE_IDENTIFY_LOG\
107 | -DINCLUDE_IDENTIFY_DEVICE_DATA_LOG\
108 | -DINCLUDE_SCT_TEMP_LOG\
109 | -DINCLUDE_NCQ_CMD_ERROR_LOG\
110 | -DINCLUDE_SCSI_LOG_PAGES\
111 |
112 | .PHONY: all
113 |
114 | farm: PROJECT_DEFINES += -DBUILD_FARM_ONLY
115 |
116 | debug: CXXFLAGS += -g
117 | debug: CFLAGS += -g
118 | debug: PROJECT_DEFINES += -D_DEBUG
119 | debug: OUTFILE := $(OUTFILE)_dbg
120 | debug: $(OUTFILE)
121 |
122 | release: CXXFLAGS += -O3
123 | release: CFLAGS += -O3
124 | release: $(OUTFILE)
125 |
126 | export CFLAGS
127 | export CXXFLAGS
128 | export PROJECT_DEFINES
129 |
130 | all: clean debug
131 |
132 | seaclibs:
133 | $(MAKE) -C ../../opensea-common/Make/$(TOOL_CHAIN)
134 |
135 | opensea-parser:
136 | $(MAKE) -C ../../opensea-parser/Make/$(TOOL_CHAIN)
137 |
138 | libjson:
139 | $(MAKE) -C ../../libjson/ CXXFLAGS=''
140 |
141 | $(OUTFILE): clean libjson seaclibs opensea-parser $(OBJS) done
142 | $(CXX) $(INC_DIR) $(CXXFLAGS) $(PROJECT_DEFINES) $(OBJS) -o $@ $(LFLAGS)
143 |
144 | %.o: %.cpp
145 | $(CXX) -c $(CXXFLAGS) $(INC_DIR) $(PROJECT_DEFINES) $< -o $@
146 |
147 | static: release
148 | $(CXX) $(INC_DIR) $(PROJECT_DEFINES) $(OBJS) -static -o $(OUTFILE)_static $(LFLAGS)
149 |
150 | strip:
151 | $(STRIP) -s $(OUTFILE) -o $(OUTFILE)__stripped
152 |
153 |
154 | farm: clean release
155 | mv $(OUTFILE) $(FARM_OUTFILE)
156 | clean: banner
157 | rm -f *.o *.a openSeaChest_LogParser*
158 | rm -f $(UTIL_SRC_DIR)/*.o
159 | rm -f $(UTIL_SRC_DIR)/utils/*.o
160 | rm -f $(UTIL_DIR)/*.o
161 | @echo "============================================================"
162 | @echo " CLEANED"
163 | @echo "============================================================"
164 |
165 | clean_all: clean
166 | $(MAKE) -C ../../opensea-common/Make/$(TOOL_CHAIN) clean
167 | $(MAKE) -C ../../opensea-parser/Make/$(TOOL_CHAIN) clean
168 | $(MAKE) -C ../../libjson/ clean CXXFLAGS=''
169 |
170 | banner:
171 | @echo "============================================================"
172 | @echo "openSeaChest_LogParser Makefile version: "$(MAJOR).$(MINOR).$(PATCH) "OS: "$(OS)
173 | @echo "============================================================"
174 |
175 | done:
176 | @echo "============================================================"
177 | @echo "Build of openSeaChest-LogParser has completed "
178 | @echo "============================================================"
179 |
180 |
--------------------------------------------------------------------------------
/utils/include/parser_print_util_options.h:
--------------------------------------------------------------------------------
1 | //
2 | // parser_print_util_options.h
3 | //
4 | // Do NOT modify or remove this copyright and license
5 | //
6 | // Copyright (c) 2015 - 2023 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
7 | //
8 | // This software is subject to the terms of the Mozilla Public
9 | // License, v. 2.0. If a copy of the MPL was not distributed with this
10 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 | //
12 | // ******************************************************************************************
13 |
14 | // \file parser_print_util_options.h
15 | // \brief This file defines the specific funtions and macros for parser Utilities.
16 |
17 | #pragma once
18 |
19 | #include
20 | #include "common_types.h"
21 | #include
22 | #include
23 | #include
24 | #include "libjson.h"
25 | #include "Opensea_Parser_Helper.h"
26 | #include