├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── pull_request_template.md └── workflows │ ├── Semgrep.yml │ ├── codeql.yml │ └── virus-scan.yml ├── .gitignore ├── .vscode └── tasks.json ├── CONTRIBUTING.md ├── ChangeLog.md ├── DCO.md ├── LICENSE ├── README.md ├── SAMPLE └── Veeam Health Check Report_VBR_anon_2024.11.01.101304.html └── vHC ├── HC.sln ├── HC.sln.licenseheader ├── HC_Reporting ├── .editorconfig ├── Common │ ├── CCsvsInMemory.cs │ ├── CGlobals.cs │ ├── CMessages.cs │ ├── CVersionSetter.cs │ ├── Logging │ │ └── CLogger.cs │ └── Scrubber │ │ └── CXmlHandler.cs ├── Functions │ ├── Analysis │ │ └── DataModels │ │ │ ├── BackupServer.cs │ │ │ ├── License.cs │ │ │ ├── Repository.cs │ │ │ └── SOBR.cs │ ├── Collection │ │ ├── CCollections.cs │ │ ├── CImpersonation.cs │ │ ├── DB │ │ │ ├── CDbAccessor.cs │ │ │ ├── CModel.cs │ │ │ ├── CQueries.cs │ │ │ ├── CRegReader.cs │ │ │ └── CSqlExecutor.cs │ │ ├── LogParser │ │ │ ├── CLogOptions.cs │ │ │ ├── CLogParser.cs │ │ │ ├── CRegistryLogInfo.cs │ │ │ ├── CVmcReader.cs │ │ │ └── CWaitingResourceInfo.cs │ │ ├── PSCollections │ │ │ ├── CScripts.cs │ │ │ ├── PSInvoker.cs │ │ │ ├── PsErrorTypes.cs │ │ │ └── Scripts │ │ │ │ └── Collect-VB365Data.ps1 │ │ └── Security │ │ │ ├── CSecurityGlobalValues.cs │ │ │ └── CSecurityInit.cs │ └── Reporting │ │ ├── CsvHandlers │ │ ├── CBjobCsv.cs │ │ ├── CBnRCsvInfo.cs │ │ ├── CCapTierCsv.cs │ │ ├── CCdpProxyCsvInfo.cs │ │ ├── CComplianceCsv.cs │ │ ├── CConfigBackupCsv.cs │ │ ├── CCsvParser.cs │ │ ├── CCsvReader.cs │ │ ├── CEntraObjects.cs │ │ ├── CFileProxyCsvInfo.cs │ │ ├── CHvProxyCsvInfo.cs │ │ ├── CJobCsvInfos.cs │ │ ├── CJobSessionCsvInfos.cs │ │ ├── CMalwareObject.cs │ │ ├── CNetTrafficRulesCsv.cs │ │ ├── CPluginCsvInfo.cs │ │ ├── CProxyCsvInfos.cs │ │ ├── CRegOptionsCsv.cs │ │ ├── CRepoCsvInfos.cs │ │ ├── CServerCsvInfos.cs │ │ ├── CSobrCsvInfo.cs │ │ ├── CSobrExtentCsvInfos.cs │ │ ├── CViProtected.cs │ │ ├── CWaitsCsv.cs │ │ ├── CWanCsvInfos.cs │ │ └── VB365 │ │ │ ├── CGlobalCsv.cs │ │ │ ├── CLocalRepos.cs │ │ │ └── CSecurityCsv.cs │ │ ├── DataTypes │ │ ├── CCdpProxyTypeInfo.cs │ │ ├── CDataTypesParser.cs │ │ ├── CExtentInfo.cs │ │ ├── CFileProxyTypeInfo.cs │ │ ├── CFullReportJson.cs │ │ ├── CHvProxyTypeInfo.cs │ │ ├── CJobSessionInfo.cs │ │ ├── CJobSummaryTypes.cs │ │ ├── CJobTypeInfos.cs │ │ ├── CProtectedWorkloads.cs │ │ ├── CProvisionTypes.cs │ │ ├── CProxyTypeInfos.cs │ │ ├── CRepoTypeInfos.cs │ │ ├── CServerTypeInfos.cs │ │ ├── CSobrTypeInfos.cs │ │ ├── CWanTypeInfo.cs │ │ ├── NAS │ │ │ ├── CNasFileDataVmc.cs │ │ │ ├── CNasVmcInfo.cs │ │ │ └── CObjectShareVmcInfo.cs │ │ ├── ProxyData │ │ │ └── CProxyDataFormer.cs │ │ └── Tape │ │ │ └── CTapeJobInfo.cs │ │ ├── Html │ │ ├── CBackupServerTableHelper.cs │ │ ├── CDataFormer.cs │ │ ├── CHtmlExporter.cs │ │ ├── CReportDataModel.cs │ │ ├── ConcurentTracker.cs │ │ ├── DataFormers │ │ │ ├── CJobTypesParser.cs │ │ │ └── CMultiRoleServer.cs │ │ ├── Exportables │ │ │ ├── CHtmlToDocx.cs │ │ │ └── HtmlToPdfConverter.cs │ │ ├── Shared │ │ │ ├── CHtmlFormatting.cs │ │ │ └── CObjectHelpers.cs │ │ ├── VB365 │ │ │ ├── CM365Summaries.cs │ │ │ ├── CM365Tables.cs │ │ │ └── CVb365HtmlCompiler.cs │ │ ├── VBR │ │ │ ├── CHtmlBodyHelper.cs │ │ │ ├── CHtmlCompiler.cs │ │ │ ├── CVbrSummaries.cs │ │ │ └── VbrTables │ │ │ │ ├── BackupServer │ │ │ │ ├── CConfigBackupTable.cs │ │ │ │ ├── CVbrServerTable.cs │ │ │ │ └── CVbrServerTableHelper.cs │ │ │ │ ├── CHtmlTables.cs │ │ │ │ ├── CHtmlTablesHelper.cs │ │ │ │ ├── CJobSummaryTable.cs │ │ │ │ ├── Concurrency Tables │ │ │ │ └── CConcurrencyHelper.cs │ │ │ │ ├── Job Session Summary │ │ │ │ ├── CJobSessSummary.cs │ │ │ │ ├── CJobSessSummaryHelper.cs │ │ │ │ ├── IndividualJobSessionsHelper.cs │ │ │ │ ├── JobSessionSummaryRow.cs │ │ │ │ └── SessionStats.cs │ │ │ │ ├── JobInfoTable.cs │ │ │ │ ├── Jobs Info │ │ │ │ ├── CEntraJobsTable.cs │ │ │ │ └── CTapeJobInfoTable.cs │ │ │ │ ├── Managed Server Table │ │ │ │ └── CManagedServer.cs │ │ │ │ ├── ProtectedWorkloads │ │ │ │ ├── CEntraTenants.cs │ │ │ │ └── NasSourceInfo.cs │ │ │ │ ├── Registry │ │ │ │ └── CRegistrySkipKeys.cs │ │ │ │ ├── Repositories │ │ │ │ └── CRepository.cs │ │ │ │ └── Security │ │ │ │ ├── CComplianceTable.cs │ │ │ │ ├── CMalwareTable.cs │ │ │ │ ├── CReconChecker.cs │ │ │ │ ├── CSecurityBackupServerTable.cs │ │ │ │ ├── CSecuritySummaryTable.cs │ │ │ │ ├── CVbrSecurityTableHelper.cs │ │ │ │ ├── CVbrSecurityTables.cs │ │ │ │ └── Immutability │ │ │ │ ├── CImmutabilityTable.cs │ │ │ │ └── CImmutableRepos.cs │ │ └── header_creator.ps1 │ │ └── RegSettings │ │ └── CDefaultRegOptions.cs ├── HC_Reporting.licenseheader ├── HC_Reporting.sln ├── Health_Check_Icon.ico ├── Properties │ └── launchSettings.json ├── ReportScript.js ├── Resources │ └── Localization │ │ ├── VB365 │ │ ├── Vb365ResFileBuilder.ps1 │ │ ├── Vb365ResourceHandler.cs │ │ ├── pubstrings.txt │ │ ├── vb365_vhcres.resources │ │ └── vb365_vhcres.txt │ │ ├── VbrLocalizationHelper.cs │ │ ├── VbrResFileBuilder.ps1 │ │ ├── publicStringGenerator.ps1 │ │ ├── pubstrings.txt │ │ ├── vhcres.FR-FR.resources │ │ ├── vhcres.FR-FR.txt │ │ ├── vhcres.ja.resources │ │ ├── vhcres.ja.txt │ │ ├── vhcres.resources │ │ ├── vhcres.txt │ │ ├── vhcres.zh-cn.resources │ │ ├── vhcres.zh-cn.txt │ │ ├── vhcres.zh-tw.resources │ │ └── vhcres.zh-tw.txt ├── Startup │ ├── CAdminCheck.cs │ ├── CArgsParser.cs │ ├── CClientFunctions.cs │ ├── CHotfixDetector.cs │ ├── CReportModeSelector.cs │ ├── CVariables.cs │ └── EntryPoint.cs ├── Tools │ ├── Scripts │ │ ├── HealthCheck │ │ │ ├── VB365 │ │ │ │ └── Collect-VB365Data.ps1 │ │ │ └── VBR │ │ │ │ ├── Get-NasInfo.ps1 │ │ │ │ ├── Get-VBRConfig.ps1 │ │ │ │ └── Get-VeeamSessionReport.ps1 │ │ └── HotfixDetection │ │ │ ├── Collect-VBRLogs.ps1 │ │ │ └── DumpManagedServerToText.ps1 │ ├── Veeam.Hotfix.Detector.zip │ └── build │ │ ├── BuildCopy.sh │ │ ├── BuildVb365Localization.bat │ │ └── BuildVbrLocalization.bat ├── VeeamHealthCheck.csproj ├── VhcGui.xaml ├── VhcGui.xaml.cs ├── banner_string.txt ├── css.css └── increment_version.sh └── VhcXTests ├── CArgsParserTEST.cs ├── Common └── Logging │ └── CLogger_TEST.cs ├── EntryPointTEST.cs ├── Functions └── Reporting │ ├── CsvHandlers │ └── CCsvParser_TEST.cs │ ├── DataTypes │ └── CDataTypesParserTEST.cs │ └── Html │ ├── CHtmlExporterTEST.cs │ ├── Shared │ └── CObjectHelpersTEST.cs │ └── VBR │ └── VbrTables │ └── CJobSessSummaryTEST.cs ├── UnitTest1.cs ├── Usings.cs └── VhcXTests.csproj /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Pull Request Template 2 | 3 | By contributing, you agree that your contributions will be licensed under the projects original open source license. 4 | 5 | ## Description 6 | 7 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 8 | 9 | Fixes # (issue) 10 | 11 | ### Type of change 12 | 13 | * [ ] Bug fix (non-breaking change which fixes an issue) 14 | * [ ] New feature (non-breaking change which adds functionality) 15 | * [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 16 | * [ ] This change requires a documentation update 17 | 18 | ### How Has This Been Tested? 19 | 20 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. 21 | 22 | ### Checklist (check all applicable): 23 | 24 | * [ ] My code follows the style guidelines of this project 25 | * [ ] I have performed a self-review of my own code 26 | * [ ] I have commented my code, particularly in _hard to understand_ areas 27 | * [ ] I have made corresponding changes to the documentation 28 | * [ ] My changes generate no new warnings 29 | * [ ] I have added tests that prove my fix is effective or that my feature works 30 | * [ ] New and existing unit tests pass locally with my changes 31 | -------------------------------------------------------------------------------- /.github/workflows/Semgrep.yml: -------------------------------------------------------------------------------- 1 | name: Semgrep Scan 2 | 3 | on: 4 | push: 5 | branches: [ "master", "dev" ] 6 | pull_request: 7 | branches: 8 | - main 9 | 10 | jobs: 11 | semgrep: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v2 17 | 18 | - name: Set up Python 19 | uses: actions/setup-python@v2 20 | with: 21 | python-version: '3.x' 22 | 23 | - name: Install Semgrep 24 | run: pip install semgrep 25 | 26 | - name: Run Semgrep 27 | run: semgrep --config auto --error 28 | 29 | - name: SemGrep SupplyChain 30 | run: semgrep --config "p/supply-chain" 31 | -------------------------------------------------------------------------------- /.github/workflows/codeql.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 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ "master", "dev" ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ "master", "dev" ] 20 | schedule: 21 | - cron: '45 5 * * 3' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: windows-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'csharp' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Use only 'java' to analyze code written in Java, Kotlin or both 38 | # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both 39 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support 40 | 41 | steps: 42 | - name: Checkout repository 43 | uses: actions/checkout@v3 44 | 45 | # Initializes the CodeQL tools for scanning. 46 | - name: Initialize CodeQL 47 | uses: github/codeql-action/init@v3 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 | 54 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 55 | # queries: security-extended,security-and-quality 56 | 57 | 58 | # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). 59 | # If this step fails, then you should remove it and run the build manually (see below) 60 | - name: Autobuild 61 | uses: github/codeql-action/autobuild@v3 62 | 63 | # ℹ️ Command-line programs to run using the OS shell. 64 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun 65 | 66 | # If the Autobuild fails above, remove it and uncomment the following three lines. 67 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. 68 | 69 | # - run: | 70 | # echo "Run, Build Application using script" 71 | # ./location_of_script_within_repo/buildscript.sh 72 | 73 | 74 | - name: Perform CodeQL Analysis 75 | uses: github/codeql-action/analyze@v3 76 | with: 77 | category: "/language:${{matrix.language}}" 78 | -------------------------------------------------------------------------------- /.github/workflows/virus-scan.yml: -------------------------------------------------------------------------------- 1 | name: Virus Scan 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - dev 8 | pull_request: 9 | branches: 10 | - master 11 | - dev 12 | 13 | jobs: 14 | virus-scan: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v2 20 | 21 | - name: Install ClamAV 22 | run: | 23 | sudo apt-get update 24 | sudo apt-get install -y clamav clamav-daemon 25 | 26 | - name: Disable freshclam logging 27 | run: | 28 | sudo cp /etc/clamav/freshclam.conf /etc/clamav/freshclam.conf.bak 29 | sudo sed -i 's/^UpdateLogFile/#UpdateLogFile/' /etc/clamav/freshclam.conf 30 | # Ensure there is no logging defined 31 | grep -q "^LogFile" /etc/clamav/freshclam.conf || echo "LogFile /dev/null" | sudo tee -a /etc/clamav/freshclam.conf 32 | 33 | - name: Update ClamAV database 34 | run: sudo freshclam 35 | 36 | - name: Restore freshclam logging (if needed) 37 | run: sudo mv /etc/clamav/freshclam.conf.bak /etc/clamav/freshclam.conf 38 | 39 | - name: Scan repository for viruses 40 | run: sudo clamscan -r --bell -i . -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Increment Version", 6 | "type": "shell", 7 | "command": "/Users/adam.congdon/code/veeam-healthcheck/vHC/HC_Reporting/increment_version.sh", 8 | "problemMatcher": [] 9 | }, 10 | { 11 | "label": "Build", 12 | "type": "shell", 13 | "command": "dotnet build /Users/adam.congdon/code/veeam-healthcheck/vHC/HC_Reporting/VeeamHealthCheck.csproj", 14 | "dependsOn": ["Increment Version"], 15 | "group": { 16 | "kind": "build", 17 | "isDefault": true 18 | }, 19 | "problemMatcher": ["$msCompile"] 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: 4 | 5 | * Reporting a bug 6 | * Discussing the current state of the code 7 | * Submitting a fix 8 | * Proposing new features 9 | 10 | All contributions to this repository must be signed as described on our [Developer Certificate of Origin](DCO.md). Your signature certifies that you wrote the contribution or have the right to pass it on as an open source contribution. 11 | 12 | Please note we have a [Code of Conduct](#code-of-conduct). Please follow it in all your interactions with the project. 13 | 14 | ## Report Bugs/Feature Requests using the Github Issue Tracker 15 | 16 | We use GitHub's Issue Tracker to track bugs/feature Requests. Report a bug or feature request by [opening a new issue](https://github.com/VeeamHub/{repo-name}/issues/new/choose). It's that easy! 17 | 18 | ## License 19 | 20 | By contributing, you agree that your contributions will be licensed under the projects original open source license. 21 | 22 | ## Code of Conduct 23 | 24 | ### Our Pledge 25 | 26 | In the interest of fostering an open and welcoming environment, we as 27 | contributors and maintainers pledge to making participation in our project and 28 | our community a harassment-free experience for everyone, regardless of age, body 29 | size, disability, ethnicity, gender identity and expression, level of experience, 30 | nationality, personal appearance, race, religion, or sexual identity and 31 | orientation. 32 | 33 | ### Our Standards 34 | 35 | Examples of behavior that contributes to creating a positive environment 36 | include: 37 | 38 | * Using welcoming and inclusive language 39 | * Being respectful of differing viewpoints and experiences 40 | * Gracefully accepting constructive criticism 41 | * Focusing on what is best for the community 42 | * Showing empathy towards other community members 43 | 44 | Examples of unacceptable behavior by participants include: 45 | 46 | * The use of sexualized language or imagery and unwelcome sexual attention or 47 | advances 48 | * Trolling, insulting/derogatory comments, and personal or political attacks 49 | * Public or private harassment 50 | * Publishing others' private information, such as a physical or electronic 51 | address, without explicit permission 52 | * Other conduct which could reasonably be considered inappropriate in a 53 | professional setting 54 | 55 | ### Our Responsibilities 56 | 57 | Project maintainers are responsible for clarifying the standards of acceptable 58 | behavior and are expected to take appropriate and fair corrective action in 59 | response to any instances of unacceptable behavior. 60 | 61 | Project maintainers have the right and responsibility to remove, edit, or 62 | reject comments, commits, code, wiki edits, issues, and other contributions 63 | that are not aligned to this Code of Conduct, or to ban temporarily or 64 | permanently any contributor for other behaviors that they deem inappropriate, 65 | threatening, offensive, or harmful. 66 | 67 | ### Scope 68 | 69 | This Code of Conduct applies both within project spaces and in public spaces 70 | when an individual is representing the project or its community. Examples of 71 | representing a project or community include using an official project e-mail 72 | address, posting via an official social media account, or acting as an appointed 73 | representative at an online or offline event. Representation of a project may be 74 | further defined and clarified by project maintainers. 75 | 76 | ### Enforcement 77 | 78 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 79 | reported by contacting the project team at . All 80 | complaints will be reviewed and investigated and will result in a response that 81 | is deemed necessary and appropriate to the circumstances. The project team is 82 | obligated to maintain confidentiality with regard to the reporter of an incident. 83 | Further details of specific enforcement policies may be posted separately. 84 | 85 | Project maintainers who do not follow or enforce the Code of Conduct in good 86 | faith may face temporary or permanent repercussions as determined by other 87 | members of the project's leadership. 88 | 89 | ### Attribution 90 | 91 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 92 | available at [http://contributor-covenant.org/version/1/4][version] 93 | 94 | [homepage]: http://contributor-covenant.org 95 | [version]: http://contributor-covenant.org/version/1/4/ 96 | -------------------------------------------------------------------------------- /DCO.md: -------------------------------------------------------------------------------- 1 | # Developer Certificate of Origin 2 | 3 | Developer Certificate of Origin 4 | Version 1.1 5 | 6 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 7 | 1 Letterman Drive 8 | Suite D4700 9 | San Francisco, CA, 94129 10 | 11 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or 18 | 19 | (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or 20 | 21 | (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. 22 | 23 | (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. 24 | 25 | --- 26 | 27 | To acknowledge the Developer Certificate of Origin (DCO), sign your commits by adding `Signed-off-by: John Doe ` to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. If you set your `user.name` and `user.email` git config values, you can sign your commit automatically with `git commit -s`. 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Adam Congdon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Veeam Health Check 2 | 3 | **[Download the latest release on the Releases page](https://github.com/VeeamHub/veeam-healthcheck/releases/) and select the VeeamHealthCheck zip file.** 4 | 5 | This Windows utility is a lightweight executable that will generate an advanced configuration report covering details about the current Veeam Backup & Replication or Veeam Backup for Microsoft 365 installation. Simply download, extract, and execute to generate the report. 6 | 7 | 1. This tool is community supported and not an officially supported Veeam product. 8 | 2. The tool does not automatically phone home, or reach out to any network infrastructure beyond the Veeam Backup and Replication components or the Veeam Backup for 365 components if appropriate. 9 | 10 | **[Sample Report](https://htmlpreview.github.io/?https://github.com/VeeamHub/veeam-healthcheck/blob/master/SAMPLE/Veeam%20Health%20Check%20Report_VBR_anon_2024.11.01.101304.html)** 11 | 12 | ## 📗 Documentation 13 | 14 | **Author:** Adam Congdon (adam.congdon@veeam.com) 15 | 16 | **System Requirements:** 17 | - Must be run as elevated user 18 | - User must have Backup Administrator role in B&R 19 | - Supported Platforms: 20 | - Veeam Backup & Replication: 21 | - v11 22 | - v12 23 | - Veeam Backup for Microsoft 365 24 | - v6 25 | - v7 26 | - v8 27 | - Must be executed on system where Veeam Backup & Replication or Veeam Backup for Microsoft 365 is installed (no remote execution) 28 | - C:\ must have at least 500MB free space: Output is sent to C:\temp\vHC 29 | - Veeam Cloud Service Provider Servers are not supported. 30 | 31 | **Operation:** 32 | 1. [Download the tool.](https://github.com/VeeamHub/veeam-healthcheck/releases/) 33 | 2. Extract the archive on the Backup & Replication Server 34 | 3. Run VeeamHealthCheck.exe from an elevated CMD/PS prompt or right-click 'Run as Administrator' 35 | a. CLI options are available. 36 | 4. Configure desired options on the single-page GUI 37 | 5. Accept Terms 38 | 6. RUN 39 | 7. Review the report 40 | 41 | **Features** 42 | - Single-page report with B&R/VB365 Configuration information 43 | - Custom calculations and tables: 44 | - Highlighting areas of potential improvement 45 | - Job sessions analysis: 46 | - Min/max/average calculations for: job duration, backup & data size, waiting for resources 47 | - success rate & change rate 48 | - Job & Task concurrency heat map 49 | - Curated summary & Notes: 50 | - SA curated description of each table. Including guidance, best practice, and recommendations with relevant documentation links. 51 | 52 | ## ✍ Contributions 53 | 54 | We welcome contributions from the community! We encourage you to create [issues](https://github.com/VeeamHub/veeam-healthcheck/issues/) for Bugs & Feature Requests and submit Pull Requests. For more detailed information, refer to our [Contributing Guide](CONTRIBUTING.md). 55 | 56 | ## 🤝🏾 License 57 | 58 | * [MIT License](LICENSE) 59 | 60 | ## 🤔 Questions 61 | 62 | If you have any questions or something is unclear, please don't hesitate to [create an issue](https://github.com/VeeamHub/veeam-healthcheck/issues/new/choose) and let us know! 63 | -------------------------------------------------------------------------------- /vHC/HC.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32228.430 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VeeamHealthCheck", "HC_Reporting\VeeamHealthCheck.csproj", "{52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vHC", "vHC", "{9C071CDE-DEFE-4EA7-9DD0-E56A46D87547}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|x64 = Debug|x64 14 | Release|Any CPU = Release|Any CPU 15 | Release|x64 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Debug|x64.ActiveCfg = Debug|x64 21 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Debug|x64.Build.0 = Debug|x64 22 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Release|x64.ActiveCfg = Release|Any CPU 25 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E}.Release|x64.Build.0 = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(NestedProjects) = preSolution 31 | {52D9E987-6873-4FAC-ABCB-C9B7AE7B7A2E} = {9C071CDE-DEFE-4EA7-9DD0-E56A46D87547} 32 | EndGlobalSection 33 | GlobalSection(ExtensibilityGlobals) = postSolution 34 | SolutionGuid = {F04F6FBC-5D61-4D15-8F3A-D68B9D0A1E6B} 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /vHC/HC.sln.licenseheader: -------------------------------------------------------------------------------- 1 | extensions: designer.cs generated.cs 2 | extensions: .cs .cpp .h 3 | // Copyright (c) 2021, Adam Congdon 4 | // MIT License 5 | extensions: .aspx .ascx .xaml .xsl 6 | <%-- 7 | Copyright (c) 2021, Adam Congdon 8 | --%> 9 | extensions: .vb 10 | 'Sample license text. 11 | extensions: .xml .config .xsd 12 | 15 | extensions: .txt .ps1 16 | # Copyright (c) 2021, Adam Congdon 17 | # MIT License -------------------------------------------------------------------------------- /vHC/HC_Reporting/Common/CCsvsInMemory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | 6 | namespace VeeamHealthCheck.Shared 7 | { 8 | public static class CCsvsInMemory 9 | { 10 | private static readonly Dictionary>> _csvData 11 | = new Dictionary>>(); 12 | private static readonly object _lock = new object(); 13 | 14 | public static bool LoadCsv(string filePath) 15 | { 16 | lock (_lock) 17 | { 18 | if (_csvData.ContainsKey(filePath)) 19 | { 20 | return true; 21 | } 22 | 23 | try 24 | { 25 | var lines = File.ReadAllLines(filePath); 26 | if (lines.Length == 0) 27 | { 28 | Console.WriteLine($"Warning: CSV file {filePath} is empty."); 29 | return false; 30 | } 31 | 32 | var headers = lines[0].Split(',').Select(h => h.Trim()).ToArray(); 33 | var data = new List>(); 34 | 35 | for (int i = 1; i < lines.Length; i++) 36 | { 37 | var values = lines[i].Split(',').Select(v => v.Trim()).ToArray(); 38 | if (values.Length != headers.Length) 39 | { 40 | Console.WriteLine($"Warning: Row {i + 1} in {filePath} has mismatched columns. Skipping."); 41 | continue; 42 | } 43 | 44 | var row = new Dictionary(); 45 | for (int j = 0; j < headers.Length; j++) 46 | { 47 | row[headers[j]] = values[j]; 48 | } 49 | data.Add(row); 50 | } 51 | 52 | _csvData[filePath] = data; 53 | Console.WriteLine($"Loaded CSV: {filePath} with {data.Count} rows."); 54 | return true; 55 | } 56 | catch (Exception ex) 57 | { 58 | Console.WriteLine($"Error loading CSV {filePath}: {ex.Message}"); 59 | return false; 60 | } 61 | } 62 | } 63 | 64 | public static List> GetCsvData(string filePath) 65 | { 66 | lock (_lock) 67 | { 68 | if (_csvData.TryGetValue(filePath, out var data)) 69 | { 70 | return data; 71 | } 72 | 73 | if (LoadCsv(filePath)) 74 | { 75 | return _csvData[filePath]; 76 | } 77 | 78 | return null; 79 | } 80 | } 81 | 82 | public static void Clear() 83 | { 84 | lock (_lock) 85 | { 86 | _csvData.Clear(); 87 | } 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /vHC/HC_Reporting/Common/CVersionSetter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System.Diagnostics; 4 | 5 | namespace VeeamHealthCheck.Shared 6 | { 7 | class CVersionSetter 8 | { 9 | public CVersionSetter() 10 | { 11 | 12 | } 13 | public static string GetFileVersion() 14 | { 15 | FileVersionInfo fvi = FileVersionInfo.GetVersionInfo("VeeamHealthCheck.exe"); 16 | CGlobals.VHCVERSION = fvi.FileVersion; 17 | return fvi.FileVersion; 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Common/Logging/CLogger.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.IO; 5 | 6 | namespace VeeamHealthCheck.Shared.Logging 7 | { 8 | public class CLogger 9 | { 10 | public readonly string _logFile; 11 | public CLogger(string jobName) 12 | { 13 | _logFile = CreateLogFile(jobName); 14 | } 15 | public string CreateLogFile(string jobName) 16 | { 17 | DateTime dt = DateTime.Now; 18 | //string currentDir = Environment.CurrentDirectory; 19 | 20 | string currentDir = CVariables.unsafeDir; 21 | string logDir = Path.Combine(currentDir + "\\Log"); 22 | if (!Directory.Exists(logDir)) 23 | Directory.CreateDirectory(logDir); 24 | 25 | string logName = String.Format("Job.{1}_{0}_.log", dt.ToString("yyyy.MM.dd_HHmmss"), jobName); 26 | 27 | //File.Create(logName).Close(); 28 | return logDir + "\\" + logName; 29 | } 30 | 31 | public void Info(string message) 32 | { 33 | Info(message, false); 34 | } 35 | public void Info(string message, bool silent) 36 | { 37 | message = FormLogLine(message, "INFO"); 38 | LogLine(message, silent, 3); 39 | } 40 | 41 | private string FormLogLine(string message, string type) 42 | { 43 | DateTime now = DateTime.Now; 44 | message = String.Format("[{0}]\t{2}\t{1}", now.ToString("dd.MM.yyyy HH:mm:ss"), message, type); 45 | return message; 46 | } 47 | 48 | public void Warning(string message) 49 | { 50 | Warning(message, false); 51 | } 52 | public void Warning(string message, bool silent) 53 | { 54 | message = FormLogLine(message, "WARN"); 55 | LogLine(message, silent, 2); 56 | } 57 | public void Debug(string message) 58 | { 59 | Debug(message, false); 60 | } 61 | public void Debug(string message, bool silent) 62 | { 63 | message = FormLogLine(message, "DEBUG"); 64 | if (CGlobals.DEBUG) 65 | { 66 | LogLine(message, silent, 2); 67 | 68 | } 69 | } 70 | public void Error(string message) 71 | { 72 | 73 | Error(message, false); 74 | } 75 | public void Error(string message, bool silent) 76 | { 77 | DateTime now = DateTime.Now; 78 | string logLine = String.Format("[{0}]\tERROR\t{1}", now.ToString("dd.MM.yyyy HH:mm:ss"), message); 79 | LogLine(logLine, silent, 1); 80 | } 81 | private void LogLine(string line, bool silent, int severity) 82 | { 83 | if (!silent) 84 | { 85 | WriteToConsole(severity, line); 86 | } 87 | using (StreamWriter sw = new StreamWriter(_logFile, append: true)) 88 | { 89 | sw.WriteLine(line); 90 | } 91 | } 92 | 93 | private void WriteToConsole(int severity, string message) 94 | { 95 | ConsoleColor defaultColor = Console.ForegroundColor; 96 | switch (severity) 97 | { 98 | case 1: 99 | Console.ForegroundColor = ConsoleColor.Red; 100 | Console.WriteLine(message); 101 | ResetColor(defaultColor); 102 | break; 103 | case 2: 104 | Console.ForegroundColor = ConsoleColor.Yellow; 105 | Console.WriteLine(message); 106 | ResetColor(defaultColor); 107 | break; 108 | case 3: 109 | Console.ForegroundColor = ConsoleColor.White; 110 | Console.WriteLine(message); 111 | ResetColor(defaultColor); 112 | break; 113 | } 114 | } 115 | private void ResetColor(ConsoleColor color) 116 | { 117 | Console.ForegroundColor = color; 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Common/Scrubber/CXmlHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text.Json; 9 | using System.Xml.Linq; 10 | 11 | namespace VeeamHealthCheck.Scrubber 12 | { 13 | public class CScrubHandler 14 | { 15 | private readonly string _matchListPath = CVariables.unsafeDir + @"\vHC_KeyFile.xml"; 16 | private Dictionary _matchDictionary; 17 | private XDocument _doc; 18 | 19 | public CScrubHandler() 20 | { 21 | _matchDictionary = new(); 22 | _doc = new XDocument(new XElement("root")); 23 | } 24 | private void AddItemToList(string type, string original, string obfuscated) 25 | { 26 | 27 | XElement xml = new XElement("fauxname", obfuscated, 28 | new XElement("originalname", original)); 29 | _doc.Root.Add(xml); 30 | _doc.Save(_matchListPath); 31 | 32 | WriteToText(); 33 | } 34 | private void WriteToText() 35 | { 36 | // sort _matchDictionary alphabetically 37 | _matchDictionary = new Dictionary(_matchDictionary); 38 | 39 | var newDict = _matchDictionary.OrderBy(kvp => kvp.Value) 40 | .ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 41 | 42 | 43 | 44 | WriteDictionaryToJsonFile(newDict, CVariables.unsafeDir + @"\vHC_KeyFile.json"); 45 | } 46 | private void WriteDictionaryToJsonFile(Dictionary dictionary, string filePath) 47 | { 48 | try 49 | { 50 | // Serialize the dictionary to a JSON string 51 | string jsonString = JsonSerializer.Serialize(dictionary, new JsonSerializerOptions { WriteIndented = true }); 52 | 53 | // Write the JSON string to a file 54 | File.WriteAllText(filePath, jsonString); 55 | } 56 | catch (Exception ex) 57 | { 58 | Console.WriteLine($"An error occurred while writing to the JSON file: {ex.Message}"); 59 | } 60 | } 61 | 62 | public string ScrubItem(string item, string type, ScrubItemType itemType) 63 | { 64 | if (String.IsNullOrEmpty(item)) 65 | return ""; 66 | if (item.StartsWith(type + "_")) 67 | return item; 68 | //item = RemoveLeadingSlashes(item); 69 | switch (itemType) 70 | { 71 | case ScrubItemType.Item: 72 | break; 73 | // case for all ScrubItemType objects: 74 | case ScrubItemType.Job: 75 | break; 76 | case ScrubItemType.MediaPool: 77 | break; 78 | case ScrubItemType.Repository: 79 | break; 80 | case ScrubItemType.Server: 81 | break; 82 | case ScrubItemType.Path: 83 | break; 84 | case ScrubItemType.VM: 85 | break; 86 | case ScrubItemType.SOBR: 87 | break; 88 | 89 | } 90 | if (!_matchDictionary.ContainsKey(item)) 91 | { 92 | int counter = _matchDictionary.Count; 93 | string newName = type + "_" + counter.ToString(); 94 | _matchDictionary.Add(item, newName); 95 | AddItemToList(type, item, newName); 96 | return newName; 97 | } 98 | else 99 | { 100 | _matchDictionary.TryGetValue(item, out string newName); 101 | return newName; 102 | } 103 | } 104 | public string ScrubItem(string item, ScrubItemType type) 105 | { 106 | return ScrubItem(item, type.ToString(), type); 107 | } 108 | 109 | 110 | } 111 | public enum ScrubItemType 112 | { 113 | Job = 0, 114 | MediaPool = 1, 115 | Repository = 2, 116 | Server = 3, 117 | Path = 4, 118 | VM = 5, 119 | SOBR = 6, 120 | 121 | 122 | Item = 99 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Analysis/DataModels/BackupServer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Analysis.DataModels 5 | { 6 | public class BackupServer 7 | { 8 | public string Name { get; set; } 9 | public string Version { get; set; } 10 | public int Cores { get; set; } 11 | public int RAM { get; set; } 12 | public bool ConfigBackupEnabled { get; set; } 13 | public string ConfigBackupLastResult { get; set; } 14 | public bool ConfigBackupEncryption { get; set; } 15 | public string ConfigBackupTarget { get; set; } 16 | public int ConfigBackupRetentionPoints { get; set; } 17 | public bool HasProxyRole { get; set; } 18 | public bool HasRepoRole { get; set; } 19 | public bool HasWanAccRole { get; set; } 20 | public bool HasFixes { get; set; } 21 | public string FixIds { get; set; } 22 | 23 | 24 | // Config DB Info 25 | public string DbType { get; set; } 26 | public string DbHostName { get; set; } 27 | public string DbVersion { get; set; } 28 | public string Edition { get; set; } 29 | public int DbCores { get; set; } 30 | public int DbRAM { get; set; } 31 | public bool IsLocal { get; set; } 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Analysis/DataModels/License.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Analysis.DataModels 8 | { 9 | internal class License 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Analysis/DataModels/Repository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Analysis.DataModels 8 | { 9 | internal class Repository 10 | { 11 | public Repository() 12 | { 13 | 14 | } 15 | public string Name { get; set; } 16 | public string Sobr { get; set; } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Analysis/DataModels/SOBR.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Analysis.DataModels 8 | { 9 | internal class SOBR 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/CImpersonation.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32.SafeHandles; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using VeeamHealthCheck.Shared; 10 | using VeeamHealthCheck.Shared.Logging; 11 | using VeeamHealthCheck.Startup; 12 | 13 | namespace VeeamHealthCheck.Functions.Collection 14 | { 15 | internal class CImpersonation 16 | { 17 | private CLogger _logger = CGlobals.Logger; 18 | [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 19 | static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword, 20 | int dwLogonType, int dwLogonProvider, out SafeAccessTokenHandle phToken); 21 | 22 | private string VBRSERVER = "localhost"; 23 | public CImpersonation() 24 | { 25 | 26 | } 27 | 28 | public void RunCollection() 29 | { 30 | SafeAccessTokenHandle phToken = SafeAccessTokenHandle(); 31 | WindowsIdentity.RunImpersonated( 32 | phToken, 33 | // User action 34 | () => 35 | { 36 | //CClientFunctions cf = new(); 37 | //cf.GetVbrVersion(); 38 | 39 | CCollections collect = new(); 40 | collect.Run(); 41 | // Check the identity. 42 | // Console.WriteLine("During impersonation: " + WindowsIdentity.GetCurrent().Name); 43 | //IsDomainJoined(); // This may not work.... 44 | } 45 | ); 46 | } 47 | 48 | private SafeAccessTokenHandle SafeAccessTokenHandle() 49 | { 50 | _logger.Info("Logging into: " + CGlobals.REMOTEHOST, false); 51 | string domainName = CGlobals.REMOTEHOST; 52 | 53 | VBRSERVER = domainName; 54 | Console.WriteLine(String.Format("Enter the login of a user on {0} that you wish to impersonate: ", domainName),false); 55 | string userName = Console.ReadLine(); 56 | 57 | Console.WriteLine(String.Format("Enter the password for {0}: ", userName), false); 58 | 59 | const int LOGON32_PROVIDER_DEFAULT = 0; 60 | //This parameter causes LogonUser to create a primary token. 61 | //const int LOGON32_LOGON_INTERACTIVE = 2; 62 | const int LOGON32_LOGON_INTERACTIVE = 9; 63 | 64 | string password = null; 65 | while (true) 66 | { 67 | var key = System.Console.ReadKey(true); 68 | if (key.Key == ConsoleKey.Enter) 69 | break; 70 | password += key.KeyChar; 71 | } 72 | Console.WriteLine("Executing..."); 73 | 74 | // Call LogonUser to obtain a handle to an access token. 75 | SafeAccessTokenHandle safeAccessTokenHandle; 76 | //bool returnValue = LogonUser(userName, domainName, Console.ReadLine(), 77 | // LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, 78 | // out safeAccessTokenHandle); 79 | 80 | bool returnValue = LogonUser(userName, domainName, password, 81 | LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, 82 | out safeAccessTokenHandle); 83 | 84 | if (false == returnValue) 85 | { 86 | int ret = Marshal.GetLastWin32Error(); 87 | Console.WriteLine("LogonUser failed with error code : {0}", ret); 88 | throw new System.ComponentModel.Win32Exception(ret); 89 | } 90 | return safeAccessTokenHandle; 91 | } 92 | 93 | 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/DB/CDbAccessor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Data.SqlClient; 5 | using System.Security.Principal; 6 | using VeeamHealthCheck.Shared; 7 | 8 | namespace VeeamHealthCheck.Functions.Collection.DB 9 | { 10 | class CDbAccessor 11 | { 12 | private string _connectionString; 13 | 14 | public string DbAccessorString() 15 | { 16 | var b = StringBuilder(); 17 | _connectionString = b.ConnectionString; 18 | return b.ConnectionString; 19 | } 20 | private SqlConnectionStringBuilder StringBuilder() 21 | { 22 | SqlConnectionStringBuilder builder = SimpleConnectionBuilder(); 23 | return builder; 24 | } 25 | private SqlConnectionStringBuilder SimpleConnectionBuilder() 26 | { 27 | SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(GetConnectionString()); 28 | builder.Remove("Initial Catalog"); 29 | //builder["Server"] = server; 30 | CRegReader reg = new CRegReader(); 31 | reg.GetDbInfo(); 32 | string host = reg.HostString; 33 | string db = reg.DbString; 34 | if (host == null || db == null) 35 | { 36 | 37 | // why am i asking for interaction? 38 | 39 | //Console.WriteLine("Please enter SQL Host Name & Instance (i.e. vbr-server\\sqlserver2016):"); 40 | //host = Console.ReadLine(); 41 | //Console.WriteLine("Please enter DB name:"); 42 | //db = Console.ReadLine(); 43 | } 44 | builder["Server"] = host; 45 | //CGlobals.DBHOSTNAME = host; 46 | builder["Database"] = db; 47 | 48 | if (TestConnection()) 49 | return builder; 50 | else 51 | { 52 | var cred = WindowsIdentity.GetCurrent(); 53 | builder.UserID = cred.User.ToString(); 54 | builder.Password = cred.Token.ToString(); 55 | return builder; 56 | } 57 | } 58 | 59 | private bool TestConnection() 60 | { 61 | try 62 | { 63 | SqlConnection sqlConnection = new SqlConnection(_connectionString); 64 | using var connection = sqlConnection; 65 | using SqlCommand command = new SqlCommand("select @@version", connection); 66 | connection.Open(); 67 | return true; 68 | } 69 | catch (Exception e) 70 | { 71 | CGlobals.Logger.Warning("Sql Test Connection Failed: " + e.Message); 72 | return false; 73 | } 74 | 75 | } 76 | 77 | 78 | private static string GetConnectionString() 79 | { 80 | return "Server=(local);Integrated Security=SSPI;"; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/DB/CSqlExecutor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Data; 5 | using VeeamHealthCheck.Functions.Analysis.DataModels; 6 | using VeeamHealthCheck.Shared; 7 | using VeeamHealthCheck.Shared.Logging; 8 | 9 | namespace VeeamHealthCheck.Functions.Collection.DB 10 | { 11 | internal class CSqlExecutor 12 | { 13 | private readonly CLogger LOG = CGlobals.Logger; 14 | public CSqlExecutor() 15 | { 16 | 17 | } 18 | public void Run() 19 | { 20 | //CGlobals.BACKUPSERVER = 21 | TrySetSqlInfo(); 22 | } 23 | private void TrySetSqlInfo() 24 | { 25 | BackupServer b = new(); 26 | try 27 | { 28 | LOG.Info("starting sql queries"); 29 | DataTable dbServerInfo = new DataTable(); 30 | CQueries cq = new(); 31 | dbServerInfo = cq.SqlServerInfo; 32 | //b.Edition = cq.SqlEdition; 33 | //b.DbVersion = cq.SqlVerion; 34 | //b = TryParseSqlResources(dbServerInfo, b); 35 | //b.DbType = CGlobals.SqlTypeName; 36 | 37 | CGlobals.DBEdition = cq.SqlEdition; 38 | CGlobals.DBVERSION = cq.SqlVerion; 39 | CGlobals.DBTYPE = CGlobals.SqlTypeName; 40 | TryParseSqlResources(dbServerInfo); 41 | LOG.Info("starting sql queries..done!"); 42 | } 43 | catch (Exception e) 44 | { 45 | LOG.Error(e.Message); 46 | 47 | } 48 | //return b; 49 | } 50 | private static void TryParseSqlResources(DataTable table) 51 | { 52 | foreach (DataRow row in table.Rows) 53 | { 54 | string cpu = row["cpu_count"].ToString(); 55 | string hyperthread = row["hyperthread_ratio"].ToString(); 56 | string memory = row["physical_memory_kb"].ToString(); 57 | int.TryParse(cpu, out int c); 58 | int.TryParse(hyperthread, out int h); 59 | int.TryParse(memory, out int mem); 60 | 61 | //b.DbCores = c;//(c * h).ToString(); 62 | //b.DbRAM = ((mem / 1024 / 1024) + 1); 63 | 64 | CGlobals.DBCORES = c; 65 | CGlobals.DBRAM = mem / 1024 / 1024 + 1; 66 | 67 | } 68 | 69 | //return b; 70 | } 71 | 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/LogParser/CLogOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | namespace VeeamHealthCheck.Functions.Collection.LogParser 4 | { 5 | class CLogOptions 6 | { 7 | public static readonly string VMCLOG = "\\Utils\\VMC.log"; 8 | public static readonly string installIdLine = "InstallationId:"; 9 | 10 | private static string _installId; 11 | 12 | public CLogOptions(string mode) 13 | { 14 | CVmcReader vReader = new(mode); 15 | vReader.PopulateVmc(); 16 | _installId = vReader.INSTALLID; 17 | } 18 | 19 | public static string INSTALLID 20 | { 21 | get 22 | { 23 | if (!string.IsNullOrEmpty(_installId)) 24 | return _installId; 25 | else 26 | return ""; 27 | } 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/LogParser/CRegistryLogInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Collection.LogParser 5 | { 6 | class CRegistryLogInfo 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/LogParser/CVmcReader.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using VeeamHealthCheck.Functions.Collection.DB; 8 | using VeeamHealthCheck.Shared; 9 | 10 | namespace VeeamHealthCheck.Functions.Collection.LogParser 11 | { 12 | class CVmcReader 13 | { 14 | private string LOGLOCATION; 15 | public string INSTALLID; 16 | 17 | private string _mode; 18 | private string _vb365Logs = @"C:\ProgramData\Veeam\Backup365\Logs\"; 19 | 20 | private DateTime _DbLineDate; 21 | 22 | public CVmcReader(string mode) 23 | { 24 | _mode = mode; 25 | } 26 | public void PopulateVmc() 27 | { 28 | GetLogDir(); 29 | try 30 | { 31 | ReadVmc(); 32 | 33 | } 34 | catch (Exception e) 35 | { 36 | CGlobals.Logger.Error(e.Message); 37 | } 38 | } 39 | 40 | private void GetLogDir() 41 | { 42 | if (_mode == "vbr") 43 | { 44 | CRegReader reg = new(); 45 | string regDir = reg.DefaultLogDir(); 46 | LOGLOCATION = Path.Combine(regDir + CLogOptions.VMCLOG); 47 | } 48 | else if (_mode == "vb365") 49 | { 50 | string[] filesList = Directory.GetFiles(_vb365Logs); 51 | List fileInfoList = new(); 52 | foreach (var f in filesList) 53 | { 54 | if (f.Contains("VMC.log")) 55 | { 56 | FileInfo fileInfo = new FileInfo(f); 57 | fileInfoList.Add(fileInfo); 58 | 59 | } 60 | } 61 | fileInfoList.OrderBy(x => x.Name); 62 | string fileName = fileInfoList.FirstOrDefault().Name; 63 | LOGLOCATION = Path.Combine(_vb365Logs + fileName); 64 | } 65 | 66 | } 67 | private void ReadVmc() 68 | { 69 | using (StreamReader sr = new StreamReader(LOGLOCATION)) 70 | { 71 | string line = ""; 72 | while ((line = sr.ReadLine()) != null) 73 | { 74 | if (line.Contains(CLogOptions.installIdLine)) 75 | { 76 | ParseInstallId(line); 77 | } 78 | else if (line.Contains("[SQL Server version]")) 79 | { 80 | ParseConfigDbInfo(line); 81 | } 82 | } 83 | } 84 | } 85 | private void ParseConfigDbInfo(string line) 86 | { 87 | DateTime dbLineDate = ParseLineDate(line); 88 | if ( dbLineDate.Ticks - _DbLineDate.Ticks == 0) 89 | _DbLineDate = ParseLineDate(line); 90 | 91 | } 92 | private DateTime ParseLineDate(string line) 93 | { 94 | string newLine = line.Substring(1, 25); 95 | DateTime.TryParse(newLine, out DateTime dt); 96 | return dt; 97 | 98 | } 99 | private void ParseInstallId(string line) 100 | { 101 | string[] id = line.Substring(40).Split(); 102 | INSTALLID = id[1]; 103 | } 104 | private void TrimLogLine(string line) 105 | { 106 | string newLine = line.Substring(40); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/LogParser/CWaitingResourceInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Collection.LogParser 5 | { 6 | class CWaitingResourceInfo 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/PSCollections/CScripts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Management.Automation; 3 | 4 | namespace VeeamHealthCheck.Functions.Collection.PSCollections 5 | { 6 | internal class CScripts 7 | { 8 | public CScripts() 9 | { 10 | //RunPsScript(GetJobInfo()); 11 | //RunPsScript("Get-VBRJob"); 12 | //RunPsScript(File.ReadAllText(Environment.CurrentDirectory + @"\Tools\Scripts\Get-VBRConfig.ps1")); 13 | } 14 | //script to get vbr-job info 15 | public string GetJobInfo() 16 | { 17 | string script = @" 18 | Connect-VBRServer -Server localhost 19 | $jobs = Get-VBRJob 20 | $piJob = Get-VBRPluginJob 21 | $jobInfo = @() 22 | foreach ($job in $jobs) 23 | { 24 | $jobInfo += $job 25 | } 26 | 27 | $jobInfo 28 | "; 29 | return script; 30 | } 31 | 32 | //script to get job information from Veeam PowerShell 33 | //write a powershell script to save job information in a custom object containing members: jobName, jobType, sourceSizeUsedGB, sourceSizeProvisionedGb, Repository, daysOrPoints, retentionValue, GfsEnabled, GfsWeeklyCount, GfsMonthlyCount, GfsYearlyCount, SyntheticEnabled, ActiveFullEnabled, SyntheticDays, ActiveFullDays, compressionLevel, BlockSize, Encrypted, IndexingEnabled, schedule 34 | 35 | //execute powershell script returned from GetJobInfo() method 36 | 37 | private void RunPsScript(string script) 38 | { 39 | using (PowerShell ps = PowerShell.Create()) 40 | { 41 | ps.AddScript(script); 42 | ps.AddParameter("VBRServer", "localhost");//.AddParameter("localhost"); 43 | ps.AddParameter("VBRVersion", "12");//.AddParameter("12"); 44 | var results = ps.Invoke(); 45 | foreach (var result in results) 46 | { 47 | //do something with the results 48 | Console.WriteLine(result); 49 | } 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/PSCollections/PsErrorTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Collection.PSCollections 8 | { 9 | public class PsErrorTypes 10 | { 11 | public bool Success { get; set; } 12 | public string Message { get; set; } 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Collection/Security/CSecurityGlobalValues.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System.Collections.Generic; 4 | 5 | namespace VeeamHealthCheck.Functions.Collection.Security 6 | { 7 | internal class CSecurityGlobalValues 8 | { 9 | 10 | // backup server values 11 | public static string IsConsoleInstalled = "Undetermined"; 12 | public static string IsRdpEnabled = "Undetermined"; 13 | public static string IsDomainJoined; 14 | 15 | // config backup 16 | public static bool ConfigBackupEnabled; 17 | public static string ConfigBackupSuccess; 18 | public static bool ConfigBackupEncrypted; 19 | 20 | // Server info 21 | public static List OperatingSystemsInUse = new(); 22 | 23 | 24 | //SOBR INFO 25 | public static bool CapacityTierUsed; 26 | public static bool ArchiveTierUsed; 27 | public static bool CapTierImmutable; 28 | public static bool ArchiveTierImmutable; 29 | public static bool AreAllCaptierImmutable; 30 | public static bool AreAllArchiveTierImmutable; 31 | 32 | // extent info 33 | public static bool AreAllExtentsImmutable; 34 | 35 | 36 | 37 | // standardRepoInfo 38 | public static bool AreAllReposImmutable; 39 | 40 | //job info 41 | public static bool AreAllJobsEncrypted; 42 | 43 | //public CSecurityGlobalValues() 44 | //{ 45 | // IsConsoleInstalled = CGlobals.isConsoleLocal; 46 | //} 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CBjobCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CBjobCsv 9 | { 10 | 11 | [Index(0)] 12 | public string JobType { get; set; } 13 | [Index(1)] 14 | public string Name { get; set; } 15 | [Index(2)] 16 | public string RepositoryId { get; set; } 17 | [Index(3)] 18 | public string actualSize { get; set; } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CBnRCsvInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CBnRCsvInfo 9 | { 10 | [Index(0)] 11 | public string Version { get; set; } 12 | [Index(1)] 13 | public string Fixes { get; set; } 14 | [Index(2)] 15 | public string SqlServer { get; set; } 16 | [Index(3)] 17 | public string Instance { get; set; } 18 | [Index(4)] 19 | public string PgHost { get; set; } 20 | [Index(5)] 21 | public string PgDb { get; set; } 22 | [Index(6)] 23 | public string MsHost { get; set; } 24 | [Index(7)] 25 | public string MsDb { get; set; } 26 | [Index(8)] 27 | public string DbType { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CCapTierCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CCapTierCsv 9 | { 10 | //Status Type Immute immutabilityperiod SizeLimitEnabled SizeLimit RepoId 11 | 12 | [Index(0)] 13 | public string Status { get; set; } 14 | [Index(1)] 15 | public string Type { get; set; } 16 | [Index(2)] 17 | public bool Immute { get; set; } 18 | [Index(3)] 19 | public string ImmutePeriod { get; set; } 20 | [Index(4)] 21 | public bool SizeLimitEnabled { get; set; } 22 | [Index(5)] 23 | public string SizeLimit { get; set; } 24 | [Index(6)] 25 | public string RepoId { get; set; } 26 | [Index(7)] 27 | public string ParentId { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CCdpProxyCsvInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CCdpProxyCsvInfo 9 | { 10 | //"ServerId","CacheSize","CachePath","IsEnabled","SourceProxyTrafficPort","TargetProxyTrafficPort","Id","Name", 11 | //"Description" 12 | [Index(0)] 13 | public string ServerId { get; set; } 14 | [Index(1)] 15 | public string CacheSize { get; set; } 16 | [Index(2)] 17 | public string CachePath { get; set; } 18 | [Index(3)] 19 | public string IsEnabled { get; set; } 20 | [Index(4)] 21 | public string SourceProxyTrafficPort { get; set; } 22 | [Index(5)] 23 | public string TargetProxyTrafficPort { get; set; } 24 | [Index(6)] 25 | public string Id { get; set; } 26 | [Index(7)] 27 | public string Name { get; set; } 28 | [Index(8)] 29 | public string description { get; set; } 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CComplianceCsv.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper.Configuration.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 9 | { 10 | public class CComplianceCsv 11 | { 12 | [Index(0)] 13 | public string BestPractice { get; set; } 14 | [Index(1)] 15 | public String Status { get; set; } 16 | 17 | } 18 | 19 | } 20 | public enum ComplianceStatus 21 | { 22 | Passed, 23 | NotImplemented, 24 | UnableToDetect, 25 | Suppressed 26 | } 27 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CConfigBackupCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CConfigBackupCsv 9 | { 10 | [Index(0)] 11 | public string Enabled { get; set; } 12 | [Index(1)] 13 | public string Repository { get; set; } 14 | [Index(2)] 15 | public string ScheduleOptions { get; set; } 16 | [Index(3)] 17 | public string RestorePointsToKeep { get; set; } 18 | [Index(4)] 19 | public string EncryptionOptions { get; set; } 20 | [Index(5)] 21 | public string NotificationOptions { get; set; } 22 | [Index(6)] 23 | public string NextRun { get; set; } 24 | [Index(7)] 25 | public string Target { get; set; } 26 | [Index(8)] 27 | public string Type { get; set; } 28 | [Index(9)] 29 | public string LastResult { get; set; } 30 | [Index(10)] 31 | public string LastState { get; set; } 32 | [Index(11)] 33 | public string Id { get; set; } 34 | [Index(12)] 35 | public string Name { get; set; } 36 | [Index(13)] 37 | public string Description { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CCsvReader.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper; 2 | using CsvHelper.Configuration; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365; 11 | using VeeamHealthCheck.Shared; 12 | using VeeamHealthCheck.Shared.Logging; 13 | 14 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 15 | { 16 | public class CCsvReader 17 | { 18 | private CLogger log = CGlobals.Logger; 19 | private readonly CsvConfiguration _csvConfig; 20 | //private string _outPath;// = CVariables.vbrDir; 21 | 22 | public CCsvReader() 23 | { 24 | _csvConfig = GetCsvConfig(); 25 | //_outPath = vbrOrVboPath; 26 | } 27 | 28 | public CsvReader VbrCsvReader(string file) 29 | { 30 | return FileFinder(file, CVariables.vbrDir); 31 | } 32 | public CsvReader VboCsvReader(string file) 33 | { 34 | return FileFinder(file, CVariables.vb365dir); 35 | } 36 | public CsvReader FileFinder(string file, string outpath) 37 | { 38 | try 39 | { 40 | string[] files = Directory.GetFiles(outpath); 41 | foreach (var f in files) 42 | { 43 | FileInfo fi = new(f); 44 | if (fi.Name.Contains(file)) 45 | { 46 | var cr = CReader(f); 47 | return cr; 48 | } 49 | } 50 | } 51 | catch (Exception e) 52 | { 53 | 54 | string s = string.Format("File or Directory {0} not found!", outpath + "\n" + e.Message); 55 | log.Error(s); 56 | return null; 57 | } 58 | return null; 59 | } 60 | private CsvReader CReader(string csvToRead) 61 | { 62 | TextReader reader = new StreamReader(csvToRead); 63 | var csvReader = new CsvReader(reader, _csvConfig); 64 | return csvReader; 65 | } 66 | private CsvConfiguration GetCsvConfig() 67 | { 68 | var config = new CsvConfiguration(CultureInfo.InvariantCulture) 69 | { 70 | PrepareHeaderForMatch = args => args.Header.ToLower() 71 | .Replace(" ", string.Empty) 72 | .Replace(".", string.Empty) 73 | .Replace("?", string.Empty) 74 | .Replace("-", string.Empty) 75 | .Replace("(", string.Empty) 76 | .Replace(")", string.Empty) 77 | .Replace("/", string.Empty) 78 | .Replace("#", string.Empty), 79 | MissingFieldFound = null, 80 | }; 81 | return config; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CEntraObjects.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper.Configuration.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 9 | { 10 | public class CEntraTenant 11 | { 12 | // tenantName CacheRepoName 13 | [Index(0)] 14 | public string TenantName { get; set; } 15 | [Index(1)] 16 | public string CacheRepoName { get; set; } 17 | 18 | } 19 | public class CEntraLogJobs 20 | { 21 | // Name Tenant shortTermRetType ShortTermRepo ShortTermRepoRetention CopyModeEnabled SecondaryTarget 22 | [Index(0)] 23 | public string Name { get; set; } 24 | [Index(1)] 25 | public string Tenant { get; set; } 26 | [Index(2)] 27 | public string ShortTermRetType { get; set; } 28 | [Index(3)] 29 | public string ShortTermRepo { get; set; } 30 | [Index(4)] 31 | public int ShortTermRepoRetention { get; set; } 32 | [Index(5)] 33 | public bool CopyModeEnabled { get; set; } 34 | [Index(6)] 35 | public string SecondaryTarget { get; set; } 36 | 37 | 38 | } 39 | public class CEntraTenantJobs 40 | { 41 | // create a list of malware objects from this: ObjectId ObjectName DetectedDateTime Severity Types Platform ObjectHostName 42 | 43 | [Index(0)] 44 | public string Name { get; set; } 45 | [Index(1)] 46 | public int RetentionPolicy { get; set; } 47 | 48 | 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CFileProxyCsvInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | 5 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 6 | { 7 | public class CFileProxyCsvInfo 8 | { 9 | //"Id","Description","Server","ConcurrentTaskNumber" 10 | [Index(0)] 11 | public string ConcurrentTaskNumber { get; set; } 12 | 13 | [Index(1)] 14 | public string Host { get; set; } 15 | [Index(2)] 16 | public string HostId { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CHvProxyCsvInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CHvProxyCsvInfo 9 | { 10 | //"Id","Name","Description","HostId","Host","Type","IsDisabled","Options","MaxTasksCount","Info" 11 | [Index(0)] 12 | public string Id { get; set; } 13 | [Index(1)] 14 | public string Name { get; set; } 15 | [Index(2)] 16 | public string Description { get; set; } 17 | [Index(3)] 18 | public string HostId { get; set; } 19 | [Index(4)] 20 | public string Host { get; set; } 21 | [Index(5)] 22 | public string Type { get; set; } 23 | 24 | [Index(6)] 25 | public string IsDisabled { get; set; } 26 | [Index(7)] 27 | public string Options { get; set; } 28 | [Index(8)] 29 | public string MaxTasksCount { get; set; } 30 | [Index(9)] 31 | public string Info { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CJobCsvInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CJobCsvInfos 9 | { 10 | // 11 | 12 | [Index(0)] 13 | public string Name { get; set; } 14 | [Index(1)] 15 | public string JobType { get; set; } 16 | [Index(2)] 17 | public string SheduleEnabledTime { get; set; } 18 | [Index(3)] 19 | public string ScheduleOptions { get; set; } 20 | [Index(4)] 21 | public string RestorePoints { get; set; } 22 | [Index(5)] 23 | public string RepoName { get; set; } 24 | [Index(6)] 25 | public string Algorithm { get; set; } 26 | [Index(7)] 27 | public string FullBackupScheduleKind { get; set; } 28 | [Index(8)] 29 | public string FullBackupDays { get; set; } 30 | [Index(9)] 31 | public bool TransformFullToSyntethic { get; set; } 32 | [Index(10)] 33 | public string TransformIncrementsToSyntethic { get; set; } 34 | [Index(11)] 35 | public string TransformToSyntethicDays { get; set; } 36 | [Index(12)] 37 | public string PwdKeyId { get; set; } 38 | [Index(13)] 39 | public double OriginalSize { get; set; } 40 | // convert each of these to an object with indexing label: RetentionType RetentionCount RetainDaysToKeep DeletedVmRetentionDays DeletedVmRetention CompressionLevel Deduplication BlockSize IntegrityChecks SpecificStorageEncryption StgEncryptionEnabled KeepFirstFullBackup EnableFullBackup BackupIsAttached GfsWeeklyIsEnabled GfsWeeklyCount GfsMonthlyEnabled GfsMonthlyCount GfsYearlyEnabled GfsYearlyCount IndexingType 41 | 42 | [Index(14)] 43 | public string RetentionType { get; set; } 44 | [Index(15)] 45 | public string RetentionCount { get; set; } 46 | [Index(16)] 47 | public string RetainDaysToKeep { get; set; } 48 | [Index(17)] 49 | public string DeletedVmRetentionDays { get; set; } 50 | [Index(18)] 51 | public string DeletedVmRetention { get; set; } 52 | [Index(19)] 53 | public string CompressionLevel { get; set; } 54 | [Index(20)] 55 | public string Deduplication { get; set; } 56 | [Index(21)] 57 | public string BlockSize { get; set; } 58 | [Index(22)] 59 | public string IntegrityChecks { get; set; } 60 | [Index(23)] 61 | public string SpecificStorageEncryption { get; set; } 62 | [Index(24)] 63 | public string StgEncryptionEnabled { get; set; } 64 | [Index(25)] 65 | public string KeepFirstFullBackup { get; set; } 66 | [Index(26)] 67 | public bool EnableFullBackup { get; set; } 68 | [Index(27)] 69 | public string BackupIsAttached { get; set; } 70 | [Index(28)] 71 | public bool GfsWeeklyIsEnabled { get; set; } 72 | [Index(29)] 73 | public string GfsWeeklyCount { get; set; } 74 | [Index(30)] 75 | public bool GfsMonthlyEnabled { get; set; } 76 | [Index(31)] 77 | public string GfsMonthlyCount { get; set; } 78 | [Index(32)] 79 | public bool GfsYearlyEnabled { get; set; } 80 | [Index(33)] 81 | public string GfsYearlyCount { get; set; } 82 | [Index(34)] 83 | public string IndexingType { get; set; } 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CJobSessionCsvInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 8 | { 9 | public class CJobSessionCsvInfos 10 | { 11 | [Index(0)] 12 | public string JobName { get; set; } 13 | [Index(1)] 14 | public string VmName { get; set; } 15 | [Index(2)] 16 | public string Status { get; set; } 17 | [Index(3)] 18 | public string IsRetry { get; set; } 19 | [Index(4)] 20 | public string ProcessingMode { get; set; } 21 | [Index(5)] 22 | public string JobDuration { get; set; } 23 | [Index(6)] 24 | public string TaskDuration { get; set; } 25 | [Index(7)] 26 | public string Alg { get; set; } 27 | [Index(8)] 28 | public string CreationTime { get; set; } 29 | [Index(9)] 30 | public string BackupSize { get; set; } 31 | [Index(10)] 32 | public string DataSize { get; set; } 33 | [Index(11)] 34 | public string DedupRatio { get; set; } 35 | [Index(12)] 36 | public string CompressionRation { get; set; } 37 | [Index(13)] 38 | public string BottleneckDetails { get; set; } 39 | [Index(14)] 40 | public string PrimaryBottleneck { get; set; } 41 | [Index(15)] 42 | public string JobType { get; set; } 43 | } 44 | } -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CMalwareObject.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper.Configuration; 2 | using CsvHelper.Configuration.Attributes; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 10 | { 11 | public class CMalwareObject 12 | { 13 | // Core properties (always present) 14 | public bool InlineMalwareScanEnabled { get; set; } 15 | public string Sensitivity { get; set; } 16 | public bool QuickBackupOnExternalEventEnabled { get; set; } 17 | public bool GuestIndexScanEnabled { get; set; } 18 | public bool UpdateExtensionsListPeriodically { get; set; } 19 | public string SuspiciousExtensions { get; set; } 20 | public string NonSuspiciousExtensions { get; set; } 21 | public string NotificationOptions { get; set; } 22 | 23 | // Optional properties (may not be present in older versions) 24 | public bool? UseIndicatorsOfCompromiseEnabled { get; set; } 25 | public string DetectionEngine { get; set; } 26 | public bool? ScanArchives { get; set; } 27 | } 28 | 29 | public sealed class CMalwareObjectMap : ClassMap 30 | { 31 | public CMalwareObjectMap() 32 | { 33 | // Map core properties that are always present 34 | Map(m => m.InlineMalwareScanEnabled).Name("InlineMalwareScanEnabled"); 35 | Map(m => m.Sensitivity).Name("Sensitivity"); 36 | Map(m => m.QuickBackupOnExternalEventEnabled).Name("QuickBackupOnExternalEventEnabled"); 37 | Map(m => m.GuestIndexScanEnabled).Name("GuestIndexScanEnabled"); 38 | Map(m => m.UpdateExtensionsListPeriodically).Name("UpdateExtensionsListPeriodically"); 39 | Map(m => m.SuspiciousExtensions).Name("SuspiciousExtensions"); 40 | Map(m => m.NonSuspiciousExtensions).Name("NonSuspiciousExtensions"); 41 | Map(m => m.NotificationOptions).Name("NotificationOptions"); 42 | 43 | // Optional properties - these will be ignored if not present in the CSV 44 | Map(m => m.UseIndicatorsOfCompromiseEnabled).Name("UseIndicatorsOfCompromiseEnabled").Optional(); 45 | Map(m => m.DetectionEngine).Name("DetectionEngine").Optional(); 46 | Map(m => m.ScanArchives).Name("ScanArchives").Optional(); 47 | } 48 | } 49 | public class CMalwareExcludedItem 50 | { 51 | [Index(0)] 52 | public string Id { get; set; } 53 | [Index(1)] 54 | public string Name { get; set; } 55 | [Index(2)] 56 | public string Platform { get; set; } 57 | [Index(3)] 58 | public string Note { get; set; } 59 | 60 | } 61 | public class CMalwareInfectedObjects 62 | { 63 | // create a list of malware objects from this: ObjectId ObjectName DetectedDateTime Severity Types Platform ObjectHostName 64 | 65 | [Index(0)] 66 | public string ObjectId { get; set; } 67 | [Index(1)] 68 | public string ObjectName { get; set; } 69 | [Index(2)] 70 | public string DetectedDateTime { get; set; } 71 | [Index(3)] 72 | public string Severity { get; set; } 73 | [Index(4)] 74 | public string Types { get; set; } 75 | [Index(5)] 76 | public string Platform { get; set; } 77 | [Index(6)] 78 | public string ObjectHostName { get; set; } 79 | 80 | 81 | } 82 | public class CMalwareEvents 83 | { 84 | //create a list of malware object from this: Id ObjectName ObjectId DetectionTime Type State CreatedBy Status Message EncryptedDataInfo 85 | 86 | [Index(0)] 87 | public string Id { get; set; } 88 | [Index(1)] 89 | public string ObjectName { get; set; } 90 | [Index(2)] 91 | public string ObjectId { get; set; } 92 | [Index(3)] 93 | public string DetectionTime { get; set; } 94 | [Index(4)] 95 | public string Type { get; set; } 96 | [Index(5)] 97 | public string State { get; set; } 98 | [Index(6)] 99 | public string CreatedBy { get; set; } 100 | [Index(7)] 101 | public string Status { get; set; } 102 | [Index(8)] 103 | public string Message { get; set; } 104 | [Index(9)] 105 | public string EncryptedDataInfo { get; set; } 106 | 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CNetTrafficRulesCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CNetTrafficRulesCsv 9 | { 10 | // TargetIPStart TargetIPEnd EncryptionEnabled ThrottlingEnabled ThrottlingUnit ThrottlingValue ThrottlingWindowEnabled ThrottlingWindowOptions Name Id 11 | 12 | [Index(0)] 13 | public string SourceIpStart { get; set; } 14 | [Index(1)] 15 | public string SourceIPEnd { get; set; } 16 | [Index(2)] 17 | public string TargetIpStart { get; set; } 18 | [Index(3)] 19 | public string TargetIpEnd { get; set; } 20 | [Index(4)] 21 | public string EncryptionEnabled { get; set; } 22 | [Index(5)] 23 | public string ThrottlingEnabled { get; set; } 24 | [Index(6)] 25 | public string ThrottlingUnit { get; set; } 26 | [Index(7)] 27 | public string ThrottlingValue { get; set; } 28 | [Index(8)] 29 | public string ThrottlingWindowEnabled { get; set; } 30 | [Index(9)] 31 | public string ThrottlingWindowOptions { get; set; } 32 | [Index(10)] 33 | public string Name { get; set; } 34 | [Index(11)] 35 | public string Id { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CPluginCsvInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CPluginCsvInfo 9 | { 10 | //"PluginType","Id","Name","Type","LastRun","LastResult","LastState","NextRun","TargetRepositoryId","Description","IsEnabled" 11 | [Index(0)] 12 | public string JobType { get; set; } 13 | [Index(1)] 14 | public string PluginType { get; set; } 15 | [Index(2)] 16 | public string Id { get; set; } 17 | [Index(3)] 18 | public string Name { get; set; } 19 | [Index(4)] 20 | public string Type { get; set; } 21 | [Index(5)] 22 | public string LastRun { get; set; } 23 | [Index(6)] 24 | public string LastResult { get; set; } 25 | [Index(7)] 26 | public string LastState { get; set; } 27 | [Index(8)] 28 | public string NextRun { get; set; } 29 | [Index(9)] 30 | public string TargetRepositoryId { get; set; } 31 | [Index(10)] 32 | public string Description { get; set; } 33 | [Index(11)] 34 | public string IsEnabled { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CProxyCsvInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CProxyCsvInfos 9 | { 10 | [Index(0)] 11 | //[ColumnDetails()] 12 | public string Id { get; set; } 13 | [Index(1)] 14 | public string Name { get; set; } 15 | [Index(2)] 16 | public string Description { get; set; } 17 | [Index(3)] 18 | public string Info { get; set; } 19 | [Index(4)] 20 | public string HostId { get; set; } 21 | [Index(5)] 22 | public string Host { get; set; } 23 | [Index(6)] 24 | public string Type { get; set; } 25 | [Index(7)] 26 | public string IsDisabled { get; set; } 27 | [Index(8)] 28 | public string Options { get; set; } 29 | [Index(9)] 30 | public string MaxTasksCount { get; set; } 31 | [Index(10)] 32 | public string UseSsl { get; set; } 33 | [Index(11)] 34 | public string FailoverToNetwork { get; set; } 35 | [Index(12)] 36 | public string TransportMode { get; set; } 37 | [Index(13)] 38 | public string ChosenVm { get; set; } 39 | [Index(14)] 40 | public string ChassisType { get; set; } 41 | 42 | public string ProxyName() 43 | { 44 | return null; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CRegOptionsCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CRegOptionsCsv 9 | { 10 | [Index(0)] 11 | public string KeyName { get; set; } 12 | [Index(1)] 13 | public string Value { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CRepoCsvInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CRepoCsvInfos 9 | { 10 | [Index(0)] 11 | public string Id { get; set; } 12 | [Index(1)] 13 | public string Name { get; set; } 14 | [Index(2)] 15 | public string HostId { get; set; } 16 | [Index(3)] 17 | //public string MountHostId { get; set; } 18 | public string Description { get; set; } 19 | [Index(4)] 20 | public string CreationTime { get; set; } 21 | [Index(5)] 22 | public string Path { get; set; } 23 | [Index(6)] 24 | public string FullPath { get; set; } 25 | [Index(7)] 26 | public string FriendlyPath { get; set; } 27 | [Index(8)] 28 | public string ShareCredsId { get; set; } 29 | [Index(9)] 30 | public string Type { get; set; } 31 | [Index(10)] 32 | public string Status { get; set; } 33 | [Index(11)] 34 | public bool IsUnavailable { get; set; } 35 | [Index(12)] 36 | public string Group { get; set; } 37 | [Index(13)] 38 | public bool UseNfsOnMountHost { get; set; } 39 | [Index(14)] 40 | public string VersionOfCreation { get; set; } 41 | [Index(15)] 42 | public string Tag { get; set; } 43 | [Index(16)] 44 | public bool IsTemporary { get; set; } 45 | [Index(17)] 46 | public string TypeDisplay { get; set; } 47 | [Index(18)] 48 | public bool IsRotatedDriveRepository { get; set; } 49 | [Index(19)] 50 | public string EndPointCryptoKeyId { get; set; } 51 | [Index(20)] 52 | public string Options { get; set; } 53 | [Index(21)] 54 | public bool HasBackupChainLengthLimitation { get; set; } 55 | [Index(22)] 56 | public bool IsSanSnapshotOnly { get; set; } 57 | [Index(23)] 58 | public bool IsDedupStorage { get; set; } 59 | [Index(24)] 60 | public bool SplitStoragesPerVm { get; set; } 61 | [Index(25)] 62 | public bool IsImmutabilitySupported { get; set; } 63 | [Index(26)] 64 | public string MaxTasks { get; set; } 65 | [Index(27)] 66 | public string UnlimitedTasks { get; set; } 67 | [Index(28)] 68 | public string MaxArchiveTasks { get; set; } 69 | [Index(29)] 70 | public string DataRateLimit { get; set; } 71 | [Index(30)] 72 | public string Uncompress { get; set; } 73 | [Index(31)] 74 | public string AlignBlock { get; set; } 75 | [Index(32)] 76 | public string RemoteAccessLimitation { get; set; } 77 | [Index(33)] 78 | public string EpEncryptionEnabled { get; set; } 79 | [Index(34)] 80 | public string OneBackupFilePerVM { get; set; } 81 | [Index(35)] 82 | public string AutoDetectAffinity { get; set; } 83 | [Index(36)] 84 | public string NfsRepoEncoding { get; set; } 85 | [Index(37)] 86 | public string TotalSpace { get; set; } 87 | [Index(38)] 88 | public string FreeSpace { get; set; } 89 | [Index(39)] 90 | public string GateHosts { get; set; } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CServerCsvInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CServerCsvInfos 9 | { 10 | 11 | 12 | [Index(0)] 13 | public string Info { get; set; } 14 | [Index(1)] 15 | public string ParentId { get; set; } 16 | [Index(2)] 17 | public string Id { get; set; } 18 | [Index(3)] 19 | public string Uid { get; set; } 20 | [Index(4)] 21 | public string Name { get; set; } 22 | [Index(5)] 23 | public string Reference { get; set; } 24 | [Index(6)] 25 | public string Description { get; set; } 26 | [Index(7)] 27 | public string IsUnavailable { get; set; } 28 | [Index(8)] 29 | public string Type { get; set; } 30 | [Index(9)] 31 | public string ApiVersion { get; set; } 32 | [Index(10)] 33 | public string PhysHostId { get; set; } 34 | [Index(11)] 35 | public string ProxyServicesCreds { get; set; } 36 | [Index(12)] 37 | public string Cores { get; set; } 38 | [Index(13)] 39 | public string CPU { get; set; } 40 | [Index(14)] 41 | public string Ram { get; set; } 42 | [Index(15)] 43 | public string OSInfo { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CSobrCsvInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CSobrCsvInfo 9 | { 10 | // 11 | 12 | [Index(0)] 13 | public string PolicyType { get; set; } 14 | [Index(1)] 15 | public string Extents { get; set; } 16 | [Index(2)] 17 | public bool UsePerVMBackupFiles { get; set; } 18 | [Index(3)] 19 | public bool PerformFullWhenExtentOffline { get; set; } 20 | [Index(4)] 21 | public bool EnableCapacityTier { get; set; } 22 | [Index(5)] 23 | public string OperationalRestorePeriod { get; set; } 24 | [Index(6)] 25 | public bool OverridePolicyEnabled { get; set; } 26 | [Index(7)] 27 | public string OverrideSpaceThreshold { get; set; } 28 | [Index(8)] 29 | public string OffloadWindowOptions { get; set; } 30 | [Index(9)] 31 | public string CapacityExtent { get; set; } 32 | [Index(10)] 33 | public bool EncryptionEnabled { get; set; } 34 | [Index(11)] 35 | public string EncryptionKey { get; set; } 36 | [Index(12)] 37 | public bool CapacityTierCopyPolicyEnabled { get; set; } 38 | [Index(13)] 39 | public bool CapacityTierMovePolicyEnabled { get; set; } 40 | [Index(14)] 41 | public bool ArchiveTierEnabled { get; set; } 42 | [Index(15)] 43 | public string ArchiveExtent { get; set; } 44 | [Index(16)] 45 | public string ArchivePeriod { get; set; } 46 | [Index(17)] 47 | public bool CostOptimizedArchiveEnabled { get; set; } 48 | [Index(18)] 49 | public bool ArchiveFullBackupModeEnabled { get; set; } 50 | [Index(19)] 51 | public bool PluginBackupsOffloadEnabled { get; set; } 52 | [Index(20)] 53 | public bool CopyAllPluginBackupsEnabled { get; set; } 54 | [Index(21)] 55 | public bool CopyAllMachineBackupsEnabled { get; set; } 56 | [Index(22)] 57 | public string Id { get; set; } 58 | [Index(23)] 59 | public string Name { get; set; } 60 | [Index(24)] 61 | public string Description { get; set; } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CSobrExtentCsvInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CSobrExtentCsvInfos 9 | { 10 | //"Host","Id","Name","HostId","MountHostId","Description","CreationTime","Path","FullPath","FriendlyPath","ShareCredsId","Type","Status","IsUnavailable","Group","UseNfsOnMountHost","VersionOfCreation","Tag","IsTemporary","TypeDisplay","IsRotatedDriveRepository","EndPointCryptoKeyId","HasBackupChainLengthLimitation","IsSanSnapshotOnly","IsDedupStorage","SplitStoragesPerVm","IsImmutabilitySupported","SOBR_Name","Options(maxtasks)","Options(Unlimited Tasks)","Options(MaxArchiveTaskCount)","Options(CombinedDataRateLimit)","Options(Uncompress)","Options(OptimizeBlockAlign)","Options(RemoteAccessLimitation)","Options(EpEncryptionEnabled)","Options(OneBackupFilePerVm)","Options(IsAutoDetectAffinityProxies)","Options(NfsRepositoryEncoding)" 11 | [Index(0)] 12 | public string HostName { get; set; } 13 | [Index(1)] 14 | public string Id { get; set; } 15 | [Index(2)] 16 | public string Name { get; set; } 17 | [Index(3)] 18 | public string HostId { get; set; } 19 | [Index(4)] 20 | public string MountHostId { get; set; } 21 | [Index(5)] 22 | public string Description { get; set; } 23 | [Index(6)] 24 | public string CreationTime { get; set; } 25 | [Index(7)] 26 | public string Path { get; set; } 27 | [Index(8)] 28 | public string FullPath { get; set; } 29 | [Index(9)] 30 | public string FriendlyPath { get; set; } 31 | [Index(10)] 32 | public string ShareCredsId { get; set; } 33 | [Index(11)] 34 | public string Type { get; set; } 35 | [Index(12)] 36 | public string Status { get; set; } 37 | [Index(13)] 38 | public bool IsUnavailable { get; set; } 39 | [Index(14)] 40 | public string Group { get; set; } 41 | [Index(15)] 42 | public bool UseNfsOnMountHost { get; set; } 43 | [Index(16)] 44 | public string VersionOfCreation { get; set; } 45 | [Index(17)] 46 | public string Tag { get; set; } 47 | [Index(18)] 48 | public string IsTemprorary { get; set; } 49 | [Index(19)] 50 | 51 | public string TypeDisplay { get; set; } 52 | [Index(20)] 53 | public bool IsRotatedDriveRepository { get; set; } 54 | [Index(21)] 55 | public string EndPointCryptoKeyId { get; set; } 56 | [Index(22)] 57 | public bool HasBackupChainLengthLimitation { get; set; } 58 | [Index(23)] 59 | 60 | public bool IsSanSnapshotOnly { get; set; } 61 | [Index(24)] 62 | public bool IsDedupStorage { get; set; } 63 | [Index(25)] 64 | public bool SplitStoragesPerVm { get; set; } 65 | [Index(26)] 66 | public bool IsImmutabilitySupported { get; set; } 67 | [Index(27)] 68 | 69 | public string SOBR_Name { get; set; } 70 | [Index(28)] 71 | 72 | public string MaxTasks { get; set; } 73 | [Index(29)] 74 | 75 | public string UnlimitedTasks { get; set; } 76 | [Index(30)] 77 | public string MaxArchiveTaskCount { get; set; } 78 | [Index(31)] 79 | public string CombinedDataRateLimit { get; set; } 80 | [Index(32)] 81 | public string UnCompress { get; set; } 82 | [Index(33)] 83 | public string OptimizeBlockAlign { get; set; } 84 | [Index(34)] 85 | public string RemoteAccessLimitation { get; set; } 86 | [Index(35)] 87 | public string EpEncryptionEnabled { get; set; } 88 | [Index(36)] 89 | public string OneBackupFilePerVm { get; set; } 90 | [Index(37)] 91 | public string IsAutoDetectAffinityProxies { get; set; } 92 | [Index(38)] 93 | public string NfsRepositoryEncoding { get; set; } 94 | [Index(39)] 95 | public string FreeSpace { get; set; } 96 | [Index(40)] 97 | public string TotalSpace { get; set; } 98 | [Index(41)] 99 | public string GateHosts { get; set; } 100 | [Index(42)] 101 | public string ObjectLockEnabled { get; set; } 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CViProtected.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CViProtected 9 | { 10 | //Name,PowerState,ProvisionedSize,UsedSize,Path,Type 11 | [Index(0)] 12 | public string Name { get; set; } 13 | [Index(1)] 14 | public string PowerState { get; set; } 15 | [Index(2)] 16 | public string ProvisionedSize { get; set; } 17 | [Index(3)] 18 | public string UsedSize { get; set; } 19 | [Index(4)] 20 | public string Path { get; set; } 21 | [Index(5)] 22 | public string Type { get; set; } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CWaitsCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CWaitsCsv 9 | { 10 | //JobName StartTime EndTime Duration 11 | 12 | [Index(0)] 13 | public string JobName { get; set; } 14 | [Index(1)] 15 | public string StartTime { get; set; } 16 | [Index(2)] 17 | public string EndTime { get; set; } 18 | [Index(3)] 19 | public string Duration { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/CWanCsvInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers 7 | { 8 | public class CWanCsvInfos 9 | { 10 | //"Id","Name","Description","HostId","Options" 11 | [Index(0)] 12 | public string Id { get; set; } 13 | [Index(1)] 14 | public string Name { get; set; } 15 | [Index(2)] 16 | public string Description { get; set; } 17 | [Index(3)] 18 | public string HostId { get; set; } 19 | [Index(4)] 20 | public string Options { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/VB365/CGlobalCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365 7 | { 8 | public class CGlobalCsv 9 | { 10 | [Index(0)] 11 | public string LicenseStatus { get; set; } 12 | [Index(1)] 13 | public string LicenseExpiry { get; set; } 14 | [Index(2)] 15 | public string SupportExpiry { get; set; } 16 | [Index(3)] 17 | public string LicenseType { get; set; } 18 | [Index(4)] 19 | public string LicensedTo { get; set; } 20 | [Index(5)] 21 | public string LicenseContact { get; set; } 22 | [Index(6)] 23 | public string LicensedFor { get; set; } 24 | [Index(7)] 25 | public string LicensesUsed { get; set; } 26 | [Index(8)] 27 | public string GlobalFolderExclusions { get; set; } 28 | [Index(9)] 29 | public string GlobalRetExclusions { get; set; } 30 | [Index(10)] 31 | public string LogRetention { get; set; } 32 | [Index(11)] 33 | public string NotificationEnabled { get; set; } 34 | [Index(12)] 35 | public string NotifyOn { get; set; } 36 | [Index(13)] 37 | public string AutomaticUpdates { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/VB365/CLocalRepos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365 7 | { 8 | public class CLocalRepos 9 | { 10 | [Index(0)] 11 | public string BoundProxy { get; set; } 12 | [Index(1)] 13 | public string Name { get; set; } 14 | [Index(2)] 15 | public string Description { get; set; } 16 | [Index(3)] 17 | public string Type { get; set; } 18 | [Index(4)] 19 | public string Path { get; set; } 20 | [Index(5)] 21 | public string ObjectRepo { get; set; } 22 | [Index(6)] 23 | public string Encryption { get; set; } 24 | [Index(7)] 25 | public string State { get; set; } 26 | [Index(8)] 27 | public string Capacity { get; set; } 28 | [Index(9)] 29 | public string Free { get; set; } 30 | [Index(10)] 31 | public string DataStored { get; set; } 32 | 33 | [Index(11)] 34 | public string CacheSpaceUsed { get; set; } 35 | [Index(12)] 36 | public string DailyChangeRate { get; set; } 37 | [Index(13)] 38 | public string Retention { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/CsvHandlers/VB365/CSecurityCsv.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using CsvHelper.Configuration.Attributes; 4 | using System; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365 7 | { 8 | public class CSecurityCsv 9 | { 10 | [Index(0)] 11 | public string WinFirewallEnabled { get; set; } 12 | [Index(1)] 13 | public string Internetproxy { get; set; } 14 | [Index(2)] 15 | public string ServerCert { get; set; } 16 | [Index(3)] 17 | public string ServerCertExpires { get; set; } 18 | [Index(4)] 19 | public string ServerCertSelfSigned { get; set; } 20 | [Index(5)] 21 | public string APIEnabled { get; set; } 22 | [Index(6)] 23 | public string APIPort { get; set; } 24 | [Index(7)] 25 | public string APICert { get; set; } 26 | [Index(8)] 27 | public string APICertExpires { get; set; } 28 | [Index(9)] 29 | public string APICertSelfSigned { get; set; } 30 | [Index(10)] 31 | public string TenantAuthEnabled { get; set; } 32 | [Index(11)] 33 | public string TenantAuthCert { get; set; } 34 | [Index(12)] 35 | public string TenantAuthCertExpires { get; set; } 36 | [Index(13)] 37 | public string TenantAuthCertSelfSigned { get; set; } 38 | [Index(14)] 39 | public string RestorePortalEnabled { get; set; } 40 | [Index(15)] 41 | public string RestorePortalCert { get; set; } 42 | [Index(16)] 43 | public string RestorePortalCertExpires { get; set; } 44 | [Index(17)] 45 | public string RestorePortalCertSelfSigned { get; set; } 46 | [Index(18)] 47 | public string OperatorAuthEnabled { get; set; } 48 | [Index(19)] 49 | public string OperatorAuthCert { get; set; } 50 | [Index(20)] 51 | public string OperatorAuthCertExpires { get; set; } 52 | [Index(21)] 53 | public string OperatorAuthCertSelfSigned { get; set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CCdpProxyTypeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | class CCdpProxyTypeInfo 7 | { 8 | public string ServerId { get; set; } 9 | public string CacheSize { get; set; } 10 | public string CachePath { get; set; } 11 | public string IsEnabled { get; set; } 12 | public string SourceProxyTrafficPort { get; set; } 13 | public string TargetProxyTrafficPort { get; set; } 14 | public string Id { get; set; } 15 | public string Name { get; set; } 16 | public string description { get; set; } 17 | 18 | public CCdpProxyTypeInfo() 19 | { 20 | 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CExtentInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | class CExtentInfo 7 | { 8 | public string sobrName { get; set; } 9 | 10 | public string RepoName { get; set; } 11 | public int maxTasks { get; set; } 12 | public int maxArchiveTasks { get; set; } 13 | public bool isUnlimitedTaks { get; set; } 14 | public int dataRateLimit { get; set; } 15 | public bool unCompress { get; set; } 16 | public bool perVm { get; set; } 17 | public bool autoDetectAffinity { get; set; } 18 | 19 | public string path { get; set; } 20 | public bool isUnavailable { get; set; } 21 | public string HostName { get; set; } 22 | public string type { get; set; } 23 | public bool isRotated { get; set; } 24 | public bool dedupe { get; set; } 25 | public bool immute { get; set; } 26 | public int Ram { get; set; } 27 | public int Cores { get; set; } 28 | public string HostId { get; set; } 29 | public string IsAutoGateway { get; set; } 30 | public string Povisioning { get; set; } 31 | 32 | public int FreeSPace { get; set; } 33 | public int TotalSpace { get; set; } 34 | public CExtentInfo() 35 | { 36 | 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CFileProxyTypeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | class CFileProxyTypeInfo 7 | { 8 | public string Id { get; set; } 9 | public string Description { get; set; } 10 | public string Server { get; set; } 11 | public string ConcurrentTaskNumber { get; set; } 12 | 13 | public CFileProxyTypeInfo() 14 | { 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CFullReportJson.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 8 | { 9 | internal class CFullReportJson 10 | { 11 | 12 | public CProtectedWorkloads cProtectedWorkloads { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CHvProxyTypeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | class CHvProxyTypeInfo 7 | { 8 | public string Id { get; set; } 9 | public string Name { get; set; } 10 | public string Description { get; set; } 11 | public string HostId { get; set; } 12 | public string Host { get; set; } 13 | public string Type { get; set; } 14 | public string IsDisabled { get; set; } 15 | public string Options { get; set; } 16 | public string MaxTasksCount { get; set; } 17 | public string Info { get; set; } 18 | 19 | public CHvProxyTypeInfo() 20 | { 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CJobSessionInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | 5 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 6 | { 7 | public class CJobSessionInfo 8 | { 9 | public string Name { get; set; } 10 | public int minTime { get; set; } 11 | public int maxTime { get; set; } 12 | public int avgTime { get; set; } 13 | public double minTimeHr { get; set; } 14 | public double maxTimeHr { get; set; } 15 | public double avgTimeHr { get; set; } 16 | public string JobName { get; set; } 17 | public string VmName { get; set; } 18 | public string Status { get; set; } 19 | public string IsRetry { get; set; } 20 | public string ProcessingMode { get; set; } 21 | public string JobDuration { get; set; } 22 | public string TaskDuration { get; set; } 23 | public string Alg { get; set; } 24 | public DateTime CreationTime { get; set; } 25 | public double BackupSize { get; set; } 26 | public double DataSize { get; set; } 27 | public double UsedVmSize { get; set; } 28 | public string DedupRatio { get; set; } 29 | public string CompressionRatio { get; set; } 30 | public string Bottleneck { get; set; } 31 | public string PrimaryBottleneck { get; set; } 32 | public string JobType { get; set; } 33 | public CJobSessionInfo(string name, int min, int max, int avg) 34 | { 35 | //Name = name; 36 | //minTime = min; 37 | //maxTime = max; 38 | //avgTime = avg; 39 | } 40 | public CJobSessionInfo() 41 | { 42 | 43 | } 44 | public void Dispose() { } 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CJobSummaryTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | public class CJobSummaryTypes 7 | { 8 | public int sessionCount { get; set; } 9 | public int Fails { get; set; } 10 | public int Retries { get; set; } 11 | public double SuccessRate { get; set; } 12 | public string MinJobTime { get; set; } 13 | public string MaxJobTime { get; set; } 14 | public string AvgJobTime { get; set; } 15 | public string JobName { get; set; } 16 | public int ItemCount { get; set; } 17 | public double MinBackupSize { get; set; } 18 | public double MaxBackupSize { get; set; } 19 | public double AvgBackupSize { get; set; } 20 | public double MinDataSize { get; set; } 21 | public double MaxDataSize { get; set; } 22 | public double UsedVmSizeTB { get; set; } 23 | public double AvgDataSize { get; set; } 24 | public double AvgChangeRate { get; set; } 25 | public string JobType { get; set; } 26 | public int waitCount { get; set; } 27 | public string maxWait { get; set; } 28 | public string avgwait { get; set; } 29 | 30 | public CJobSummaryTypes() 31 | { 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CJobTypeInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | public class CJobTypeInfos 7 | { 8 | public string Name { get; set; } 9 | public string JobType { get; set; } 10 | public string JobId { get; set; } 11 | public string SheduleEnabledTime { get; set; } 12 | public string ScheduleOptions { get; set; } 13 | public int RestorePoints { get; set; } 14 | public string RepoName { get; set; } 15 | public string Algorithm { get; set; } 16 | public string FullBackupScheduleKind { get; set; } 17 | public string FullBackupDays { get; set; } 18 | public string TransformFullToSyntethic { get; set; } 19 | public string TransformIncrementsToSyntethic { get; set; } 20 | public string TransformToSyntethicDays { get; set; } 21 | public string ActualSize { get; set; } 22 | public string EncryptionEnabled { get; set; } 23 | public CJobTypeInfos() 24 | { 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CProtectedWorkloads.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 4 | { 5 | public class CProtectedWorkloads 6 | { 7 | public VirtualWorkloads vmWareWorkloads { get; set; } 8 | public VirtualWorkloads hyperVWorkloads { get; set; } 9 | public List nasWorkloads { get; set; } 10 | public PhysicalWorkloads physicalWorkloads { get; set; } 11 | public List entraWorkloads { get; set; } 12 | 13 | public CProtectedWorkloads() 14 | { 15 | vmWareWorkloads = new VirtualWorkloads(); 16 | hyperVWorkloads = new VirtualWorkloads(); 17 | nasWorkloads = new List(); 18 | physicalWorkloads = new PhysicalWorkloads(); 19 | entraWorkloads = new List(); 20 | } 21 | 22 | } 23 | 24 | public class VirtualWorkloads 25 | { 26 | public int TotalVMs { get; set; } 27 | public int TotalProtectedVMs { get; set; } 28 | public int TotalNotProtectedVMs { get; set; } 29 | public int Dupes { get; set; } 30 | } 31 | public class NasWorkloads 32 | { 33 | public string FileShareType { get; set; } 34 | public string TotalShareSize { get; set; } 35 | public double TotalFilesCount { get; set; } 36 | public double TotalFoldersCount { get; set; } 37 | 38 | } 39 | public class PhysicalWorkloads 40 | { 41 | public int ProtectedAsPhysical { get; set; } 42 | public int Total { get; set; } 43 | public int NotProtected { get; set; } 44 | public int Protected { get; set; } 45 | } 46 | public class EntraWorkloads 47 | { 48 | public string TenantName { get; set; } 49 | public string CacheRepoName { get; set; } 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CProvisionTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | class CProvisionTypes 7 | { 8 | public string UnderProvisioned { get { return "under"; } } 9 | public string OverProvisioned { get { return "over"; } } 10 | public string WellProvisioned { get { return " "; } } 11 | public CProvisionTypes() 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CProxyTypeInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | public class CProxyTypeInfos 7 | { 8 | public string Id { get; set; } 9 | public string Name { get; set; } 10 | public string Description { get; set; } 11 | public string Info { get; set; } 12 | public string HostId { get; set; } 13 | public string Host { get; set; } 14 | public string Type { get; set; } 15 | public string IsDisabled { get; set; } 16 | public string Options { get; set; } 17 | public int MaxTasksCount { get; set; } 18 | public string UseSsl { get; set; } 19 | public string FailoverToNetwork { get; set; } 20 | public string TransportMode { get; set; } 21 | public string ChosenVm { get; set; } 22 | public string ChassisType { get; set; } 23 | public int Cores { get; set; } 24 | public int Ram { get; set; } 25 | public string CacheSize { get; set; } 26 | public string CachePath { get; set; } 27 | public string Provisioning { get; set; } 28 | 29 | 30 | public CProxyTypeInfos() 31 | { 32 | 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CRepoTypeInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | public class CRepoTypeInfos 7 | { 8 | public string RepoName { get; set; } 9 | public int maxArchiveTasks { get; set; } 10 | public string isUnlimitedTaks { get; set; } 11 | public int dataRateLimit { get; set; } 12 | public bool autoDetectAffinity { get; set; } 13 | public string Info { get; set; } 14 | public string Host { get; set; } 15 | public string Id { get; set; } 16 | public string Name { get; set; } 17 | public string SobrName { get; set; } 18 | public string HostId { get; set; } 19 | public string MountHostId { get; set; } 20 | public string Description { get; set; } 21 | public string CreationTime { get; set; } 22 | public string Path { get; set; } 23 | public string FullPath { get; set; } 24 | public string FriendlyPath { get; set; } 25 | public string ShareCredsId { get; set; } 26 | public string Type { get; set; } 27 | public string Status { get; set; } 28 | public bool IsUnavailable { get; set; } 29 | public string Group { get; set; } 30 | public string UseNfsOnMountHost { get; set; } 31 | public string VersionOfCreation { get; set; } 32 | public string Tag { get; set; } 33 | public bool IsTemporary { get; set; } 34 | public string TypeDisplay { get; set; } 35 | public bool IsRotatedDriveRepository { get; set; } 36 | public string EndPointCryptoKeyId { get; set; } 37 | public string Options { get; set; } 38 | public bool HasBackupChainLengthLimitation { get; set; } 39 | public bool IsSanSnapshotOnly { get; set; } 40 | public bool IsDedupStorage { get; set; } 41 | public bool SplitStoragesPerVm { get; set; } 42 | public bool IsImmutabilitySupported { get; set; } 43 | public int Ram { get; set; } 44 | public int Cores { get; set; } 45 | public bool IsAutoGateway { get; set; } 46 | public string Povisioning { get; set; } 47 | public int FreeSPace { get; set; } 48 | public int TotalSpace { get; set; } 49 | public int MaxTasks { get; set; } 50 | public bool IsDecompress { get; set; } 51 | public bool AlignBlocks { get; set; } 52 | public string GateHosts { get; set; } 53 | public bool ObjectLockEnabled { get; set; } 54 | public CRepoTypeInfos() 55 | { 56 | 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CServerTypeInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | 5 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 6 | { 7 | public class CServerTypeInfos 8 | { 9 | public string Info { get; set; } 10 | public Guid ParentId { get; set; } 11 | public string Id { get; set; } 12 | public Guid Uid { get; set; } 13 | public string Name { get; set; } 14 | public string Reference { get; set; } 15 | public string Description { get; set; } 16 | public string IsUnavailable { get; set; } 17 | public string Type { get; set; } 18 | public string ApiVersion { get; set; } 19 | public string PhysHostId { get; set; } 20 | public string ProxyServicesCreds { get; set; } 21 | public int Cores { get; set; } 22 | public int CpuCount { get; set; } 23 | public int Ram { get; set; } 24 | public int RepoTasks { get; set; } 25 | public int ProxyTasks { get; set; } 26 | public string OSInfo { get; set; } 27 | 28 | public CServerTypeInfos() 29 | { 30 | 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CSobrTypeInfos.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | public class CSobrTypeInfos 7 | { 8 | public string PolicyType { get; set; } 9 | public string Extents { get; set; } 10 | public bool UsePerVMBackupFiles { get; set; } 11 | public bool PerformFullWhenExtentOffline { get; set; } 12 | public bool EnableCapacityTier { get; set; } 13 | public int OperationalRestorePeriod { get; set; } 14 | public bool OverridePolicyEnabled { get; set; } 15 | public int OverrideSpaceThreshold { get; set; } 16 | public string OffloadWindowOptions { get; set; } 17 | public string CapacityExtent { get; set; } 18 | public bool EncryptionEnabled { get; set; } 19 | public string EncryptionKey { get; set; } 20 | public bool CapacityTierCopyPolicyEnabled { get; set; } 21 | public bool CapacityTierMovePolicyEnabled { get; set; } 22 | public bool ArchiveTierEnabled { get; set; } 23 | public string ArchiveExtent { get; set; } 24 | public string ArchivePeriod { get; set; } 25 | public bool CostOptimizedArchiveEnabled { get; set; } 26 | public bool ArchiveFullBackupModeEnabled { get; set; } 27 | public bool PluginBackupsOffloadEnabled { get; set; } 28 | public bool CopyAllPluginBackupsEnabled { get; set; } 29 | public bool CopyAllMachineBackupsEnabled { get; set; } 30 | public string Id { get; set; } 31 | public string Name { get; set; } 32 | public string Description { get; set; } 33 | 34 | public string CapTierName { get; set; } 35 | public string CapTierType { get; set; } 36 | public bool ImmuteEnabled { get; set; } 37 | public string ImmutePeriod { get; set; } 38 | public bool SizeLimitEnabled { get; set; } 39 | public string SizeLimit { get; set; } 40 | 41 | public int ExtentCount { get; set; } 42 | public int JobCount { get; set; } 43 | 44 | public CSobrTypeInfos() 45 | { 46 | 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/CWanTypeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | 4 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes 5 | { 6 | public class CWanTypeInfo 7 | { 8 | public string Id { get; set; } 9 | public string Name { get; set; } 10 | public string HostId { get; set; } 11 | public string Options { get; set; } 12 | public CWanTypeInfo() 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/NAS/CNasFileDataVmc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using CsvHelper.Configuration.Attributes; 7 | 8 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes.NAS 9 | { 10 | public class CNasFileDataVmc 11 | { 12 | [Index(0)] 13 | public string _512kb_2mb { get; set; } 14 | [Index(1)] 15 | public string _128_512kb { get; set; } 16 | [Index(2)] 17 | public string _50_100_subdirs { get; set; } 18 | [Index(3)] 19 | public string _50_100_files { get; set; } 20 | [Index(4)] 21 | public string _200_500_subdirs { get; set; } 22 | [Index(5)] 23 | public string _1_5_files { get; set; } 24 | [Index(6)] 25 | public string DirsCountsByNumberOfFiles { get; set; } 26 | [Index(7)] 27 | public string _100_200_files { get; set; } 28 | [Index(8)] 29 | public string _64_128kb { get; set; } 30 | [Index(9)] 31 | public string NasBackupSourceShareStatsJobID { get; set; } 32 | [Index(10)] 33 | public string _1m_plus_files { get; set; } 34 | [Index(11)] 35 | public string _128_256mb { get; set; } 36 | [Index(12)] 37 | public string _1_64gb { get; set; } 38 | [Index(13)] 39 | public string _10k_100k_files { get; set; } 40 | [Index(14)] 41 | public string _5_10_subdirs { get; set; } 42 | [Index(15)] 43 | public string _1k_10k_files { get; set; } 44 | [Index(16)] 45 | public string FilesCountsBySizes { get; set; } 46 | [Index(17)] 47 | public string _1tb_plus { get; set; } 48 | [Index(18)] 49 | public string _10_25_subdirs { get; set; } 50 | [Index(19)] 51 | public string _64_128mb { get; set; } 52 | [Index(20)] 53 | public string _512gb_1tb { get; set; } 54 | [Index(21)] 55 | public string _64_512gb { get; set; } 56 | [Index(22)] 57 | public string _100k_1m_subdirs { get; set; } 58 | [Index(23)] 59 | public string _25_50_subdirs { get; set; } 60 | [Index(24)] 61 | public string _1_5_subdirs { get; set; } 62 | [Index(25)] 63 | public string _16_64mb { get; set; } 64 | [Index(26)] 65 | public string _100k_1m_files { get; set; } 66 | [Index(27)] 67 | public string _0_1_files { get; set; } 68 | [Index(28)] 69 | public string _500_1k_files { get; set; } 70 | [Index(29)] 71 | public string _500_1k_subdirs { get; set; } 72 | [Index(30)] 73 | public string _25_50_files { get; set; } 74 | [Index(31)] 75 | public string DirsCountByNumberOfSubDirs { get; set; } 76 | [Index(32)] 77 | public string _0_1_subdirs { get; set; } 78 | [Index(33)] 79 | public string _10k_100k_subdirs { get; set; } 80 | [Index(34)] 81 | public string _1k_10k_subdirs { get; set; } 82 | [Index(35)] 83 | public string TotalFileSizes { get; set; } 84 | [Index(36)] 85 | public string _2_16mb { get; set; } 86 | [Index(37)] 87 | public string ShareID { get; set; } 88 | [Index(38)] 89 | public string _5_10_files { get; set; } 90 | [Index(39)] 91 | public string _100_200_subdirs { get; set; } 92 | [Index(40)] 93 | public string _256mb_1gb { get; set; } 94 | [Index(41)] 95 | public string _4_16kb { get; set; } 96 | [Index(42)] 97 | public string _10_25_files { get; set; } 98 | [Index(43)] 99 | public string _1m_plus_subdirs { get; set; } 100 | [Index(44)] 101 | public string _200_500_files { get; set; } 102 | [Index(45)] 103 | public string _16_64kb { get; set; } 104 | [Index(46)] 105 | public string _0_4kb { get; set; } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/NAS/CNasVmcInfo.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper.Configuration.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes.NAS 9 | { 10 | public class CNasVmcInfo 11 | { 12 | [Index(0)] 13 | public string FileProxy { get; set; } 14 | //[Index(1)] 15 | //public string NFSVersion { get; set; } 16 | [Index(1)] 17 | public string FileShareID { get; set; } 18 | [Index(2)] 19 | public string FileShareType { get; set; } 20 | [Index(3)] 21 | public string TotalFilesCount { get; set; } 22 | [Index(4)] 23 | public string ProxyIDs { get; set; } 24 | [Index(5)] 25 | public string AvgFoldersCountPerInc { get; set; } 26 | [Index(6)] 27 | public string BackupIOControlLevel { get; set; } 28 | [Index(7)] 29 | public string TotalFoldersCount { get; set; } 30 | [Index(8)] 31 | public string AvgIncrementSize { get; set; } 32 | [Index(9)] 33 | public string CacheRepository { get; set; } 34 | [Index(10)] 35 | public string AvgFilesCountPerInc { get; set; } 36 | [Index(11)] 37 | public string BackupMode { get; set; } 38 | [Index(12)] 39 | public string TotalShareSize { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/NAS/CObjectShareVmcInfo.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper.Configuration.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes.NAS 9 | { 10 | public class CObjectShareVmcInfo 11 | { 12 | [Index(0)] 13 | public string ParentObjectStorageID { get; set; } 14 | 15 | [Index(1)] 16 | public string AvgObjectsCountPerInc { get; set; } 17 | 18 | [Index(2)] 19 | public string ObjectStorageBucketID { get; set; } 20 | 21 | [Index(3)] 22 | public string TotalObjectStorageSize { get; set; } 23 | 24 | [Index(4)] 25 | public string TotalObjectsCount { get; set; } 26 | 27 | [Index(5)] 28 | public string AvgIncrementSize { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/ProxyData/CProxyDataFormer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using VeeamHealthCheck.Shared; 5 | 6 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes.ProxyData 7 | { 8 | internal class CProxyDataFormer 9 | { 10 | public CProxyDataFormer() { } 11 | public void FormData() 12 | { 13 | 14 | } 15 | public string CalcProxyTasks(int assignedTasks, int cores, int ram) 16 | { 17 | int availableMem = ram ; //TODO double-check OS mem requirements 18 | int memTasks = (int)Math.Round((decimal)(availableMem / 1), 0, MidpointRounding.ToPositiveInfinity); 19 | int coreTasks = 0; 20 | 21 | if (cores == 0 && ram == 0) 22 | return "NA"; 23 | 24 | if (CGlobals.VBRMAJORVERSION == 11) 25 | { 26 | coreTasks = cores; //TODO need to imrprove this to cover 11a change 27 | memTasks = MemoryTasks(availableMem, 2); 28 | } 29 | else if (CGlobals.VBRMAJORVERSION == 12) 30 | { 31 | coreTasks = (cores) * 2; 32 | memTasks = MemoryTasks(availableMem, 1); 33 | } 34 | 35 | return SetProvisionStatus(assignedTasks, coreTasks, memTasks); 36 | 37 | 38 | } 39 | private int MemoryTasks(int availableMem, double memoryPerTask) 40 | { 41 | return (int)Math.Round((decimal)(availableMem / memoryPerTask), 0, MidpointRounding.ToPositiveInfinity); 42 | } 43 | private string SetProvisionStatus(int assignedTasks, int coreTasks, int memTasks) 44 | { 45 | CProvisionTypes pt = new(); 46 | 47 | 48 | 49 | if (coreTasks == memTasks) 50 | { 51 | if (assignedTasks == memTasks) 52 | return pt.WellProvisioned; 53 | if (assignedTasks > memTasks) 54 | return pt.OverProvisioned; 55 | //if (assignedTasks < memTasks) 56 | // return pt.UnderProvisioned; 57 | } 58 | 59 | if (coreTasks < memTasks) 60 | { 61 | if (assignedTasks == coreTasks) 62 | return pt.WellProvisioned; 63 | //if (assignedTasks <= coreTasks) 64 | // return pt.UnderProvisioned; 65 | if (assignedTasks > coreTasks) 66 | return pt.OverProvisioned; 67 | } 68 | if (coreTasks > memTasks) 69 | { 70 | if (assignedTasks == memTasks) 71 | return pt.WellProvisioned; 72 | //if (assignedTasks <= memTasks) 73 | // return pt.UnderProvisioned; 74 | if (assignedTasks > memTasks) 75 | return pt.OverProvisioned; 76 | } 77 | 78 | 79 | 80 | return "NA"; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/DataTypes/Tape/CTapeJobInfo.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper.Configuration.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace VeeamHealthCheck.Functions.Reporting.DataTypes.Tape 9 | { 10 | public class CTapeJobInfo 11 | { 12 | [Index(0)] 13 | public string FullBackupPolicy { get; set; } 14 | [Index(1)] 15 | public string Object { get; set; } 16 | [Index(2)] 17 | public string ProcessIncrementalBackup { get; set; } 18 | 19 | [Index(3)] 20 | public string ScheduleOptions { get; set; } 21 | [Index(4)] 22 | public string WaitForBackupJobs { get; set; } 23 | [Index(5)] 24 | public string WaitPeriod { get; set; } 25 | [Index(6)] 26 | public string GFSScheduleOptions { get; set; } 27 | [Index(7)] 28 | public string AlwaysCopyFromLatestFull { get; set; } 29 | [Index(8)] 30 | public string ParallelDriveOptions { get; set; } 31 | [Index(9)] 32 | public string EjectCurrentMedium { get; set; } 33 | [Index(10)] 34 | public string ExportCurrentMediaSet { get; set; } 35 | [Index(11)] 36 | public string ExportDays { get; set; } 37 | [Index(12)] 38 | public string FullBackupMediaPool { get; set; } 39 | [Index(13)] 40 | public string IncrementalBackupMediaPool { get; set; } 41 | [Index(14)] 42 | public string UseHardwareCompression { get; set; } 43 | [Index(15)] 44 | public string NotificationOptions { get; set; } 45 | [Index(16)] 46 | public string JobScriptOptions { get; set; } 47 | [Index(17)] 48 | public string Enabled { get; set; } 49 | [Index(18)] 50 | public string NextRun { get; set; } 51 | [Index(19)] 52 | public string Target { get; set; } 53 | [Index(20)] 54 | public string Type { get; set; } 55 | [Index(21)] 56 | public string LastResult { get; set; } 57 | [Index(22)] 58 | public string LastState { get; set; } 59 | [Index(23)] 60 | public string Id { get; set; } 61 | [Index(24)] 62 | public string Name { get; set; } 63 | [Index(25)] 64 | public string Description { get; set; } 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/CReportDataModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html 8 | { 9 | internal class CReportDataModel 10 | { 11 | public CReportDataModel() 12 | { 13 | 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/ConcurentTracker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | 5 | namespace VeeamHealthCheck.Functions.Reporting.Html 6 | { 7 | class ConcurentTracker 8 | { 9 | public DayOfWeek DayofTheWeeek { get; set; } 10 | public DateTime Date { get; set; } 11 | public int Hour { get; set; } 12 | public int hourMinute { get; set; } 13 | public int Minutes { get; set; } 14 | public TimeSpan Duration { get; set; } 15 | public ConcurentTracker() 16 | { 17 | 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/DataFormers/CJobTypesParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365; 7 | using VeeamHealthCheck.Shared; 8 | 9 | namespace VeeamHealthCheck.Functions.Reporting.Html.DataFormers 10 | { 11 | public class CJobTypesParser 12 | { 13 | public static string GetJobType(string jobType) 14 | { 15 | if(CGlobals.DEBUG){ 16 | CGlobals.Logger.Debug("JobType = " + jobType); 17 | } 18 | switch (jobType) 19 | { 20 | case "Copy": 21 | return "File Copy"; 22 | case "SimpleBackupCopyPolicy": 23 | return "Backup Copy"; 24 | case "NasBackup": 25 | return "File Backup"; 26 | case "ENasBackup": 27 | return "File Backup"; 28 | case "Backup": 29 | return "Backup"; 30 | case "Replica": 31 | return "Replica"; 32 | case "NasBackupCopy": 33 | return "File Backup - Copy"; 34 | case "MSSQLPlugin": 35 | return "MS SQL Plugin"; 36 | case "SureBackup": 37 | return "SureBackup"; 38 | case "FileTapeBackup": 39 | return "Tape"; 40 | case "VmTapeBackup": 41 | return "Tape"; 42 | case "BackupSync": 43 | return "Backup Copy"; 44 | case "SqlLogBackup": 45 | return "SQL Log Backup"; 46 | case "OracleLogBackup": 47 | return "Oracle Log Backup"; 48 | case "SimpleBackupCopyWorker": 49 | return "Backup Copy"; 50 | case "ConfBackup": 51 | return "Configuration Backup"; 52 | case "Cloud": 53 | return "Cloud Backup"; 54 | case "OrchestratedTask": 55 | return "Orchestrated Task"; 56 | case "OracleRMANBackup": 57 | return "Enterprise Database Plugin"; 58 | case "SapBackintBackup": 59 | return "Enterprise Database Plugin"; 60 | case "EpAgentManagement": 61 | return "Agent Backup"; 62 | case "ELinuxPhysical": 63 | return "Agent Backup"; 64 | case "EEndPoint": 65 | return "Endpoint Backup"; 66 | case "EHyperV": 67 | return "Hyper-V Backup"; 68 | case "EVmware": 69 | return "VMware Backup"; 70 | case "": 71 | return "Other"; 72 | default: 73 | return jobType; 74 | } 75 | 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/DataFormers/CMultiRoleServer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | namespace VeeamHealthCheck.Functions.Reporting.Html.DataFormers 4 | { 5 | internal class CMultiRoleServer 6 | { 7 | /* Server name 8 | * Resources 9 | * Proxy tasks 10 | * Repo Tasks 11 | * CDP present? -> cache 12 | * WAN Present? -> cache 13 | * 14 | * Ideal task breakdown? 15 | * Flag for resources? 16 | */ 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/Exportables/CHtmlToDocx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Controls; 8 | using System; 9 | using System.IO; 10 | using Xceed.Words.NET; 11 | using HtmlToOpenXml; 12 | using DocumentFormat.OpenXml.Packaging; 13 | using DocumentFormat.OpenXml.Wordprocessing; 14 | using DocumentFormat.OpenXml; 15 | 16 | namespace VeeamHealthCheck.Functions.Reporting.Html.Exportables 17 | { 18 | internal class CHtmlToDocx 19 | { 20 | public void ExportHtmlToDocx(string htmlContent, string outputPath) 21 | { 22 | // Create a new document 23 | using (var wordDocument = WordprocessingDocument.Create(outputPath, WordprocessingDocumentType.Document)) 24 | { 25 | // Add a main document part 26 | var mainPart = wordDocument.AddMainDocumentPart(); 27 | mainPart.Document = new Document(); 28 | var body = new Body(); 29 | mainPart.Document.Append(body); 30 | 31 | // Set the document to landscape mode 32 | var sectionProperties = new SectionProperties(); 33 | var pageSize = new PageSize 34 | { 35 | Width = 16838, // 11.69 inches in twentieths of a point (A4 landscape width) 36 | Height = 11906, // 8.27 inches in twentieths of a point (A4 landscape height) 37 | Orient = PageOrientationValues.Landscape 38 | }; 39 | var pageMargin = new PageMargin 40 | { 41 | Top = 720, // 1 inch in twentieths of a point 42 | Right = 720, 43 | Bottom = 720, 44 | Left = 720 45 | }; 46 | sectionProperties.Append(pageSize); 47 | sectionProperties.Append(pageMargin); 48 | body.Append(sectionProperties); 49 | 50 | // Create a new HtmlConverter 51 | var converter = new HtmlConverter(mainPart); 52 | 53 | // Convert the HTML content to DocX format 54 | converter.ParseBody(htmlContent); 55 | 56 | // Save the document 57 | mainPart.Document.Save(); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/Exportables/HtmlToPdfConverter.cs: -------------------------------------------------------------------------------- 1 | using DinkToPdf; 2 | using DinkToPdf.Contracts; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Drawing.Printing; 6 | using System.IO; 7 | using System.Windows.Controls; 8 | 9 | namespace VeeamHealthCheck.Functions.Reporting.Html.Exportables 10 | { 11 | public class HtmlToPdfConverter 12 | { 13 | private IConverter _converter; 14 | 15 | public HtmlToPdfConverter() 16 | { 17 | _converter = new SynchronizedConverter(new PdfTools()); 18 | } 19 | 20 | [STAThread] 21 | public void ConvertHtmlToPdf(string htmlContent, string outputPath) 22 | { 23 | var html = htmlContent; //"

Hello, World!

"; // replace with your HTML string 24 | var doc = new HtmlToPdfDocument() 25 | { 26 | GlobalSettings = { 27 | ColorMode = DinkToPdf.ColorMode.Color, 28 | Orientation = DinkToPdf.Orientation.Landscape, 29 | PaperSize = DinkToPdf.PaperKind.A3, 30 | Margins = new MarginSettings { Top = 10 }, 31 | }, 32 | Objects = { 33 | new ObjectSettings() 34 | { 35 | HtmlContent = html, 36 | WebSettings = { DefaultEncoding = "utf-8" }, 37 | } 38 | } 39 | }; 40 | 41 | byte[] pdf = _converter.Convert(doc); 42 | File.WriteAllBytes(outputPath, pdf); 43 | 44 | } 45 | // dispose method 46 | public void Dispose() 47 | { 48 | _converter = null; 49 | } 50 | } 51 | } 52 | 53 | 54 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/Shared/CObjectHelpers.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | namespace VeeamHealthCheck.Functions.Reporting.Html.Shared 4 | { 5 | public class CObjectHelpers 6 | { 7 | public static bool ParseBool(string value) 8 | { 9 | if (value == null) return false; 10 | else if (value.Length == 0) return false; 11 | else if (string.IsNullOrEmpty(value)) return false; 12 | else if (value == "true" || value == "True" || value == "TRUE") return true; 13 | else if (value == "false" || value == "False" || value == "FALSE") return false; 14 | else return false; 15 | } 16 | public static int ParseInt(string value) 17 | { 18 | if (value == null) return 0; 19 | return int.TryParse(value, out int i) ? i : 0; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/BackupServer/CConfigBackupTable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using VeeamHealthCheck.Functions.Analysis.DataModels; 5 | using VeeamHealthCheck.Functions.Collection.Security; 6 | using VeeamHealthCheck.Functions.Reporting.Html; 7 | using VeeamHealthCheck.Functions.Reporting.Html.Shared; 8 | 9 | namespace VeeamHealthCheck.Reporting.Html.VBR 10 | { 11 | internal class CConfigBackupTable 12 | { 13 | CHtmlFormatting _form = new(); 14 | public CConfigBackupTable() 15 | { 16 | ParseBackupServer(); 17 | } 18 | public Tuple ConfigBackupEnabled() 19 | { 20 | string header = _form.TableHeader("Config Backup Enabled", ""); 21 | string data = ""; 22 | if(CSecurityGlobalValues.ConfigBackupEnabled) 23 | { 24 | data = _form.TableData(_form.True, ""); 25 | } 26 | else 27 | { 28 | data = _form.TableData(_form.False, ""); 29 | } 30 | 31 | return Tuple.Create(header, data); 32 | } 33 | public Tuple ConfigBackupSuccessful() 34 | { 35 | string header = _form.TableHeader("Config Backup Last Run Successful", ""); 36 | string data = _form.TableData(CSecurityGlobalValues.ConfigBackupSuccess.ToString(), ""); 37 | 38 | return Tuple.Create(header, data); 39 | } 40 | public Tuple ConfigBackupEncrypted() 41 | { 42 | string header = _form.TableHeader("Config Backup Encrypted", ""); 43 | string data = ""; 44 | if(CSecurityGlobalValues.ConfigBackupEncrypted) 45 | { 46 | data = _form.TableData(_form.True, ""); 47 | } 48 | else 49 | { 50 | data = _form.TableData(_form.False, ""); 51 | } 52 | 53 | return Tuple.Create(header, data); 54 | } 55 | private void ParseBackupServer() 56 | { 57 | CDataFormer df = new(); 58 | Functions.Analysis.DataModels.BackupServer b = df.BackupServerInfoToXml(false); 59 | CSecurityGlobalValues.ConfigBackupEnabled = b.ConfigBackupEnabled; 60 | if(b.ConfigBackupEnabled) 61 | { 62 | CSecurityGlobalValues.ConfigBackupEncrypted = b.ConfigBackupEncryption; 63 | CSecurityGlobalValues.ConfigBackupSuccess = b.ConfigBackupLastResult; 64 | } 65 | else 66 | { 67 | CSecurityGlobalValues.ConfigBackupEncrypted = false; 68 | CSecurityGlobalValues.ConfigBackupSuccess = "N/A"; 69 | } 70 | 71 | 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/BackupServer/CVbrServerTable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Collections.Generic; 5 | using VeeamHealthCheck.Functions.Analysis.DataModels; 6 | using VeeamHealthCheck.Reporting.Html.VBR; 7 | using VeeamHealthCheck.Shared; 8 | 9 | namespace VeeamHealthCheck.Reporting.Html.VBR 10 | { 11 | internal class CVbrServerTable 12 | { 13 | private readonly CVbrServerTableHelper _tables; 14 | 15 | public CVbrServerTable(Functions.Analysis.DataModels.BackupServer backupServer) 16 | { 17 | _tables = new CVbrServerTableHelper(backupServer); 18 | } 19 | 20 | 21 | 22 | public void DebugLogTuple() 23 | { 24 | string headers = ""; 25 | string data = ""; 26 | foreach (var h in VbrFullTables()) 27 | { 28 | headers += h.Item1; 29 | data += h.Item2; 30 | } 31 | CGlobals.Logger.Warning(headers, false); 32 | CGlobals.Logger.Warning("\nLINE BREAK\n", false); 33 | CGlobals.Logger.Warning(data, false); 34 | } 35 | public List> VbrFullTables() 36 | { 37 | List> headers = new List> 38 | { 39 | _tables.ServerName(), 40 | _tables.ServerVersion(), 41 | _tables.Cores(), 42 | _tables.RAM(), 43 | _tables.ProxyRole(), 44 | _tables.RepoGatewayRole(), 45 | _tables.WanRole(), 46 | //_tables.ConsoleStatus(), 47 | //_tables.RdpStatus(), 48 | //_tables.DomainStatus(), 49 | }; 50 | 51 | return headers; 52 | } 53 | public List> VbrSecurityTables() 54 | { 55 | List> headers = new List> 56 | { 57 | _tables.ServerName(), 58 | _tables.ServerVersion(), 59 | //_tables.Cores(), 60 | //_tables.RAM(), 61 | //_tables.ProxyRole(), 62 | //_tables.RepoGatewayRole(), 63 | //_tables.WanRole(), 64 | _tables.ConsoleStatus(), 65 | _tables.RdpStatus(), 66 | _tables.DomainStatus(), 67 | }; 68 | 69 | return headers; 70 | } 71 | 72 | 73 | public void Dispose() { } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/CHtmlTablesHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using VeeamHealthCheck.Functions.Reporting.Html; 7 | using VeeamHealthCheck.Functions.Reporting.Html.Shared; 8 | using VeeamHealthCheck.Functions.Reporting.Html.VBR; 9 | using VeeamHealthCheck.Reporting.Html.VBR; 10 | //using VeeamHealthCheck.Reporting.Html.VBR.VbrTables.Security; 11 | 12 | namespace VeeamHealthCheck.Reporting.Html.VBR 13 | { 14 | internal class CHtmlTablesHelper 15 | { 16 | CHtmlFormatting _form = new(); 17 | public CHtmlTablesHelper() 18 | { 19 | 20 | } 21 | public string AddSecurityServerInfo() 22 | { 23 | CSecurityBackupServerTable t = new(); 24 | return WriteTupleListToHtml(t.ServerSpecificInfo()); 25 | } 26 | public string AddSecuritySummaryDetails() 27 | { 28 | CVbrSecurityTables t = new(); 29 | return WriteTupleListToHtml(t.SecuritySummaryTables()); 30 | } 31 | public string AddConfigBackupDetails() 32 | { 33 | CVbrSecurityTables t = new(); 34 | return WriteTupleListToHtml(t.ConfigBackupInfo()); 35 | } 36 | public string AddImmutabilityTables() 37 | { 38 | CImmutabilityTable ct = new(); 39 | 40 | return WriteTupleListToHtml(new List>()); 41 | } 42 | public List CollectedOsInfo() 43 | { 44 | CDataFormer df = new(); 45 | List list = df.ServerXmlFromCsv(false); 46 | List operatingSystems = new(); 47 | foreach (CManagedServer server in list) 48 | { 49 | operatingSystems.Add(server.OsInfo); 50 | } 51 | operatingSystems.Sort(); 52 | return operatingSystems.Distinct().ToList(); 53 | } 54 | private string WriteTupleListToHtml(List> list) 55 | { 56 | string headers = ""; 57 | string data = ""; 58 | string s = ""; 59 | foreach (var table in list) 60 | { 61 | headers += table.Item1; 62 | data += table.Item2; 63 | } 64 | s += _form.TableHeader("header", "tooltip"); 65 | s += headers; 66 | s += _form.TableHeaderEnd(); 67 | s += _form.TableBodyStart(); 68 | s += data; 69 | s += _form.EndTable(); 70 | 71 | return s; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/CJobSummaryTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using VeeamHealthCheck.Functions.Reporting.CsvHandlers; 7 | using VeeamHealthCheck.Functions.Reporting.Html.DataFormers; 8 | using VeeamHealthCheck.Shared; 9 | using static VeeamHealthCheck.Functions.Collection.DB.CModel; 10 | 11 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables 12 | { 13 | internal class CJobSummaryTable 14 | { 15 | public CJobSummaryTable() { } 16 | public Dictionary JobSummaryTable() 17 | { 18 | Dictionary typeAndCount = new(); 19 | 20 | try 21 | { 22 | CCsvParser csv = new(); 23 | var backupJobs = csv.JobCsvParser().ToList(); 24 | var pluginJobs = csv.GetDynamicPluginJobs(); 25 | var agentBackups = csv.GetDynamicAgentBackupJob(); 26 | var catalystJobs = csv.GetDynamicCatalystJob(); 27 | var cdpJobs = csv.GetDynamicCdpJobs(); 28 | var endpointJobs = csv.GetDynamicEndpointJob(); 29 | var nasBackupJobs = csv.GetDynamicNasBackup(); 30 | var nasBcj = csv.GetDynamicNasBCJ(); 31 | var sureBackup = csv.GetDynamicSureBackupJob(); 32 | var tapeJobs = csv.GetTapeJobInfoFromCsv(); 33 | var types = backupJobs.Select(x => x.JobType).Distinct().ToList(); 34 | 35 | typeAndCount.Add("Plugin", pluginJobs.Count()); 36 | typeAndCount.Add("Agent Backup", agentBackups.Count()); 37 | typeAndCount.Add("Catalyst Copy", catalystJobs.Count()); 38 | typeAndCount.Add("CDP", cdpJobs.Count()); 39 | typeAndCount.Add("Unmanaged Agent", endpointJobs.Count()); 40 | typeAndCount.Add("File Backup", nasBackupJobs.Count()); 41 | typeAndCount.Add("File Backup - Copy", nasBcj.Count()); 42 | typeAndCount.Add("SureBackup", sureBackup.Count()); 43 | typeAndCount.Add("Tape", tapeJobs.Count()); 44 | try 45 | { 46 | foreach (var bType in types) 47 | { 48 | if (bType == "NasBackup" || bType == "NasBackupCopy") 49 | continue; 50 | var realType = CJobTypesParser.GetJobType(bType); 51 | if (!typeAndCount.ContainsKey(realType)) 52 | { 53 | try 54 | { 55 | typeAndCount.Add(realType, backupJobs.Count(x => x.JobType == bType)); 56 | 57 | } 58 | catch (Exception ex) { CGlobals.Logger.Error(ex.Message); } 59 | } 60 | } 61 | } 62 | catch (Exception ex) { CGlobals.Logger.Error(ex.Message); } 63 | 64 | 65 | foreach (string dbType in Enum.GetNames(typeof(EDbJobType))) 66 | { 67 | string humanReadable = CJobTypesParser.GetJobType(dbType); 68 | if(!typeAndCount.ContainsKey(humanReadable)) 69 | { 70 | typeAndCount.Add(humanReadable, 0); 71 | } 72 | } 73 | 74 | //sort the dictionary 75 | typeAndCount = typeAndCount.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value); 76 | 77 | } 78 | 79 | catch (Exception ex) { CGlobals.Logger.Error(ex.Message); } 80 | 81 | 82 | return typeAndCount; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Job Session Summary/JobSessionSummaryRow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR 8 | { 9 | class JobSessionSummaryRow 10 | { 11 | //public JobSessionSummaryRow() 12 | //{ 13 | 14 | //} 15 | public string Name { get; set; } 16 | public int Items { get; set; } 17 | public TimeSpan MinTime { get; set; } 18 | public TimeSpan MaxTime { get; set; } 19 | public TimeSpan AvgTime { get; set; } 20 | public int TotalSessions { get; set; } 21 | public int Fails { get; set; } 22 | public int Retries { get; set; } 23 | public int SuccessRate { get; set; } 24 | public double AvgBackupSizeTb { get; set; } 25 | public double MaxBackupSizeTb { get; set; } 26 | public double AvgDataSizeTb { get; set; } 27 | public double MaxDataSizeTb { get; set; } 28 | public int AvgChangeRate { get; set; } 29 | public int WaitForResourceCount { get; set; } 30 | public TimeSpan MaxWait { get; set; } 31 | public TimeSpan AvgWait { get; set; } 32 | public string JobType { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Job Session Summary/SessionStats.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.Job_Session_Summary 8 | { 9 | internal class SessionStats 10 | { 11 | public SessionStats() 12 | { 13 | 14 | } 15 | public int SessionCount { get; set; } 16 | public int FailCounts { get; set; } 17 | public int RetryCounts { get; set; } 18 | public List JobDuration { get; set; } = new List(); 19 | public List VmNames { get; set; } = new List(); 20 | public List DataSize { get; set; } = new List(); 21 | public List BackupSize { get; set; } = new List(); 22 | public string JobType { get; set; } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/JobInfoTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables 8 | { 9 | public class JobInfoTable 10 | { 11 | public List Jobs { get; set; } 12 | 13 | } 14 | public class JobInfo 15 | { 16 | public string Name { get; set; } 17 | public string Repository { get; set; } 18 | 19 | // create members for each of these: Name Repository Source Size Retention Scheme Restore Points Encrypted Job Type Compression Level Block Size GFS Enabled GFS Retention Active Full Enabled Synthetic Full Enabled Backup Chain Type Indexing Enabled 20 | public string SourceSize { get; set; } 21 | public string RetentionScheme { get; set; } 22 | public string RestorePoints { get; set; } 23 | public string Encrypted { get; set; } 24 | public string JobType { get; set; } 25 | public string CompressionLevel { get; set; } 26 | public string BlockSize { get; set; } 27 | public string GfsEnabled { get; set; } 28 | public string GfsRetention { get; set; } 29 | public string ActiveFullEnabled { get; set; } 30 | public string SyntheticFullEnabled { get; set; } 31 | public string BackupChainType { get; set; } 32 | public string IndexingEnabled { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Jobs Info/CTapeJobInfoTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using VeeamHealthCheck.Functions.Reporting.CsvHandlers; 7 | using VeeamHealthCheck.Functions.Reporting.DataTypes.Tape; 8 | using VeeamHealthCheck.Functions.Reporting.Html.Shared; 9 | using VeeamHealthCheck.Scrubber; 10 | using VeeamHealthCheck.Shared; 11 | 12 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.Jobs_Info 13 | { 14 | internal class CTapeJobInfoTable 15 | { 16 | private readonly CHtmlFormatting _form = new(); 17 | private readonly CScrubHandler _scrubber = CGlobals.Scrubber; 18 | public CTapeJobInfoTable() { } 19 | 20 | public string TapeJobTable() 21 | { 22 | string t = ""; 23 | try 24 | { 25 | CCsvParser c = new(); 26 | var tapeJobInfo = c.GetTapeJobInfoFromCsv(); 27 | if (tapeJobInfo.Count() == 0) 28 | return ""; 29 | 30 | t += _form.Table(); 31 | t += _form.TableHeaderLeftAligned("Job Name", ""); 32 | t += _form.TableHeader("Media Pool - Full", ""); 33 | t += _form.TableHeader("Incremental Enabled", ""); 34 | t += _form.TableHeader("Media Pool - Incremental", ""); 35 | t += _form.TableHeader("Hardware Compression", ""); 36 | t += _form.TableHeader("Eject Medium", ""); 37 | t += _form.TableHeader("Export Media Set", ""); 38 | t += _form.TableHeader("Job Is Enabled", ""); 39 | t += _form.TableHeader("Next Run", ""); 40 | t += _form.TableHeader("Last Result", ""); 41 | 42 | t += _form.TableBodyStart(); 43 | foreach (var tj in tapeJobInfo) 44 | { 45 | string jobName = tj.Name; 46 | string fullMediaPool = tj.FullBackupMediaPool; 47 | string incMediaPool = tj.IncrementalBackupMediaPool; 48 | if (CGlobals.Scrub) 49 | { 50 | jobName = CGlobals.Scrubber.ScrubItem(jobName, ScrubItemType.Job); 51 | fullMediaPool = CGlobals.Scrubber.ScrubItem(fullMediaPool, ScrubItemType.MediaPool); 52 | incMediaPool = CGlobals.Scrubber.ScrubItem(incMediaPool, ScrubItemType.MediaPool); 53 | } 54 | 55 | t += ""; 56 | t += _form.TableDataLeftAligned(jobName, ""); 57 | t += _form.TableData(fullMediaPool, ""); 58 | t += _form.TableData(tj.ProcessIncrementalBackup, ""); 59 | t += _form.TableData(incMediaPool, ""); 60 | t += _form.TableData(tj.UseHardwareCompression, ""); 61 | t += _form.TableData(tj.EjectCurrentMedium, ""); 62 | t += _form.TableData(tj.ExportCurrentMediaSet, ""); 63 | t += _form.TableData(tj.Enabled, ""); 64 | t += _form.TableData(tj.NextRun, ""); 65 | t += _form.TableData(tj.LastResult, ""); 66 | t += ""; 67 | 68 | 69 | } 70 | t += ""; 71 | t += ""; 72 | 73 | } 74 | catch (Exception e) 75 | { 76 | Console.WriteLine(e); 77 | throw; 78 | } 79 | return t; 80 | 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Managed Server Table/CManagedServer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | namespace VeeamHealthCheck.Reporting.Html.VBR 4 | { 5 | public class CManagedServer 6 | { 7 | public string Name { get; set; } 8 | public int Cores { get; set; } 9 | public int Ram { get; set; } 10 | public string Type { get; set; } 11 | public string OsInfo { get; set; } 12 | public string ApiVersion { get; set; } 13 | public int ProtectedVms { get; set; } 14 | public int NotProtectedVms { get; set; } 15 | public int TotalVms { get; set; } 16 | public bool IsProxy { get; set; } 17 | public bool IsRepo { get; set; } 18 | public bool IsWan { get; set; } 19 | public string IsUnavailable { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/ProtectedWorkloads/CEntraTenants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using VeeamHealthCheck.Functions.Reporting.CsvHandlers; 7 | using VeeamHealthCheck.Functions.Reporting.DataTypes; 8 | 9 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.ProtectedWorkloads 10 | { 11 | internal class CEntraTenants 12 | { 13 | public CEntraTenants() { } 14 | public CProtectedWorkloads EntraTable() 15 | { 16 | CProtectedWorkloads p = new(); 17 | try 18 | { 19 | CCsvParser c = new(); 20 | var n = c.GetDynamicEntraTenants().ToList(); 21 | foreach (var rec in n) 22 | { 23 | EntraWorkloads entra = new(); 24 | entra.TenantName = rec.TenantName; 25 | entra.CacheRepoName = rec.CacheRepoName; 26 | if(!String.IsNullOrEmpty(entra.TenantName) && !String.IsNullOrEmpty(entra.CacheRepoName)) 27 | p.entraWorkloads.Add(entra); 28 | } 29 | } 30 | catch (Exception e) 31 | { 32 | Console.WriteLine(e); 33 | throw; 34 | } 35 | return p; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/ProtectedWorkloads/NasSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using VeeamHealthCheck.Functions.Reporting.CsvHandlers; 7 | using VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365; 8 | using VeeamHealthCheck.Functions.Reporting.DataTypes; 9 | using VeeamHealthCheck.Functions.Reporting.Html.Shared; 10 | using VeeamHealthCheck.Shared; 11 | using VeeamHealthCheck.Shared.Logging; 12 | 13 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.ProtectedWorkloads 14 | { 15 | internal class NasSourceInfo 16 | { 17 | private CHtmlFormatting _form = new(); 18 | public NasSourceInfo() 19 | { 20 | 21 | } 22 | public CProtectedWorkloads NasTable() 23 | { 24 | CProtectedWorkloads p = new(); 25 | 26 | 27 | try 28 | { 29 | CCsvParser c = new(); 30 | var n = c.GetDynamicNasShareSize(); 31 | foreach (var rec in n) 32 | { 33 | if(rec.BackupMode != "") 34 | { 35 | NasWorkloads nas = new(); 36 | nas.FileShareType = rec.FileShareType; 37 | nas.TotalShareSize = CalculateStorageString(rec.TotalShareSize); 38 | nas.TotalFilesCount = Convert.ToDouble(rec.TotalFilesCount); 39 | nas.TotalFoldersCount = Convert.ToDouble(rec.TotalFoldersCount); 40 | p.nasWorkloads.Add(nas); 41 | } 42 | 43 | 44 | //if (nas.TotalFilesCount > 0 || nas.TotalFoldersCount > 0 || Convert.ToDouble(rec.TotalShareSize) > 0) 45 | // p.nasWorkloads.Add(nas); 46 | } 47 | var objectShares = c.GetDynamicNasObjectSize(); 48 | foreach (var rec in objectShares) 49 | { 50 | NasWorkloads nas = new(); 51 | nas.FileShareType = "Object"; 52 | nas.TotalShareSize = CalculateStorageString(rec.TotalObjectStorageSize); 53 | nas.TotalFilesCount = Convert.ToDouble(rec.TotalObjectsCount); 54 | 55 | if (nas.TotalFilesCount > 0 || Convert.ToDouble(rec.TotalObjectStorageSize) > 0) 56 | p.nasWorkloads.Add(nas); 57 | } 58 | 59 | 60 | } 61 | catch (Exception e) 62 | { 63 | Console.WriteLine(e); 64 | throw; 65 | } 66 | 67 | 68 | return p; 69 | } 70 | private string CalculateStorageString(string size) 71 | { 72 | try 73 | { 74 | double sizeD = Convert.ToDouble(size); 75 | // check if size is in TB 76 | double sizeMB = sizeD / 1024 / 1024; 77 | double sizeGB = sizeD / 1024 / 1024 / 1024; 78 | double sizeTB = sizeD / 1024 / 1024 / 1024 / 1024; 79 | double sizePB = sizeD / 1024 / 1024 / 1024 / 1024 / 1024; 80 | 81 | if (sizePB > 1) 82 | { 83 | return $"{sizePB:0.00} PB"; 84 | } 85 | else if (sizeTB > 1) 86 | { 87 | return $"{sizeTB:0.00} TB"; 88 | } 89 | else if (sizeGB > 1) 90 | { 91 | return $"{sizeGB:0.00} GB"; 92 | } 93 | else if (sizeMB > 1) 94 | { 95 | return $"{sizeMB:0.00} MB"; 96 | } 97 | else 98 | { 99 | return $"{sizeD:0.00} KB"; 100 | } 101 | } 102 | catch(Exception ex) 103 | { 104 | CGlobals.Logger.Warning("Failed to parse NAS source size"); 105 | CGlobals.Logger.Warning(ex.Message); 106 | return "Undetermined"; 107 | } 108 | 109 | 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Registry/CRegistrySkipKeys.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.Registry 8 | { 9 | internal class CRegistrySkipKeys 10 | { 11 | public static string[] SkipKeys = { 12 | "AzureArchiveFreezingUnSupportedRegions", 13 | "HighestDetectedVMCVersion", 14 | "SqlSecuredPassword", 15 | "SqlLogin", 16 | "SqlServerName", 17 | "SqlInstanceName", 18 | "SqlDatabaseName", 19 | "SqlLockInfo" 20 | 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Repositories/CRepository.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR 9 | { 10 | public class CRepository 11 | { 12 | public string Name { get; set; } 13 | public string SobrName { get; set; } 14 | public int MaxTasks { get; set; } 15 | public int JobCount { get; set; } 16 | public int Cores { get; set; } 17 | public int Ram { get; set; } 18 | public bool IsAutoGate { get; set; } 19 | public string Host { get; set; } 20 | public string Path { get; set; } 21 | public decimal FreeSpace { get; set; } 22 | public decimal TotalSpace { get; set; } 23 | public decimal FreeSpacePercent { get; set; } 24 | public bool IsPerVmBackupFiles { get; set; } 25 | public bool IsDecompress { get; set; } 26 | public bool AlignBlocks { get; set; } 27 | public bool IsRotatedDrives { get; set; } 28 | public bool IsImmutabilitySupported { get; set; } 29 | public string Type { get; set; } 30 | public string Provisioning { get; set; } 31 | //public string GateHosts { get; set; } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Security/CReconChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Win32.TaskScheduler; 3 | using VeeamHealthCheck.Shared; 4 | 5 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.Security; 6 | 7 | public class CReconChecker 8 | { 9 | //string taskName = "Coveware Recon Healthcheck"; 10 | public void Check() 11 | { 12 | string taskName = "Coveware Recon Healthcheck"; // Replace with the name of the task you want to find 13 | 14 | try 15 | { 16 | // Create an instance of TaskService 17 | using (TaskService taskService = new TaskService()) 18 | { 19 | // Get the task by name 20 | Task task = taskService.GetTask(taskName); 21 | 22 | if (task != null) 23 | { 24 | // Get the last run time 25 | DateTime lastRunTime = task.LastRunTime; 26 | 27 | // Check if the task has ever run 28 | if (lastRunTime == DateTime.MinValue) 29 | { 30 | CGlobals.Logger.Debug($"The task '{taskName}' has never run."); 31 | } 32 | else 33 | { 34 | CGlobals.Logger.Debug($"Task '{taskName}' last ran on: {lastRunTime}"); 35 | CGlobals.IsReconDetected = true; 36 | CGlobals.LastReconRun = lastRunTime; 37 | } 38 | 39 | // Additional task details (optional) 40 | CGlobals.Logger.Debug($"Task State: {task.State}"); 41 | CGlobals.Logger.Debug($"Last Result: {task.LastTaskResult}"); // 0 typically means success 42 | } 43 | else 44 | { 45 | CGlobals.Logger.Debug($"Task '{taskName}' not found."); 46 | } 47 | } 48 | } 49 | catch (Exception ex) 50 | { 51 | CGlobals.Logger.Debug($"An error occurred: {ex.Message}"); 52 | } 53 | 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Security/CSecurityBackupServerTable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Collections.Generic; 5 | using VeeamHealthCheck.Reporting.Html.VBR; 6 | 7 | namespace VeeamHealthCheck.Reporting.Html.VBR 8 | { 9 | internal class CSecurityBackupServerTable 10 | { 11 | CVbrSecurityTableHelper _tables = new(); 12 | public CSecurityBackupServerTable() { } 13 | 14 | public List> ServerSpecificInfo() 15 | { 16 | CVbrServerTableHelper helper = new(); 17 | 18 | List> tables = new() 19 | { 20 | helper.ConsoleStatus(), 21 | helper.RdpStatus(), 22 | helper.DomainStatus() 23 | //_tables.ConsoleInstalled(), 24 | //_tables.RdpEnabled(), 25 | //_tables.DomainJoined() 26 | 27 | 28 | }; 29 | 30 | return tables; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Security/CSecuritySummaryTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.Security 8 | { 9 | public class CSecuritySummaryTable 10 | { 11 | public bool ImmutabilityEnabled { get;set;} 12 | 13 | public bool TrafficEncrptionEnabled { get; set; } 14 | public bool BackupFileEncrptionEnabled { get; set; } 15 | public bool ConfigBackupEncrptionEnabled { get; set; } 16 | public bool MFAEnabled { get; set; } 17 | 18 | public bool IsConsoleInstalled { get; set; } 19 | public CSecuritySummaryTable() 20 | { 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Security/CVbrSecurityTables.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Collections.Generic; 5 | using VeeamHealthCheck.Functions.Reporting.Html.VBR.VbrTables.Security; 6 | using VeeamHealthCheck.Shared; 7 | //using VeeamHealthCheck.Reporting.Html.VBR; 8 | //using VeeamHealthCheck.Reporting.Html.VBR.VbrTables; 9 | 10 | namespace VeeamHealthCheck.Reporting.Html.VBR 11 | { 12 | internal class CVbrSecurityTables 13 | { 14 | private CVbrSecurityTableHelper _tables; 15 | private readonly VBR.CConfigBackupTable _cfgTable = new(); 16 | public CVbrSecurityTables() 17 | { 18 | _tables = new(); 19 | if (CGlobals.DEBUG) 20 | { 21 | CGlobals.Logger.Debug("VbrSecurityTables Constructor"); 22 | } 23 | 24 | //CheckRecon(); 25 | } 26 | 27 | public List> ConfigBackupInfo() 28 | { 29 | List> tables = new() 30 | { 31 | _cfgTable.ConfigBackupEnabled(), 32 | _cfgTable.ConfigBackupSuccessful(), 33 | _cfgTable.ConfigBackupEncrypted() 34 | 35 | }; 36 | 37 | return tables; 38 | } 39 | 40 | public List> SecuritySummaryTables() 41 | { 42 | List> headers = new() 43 | { 44 | _tables.IsImmutabilityEnabledOnce(), 45 | _tables.GeneralTrafficEncryptionEnabled(), 46 | _tables.IsBackupFileEncryptionInUse(), 47 | _tables.IsConfigBackupEncrypted(), 48 | _tables.IsMFAEnabled(), 49 | }; 50 | return headers; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Security/Immutability/CImmutabilityTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR 8 | { 9 | internal class CImmutabilityTable 10 | { 11 | public CImmutabilityTable() 12 | { 13 | 14 | } 15 | 16 | // what should this table be? 17 | /* 18 | * Immutability in use 19 | * SOBR with Immute 20 | * Extents with Immute 21 | * Standalone Repo with Immute 22 | * 23 | * build the table with objects & columns 24 | * 25 | * also need to make the analysis run 1x 26 | * store the info in objects/lists 27 | * keep these around for checking. 28 | */ 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Security/Immutability/CImmutableRepos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace VeeamHealthCheck.Functions.Reporting.Html.VBR 8 | { 9 | internal class CImmutableRepos 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/Html/header_creator.ps1: -------------------------------------------------------------------------------- 1 | $string = "Organization","Name","Description","Job Type","Scope Type","Selected Items","Excluded Items","Repository","Bound Proxy","Enabled?","Schedule","Related Job" 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | foreach($s in $string){ 16 | $line = 's += TableHeader("' + $s + '","' + $s + '");' 17 | write-host($line) 18 | } -------------------------------------------------------------------------------- /vHC/HC_Reporting/Functions/Reporting/RegSettings/CDefaultRegOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System.Collections.Generic; 4 | 5 | namespace VeeamHealthCheck.Functions.Reporting.RegSettings 6 | { 7 | class CDefaultRegOptions 8 | { 9 | public Dictionary _defaultKeys = new(); 10 | 11 | public CDefaultRegOptions() 12 | { 13 | FillDict(); 14 | } 15 | 16 | private void FillDict() 17 | { 18 | _defaultKeys.Add("AgentLogging", "1"); 19 | _defaultKeys.Add("AgentLogOptions", "flush"); 20 | _defaultKeys.Add("LoggingLevel", "4"); 21 | _defaultKeys.Add("VNXBlockNaviSECCliPath", @"C:\Program Files\Veeam\Backup and Replication\Backup\EMC Navisphere CLI\NaviSECCli.exe"); 22 | _defaultKeys.Add("VNXeUemcliPath", @"C:\Program Files\Veeam\Backup and Replication\Backup\EMC Unisphere CLI\3.0.1\uemcli.exe"); 23 | _defaultKeys.Add("SqlLockInfo", ""); 24 | _defaultKeys.Add("CloudServerPort", "10003"); 25 | _defaultKeys.Add("SqlDatabaseName", "VeeamBackup"); 26 | _defaultKeys.Add("SqlInstanceName", "VEEAMSQL2016"); 27 | _defaultKeys.Add("SqlServerName", "WIN-QAVAM1GSL88"); 28 | _defaultKeys.Add("SqlLogin", ""); 29 | _defaultKeys.Add("CorePath", @"C:\Program Files\Veeam\Backup and Replication\Backup\"); 30 | _defaultKeys.Add("BackupServerPort", "9392"); 31 | _defaultKeys.Add("SecureConnectionsPort", "9401"); 32 | _defaultKeys.Add("VddkReadBufferSize", "0"); 33 | _defaultKeys.Add("EndPointServerPort", "10001"); 34 | _defaultKeys.Add("SqlSecuredPassword", ""); 35 | _defaultKeys.Add("IsComponentsUpdateRequired", "0"); 36 | _defaultKeys.Add("LicenseAutoUpdate", "1"); 37 | _defaultKeys.Add("CloudSvcPort", "6169"); 38 | _defaultKeys.Add("VBRServiceRestartNeeded", "0"); 39 | _defaultKeys.Add("ImportServers", "0"); 40 | _defaultKeys.Add("MaxLogCount", "10"); 41 | _defaultKeys.Add("MaxLogSize", "10240"); 42 | 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/HC_Reporting.licenseheader: -------------------------------------------------------------------------------- 1 | extensions: designer.cs generated.cs 2 | extensions: .cs .cpp .h 3 | // Copyright (c) 2021, Adam Congdon 4 | // MIT License 5 | extensions: .aspx .ascx 6 | <%-- 7 | Copyright (c) 2021, Adam Congdon 8 | MIT License 9 | --%> 10 | extensions: .xaml .xsl 11 | 15 | extensions: .vb 16 | 'Sample license text. 17 | extensions: .xml .config .xsd 18 | 21 | extensions: .txt .ps1 22 | # Copyright (c) 2021, Adam Congdon 23 | # MIT License -------------------------------------------------------------------------------- /vHC/HC_Reporting/HC_Reporting.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.002.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VeeamHealthCheck", "VeeamHealthCheck.csproj", "{6822F4C4-A438-41B0-B119-7F25CB18A26D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6822F4C4-A438-41B0-B119-7F25CB18A26D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6822F4C4-A438-41B0-B119-7F25CB18A26D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6822F4C4-A438-41B0-B119-7F25CB18A26D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6822F4C4-A438-41B0-B119-7F25CB18A26D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {0E43FCD0-69DE-4814-BEB4-A4509D0B29EB} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Health_Check_Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Health_Check_Icon.ico -------------------------------------------------------------------------------- /vHC/HC_Reporting/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "VeeamHealthCheck": { 4 | "commandName": "Project", 5 | "commandLineArgs": "/run", 6 | "remoteDebugEnabled": true, 7 | "authenticationMode": "Windows", 8 | "remoteDebugMachine": "vbr-11-latest:4026" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/VB365/Vb365ResFileBuilder.ps1: -------------------------------------------------------------------------------- 1 | #Write-Host(Get-Location) 2 | #$input = Read-Host("hit a key") 3 | #cd C:\Users\Administrator\Source\Repos\VeeamHub\veeam-healthcheck\vHC\HC_Reporting\Resources\Localization\VB365 4 | $loc = "C:\code\VeeamHub\veeam-healthcheck\vHC\HC_Reporting\Resources\Localization\VB365\" 5 | 6 | & 'C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\Launch-VsDevShell.ps1' 7 | start-sleep -Seconds 2 8 | 9 | cd $loc 10 | $outfile = $loc + "Vb365ResourceHandler.cs" 11 | 12 | $files = gci -Name "vb365_vhcres*.txt" 13 | foreach($f in $files){ 14 | ResGen.exe $f 15 | } 16 | 17 | $content = Get-Content -LiteralPath "vb365_vhcres.txt" 18 | 19 | 20 | echo $null | out-file $outfile 21 | echo $null | out-file pubstrings.txt 22 | 23 | "using System.Resources;`nnamespace VeeamHealthCheck.Resources.Localization.VB365`n{`n`nclass Vb365ResourceHandler`n{private static ResourceManager vb365res = new(`"VeeamHealthCheck.Resources.Localization.VB365.vb365_vhcres`", typeof(Vb365ResourceHandler).Assembly);`n" | out-file $outfile 24 | 25 | foreach($line in $content){ 26 | if(!$line.StartsWith("#")){ 27 | 28 | $split = $line.Split() 29 | if($split -ne $null){ 30 | 31 | if($split[0] -ne "#"){ 32 | $string = "public static string " + $split[0] + " = vb365res.GetString(`"" + $split[0] + "`");" 33 | 34 | #Write-Host($string) 35 | $string | Out-File -Append pubstrings.txt 36 | $string | Out-File -Append $outfile 37 | } 38 | } 39 | } 40 | } 41 | "}}" | Out-File -Append $outfile -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/VB365/Vb365ResourceHandler.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/VB365/Vb365ResourceHandler.cs -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/VB365/pubstrings.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/VB365/pubstrings.txt -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/VB365/vb365_vhcres.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/VB365/vb365_vhcres.resources -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/VbrLocalizationHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/VbrLocalizationHelper.cs -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/VbrResFileBuilder.ps1: -------------------------------------------------------------------------------- 1 | #cd C:\Users\cac89\Source\Repos\VeeamHub\veeam-healthcheck\vHC\HC_Reporting\Resources\Localization 2 | $loc = "A:\source\veeam-healthcheck\vHC\HC_Reporting\Resources\Localization\" 3 | 4 | & 'C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\Launch-VsDevShell.ps1' 5 | start-sleep -Seconds 2 6 | 7 | cd $loc 8 | $files = gci -Name "vhcres*.txt" 9 | foreach($f in $files){ 10 | ResGen.exe $f 11 | } 12 | 13 | $content = Get-Content -LiteralPath "vhcres.txt" 14 | 15 | $outFile = $loc + "VbrLocalizationHelper.cs" 16 | echo $null | out-file $outFile 17 | echo $null | out-file pubstrings.txt 18 | 19 | "using System.Resources;`nnamespace VeeamHealthCheck.Resources.Localization`n{`n`nclass VbrLocalizationHelper`n{private static ResourceManager m4 = new(`"VeeamHealthCheck.Resources.Localization.vhcres`", typeof(VbrLocalizationHelper).Assembly);`n" | out-file $outFile 20 | 21 | foreach($line in $content){ 22 | if(!$line.StartsWith("#")){ 23 | 24 | $split = $line.Split() 25 | if($split -ne $null){ 26 | 27 | if($split[0] -ne "#"){ 28 | $string = "public static string " + $split[0] + " = m4.GetString(`"" + $split[0] + "`");" 29 | 30 | #Write-Host($string) 31 | $string | Out-File -Append pubstrings.txt 32 | $string | out-file -Append $outFile 33 | } 34 | } 35 | } 36 | } 37 | "}}" | out-file -Append $outFile -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/publicStringGenerator.ps1: -------------------------------------------------------------------------------- 1 | $list = @("License Status","License Expiry","Support Expiry","License Type","Licensed To","License Contact","Licensed For","Licenses Used","Global Folder Exclusions","Global Ret. Exclusions","Log Retention","Notification Enabled","Notifify On","Automatic Updates?") 2 | $p = 0 3 | foreach($i in $list){ 4 | $new = $i.Replace('?', '') 5 | $new = $new.Replace(" ", '') 6 | $new = $new.Replace('-','') 7 | write-host ("[Index($p)]") 8 | write-host("public string $new{get;set;}") 9 | $p++ 10 | } -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/pubstrings.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/pubstrings.txt -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/vhcres.FR-FR.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/vhcres.FR-FR.resources -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/vhcres.FR-FR.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/vhcres.FR-FR.txt -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/vhcres.ja.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/vhcres.ja.resources -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/vhcres.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/vhcres.resources -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/vhcres.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/vhcres.txt -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/vhcres.zh-cn.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/vhcres.zh-cn.resources -------------------------------------------------------------------------------- /vHC/HC_Reporting/Resources/Localization/vhcres.zh-tw.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Resources/Localization/vhcres.zh-tw.resources -------------------------------------------------------------------------------- /vHC/HC_Reporting/Startup/CAdminCheck.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System.Security.Principal; 4 | 5 | namespace VeeamHealthCheck 6 | { 7 | public class CAdminCheck 8 | { 9 | public bool IsAdmin() 10 | { 11 | using (WindowsIdentity identity = WindowsIdentity.GetCurrent()) 12 | { 13 | WindowsPrincipal principal = new WindowsPrincipal(identity); 14 | bool IsAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); 15 | return IsAdmin; 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Startup/CReportModeSelector.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System.IO; 4 | using VeeamHealthCheck.Functions.Reporting.Html.VB365; 5 | using VeeamHealthCheck.Functions.Reporting.Html.VBR; 6 | using VeeamHealthCheck.Shared; 7 | using VeeamHealthCheck.Shared.Logging; 8 | 9 | namespace VeeamHealthCheck.Startup 10 | { 11 | internal class CReportModeSelector 12 | { 13 | private CLogger LOG = CGlobals.Logger; 14 | public CReportModeSelector() 15 | { 16 | } 17 | public int Run() 18 | { 19 | return FileChecker(); 20 | } 21 | public void Dispose() 22 | { 23 | 24 | } 25 | private int FileChecker() 26 | { 27 | LOG.Info("Checking output directories..", false); 28 | int res = 0; 29 | if (CGlobals.RunSecReport) 30 | StartSecurityReport(); 31 | if (!CGlobals.RunSecReport) 32 | { 33 | 34 | if (Directory.Exists(CVariables.vb365dir) && CGlobals.RunFullReport) 35 | StartM365Report(); 36 | if (Directory.Exists(CVariables.vbrDir) && CGlobals.RunFullReport) 37 | res = StartVbrReport(); 38 | } 39 | return res; 40 | } 41 | private int StartVbrReport() 42 | { 43 | LOG.Info("Starting B&R report generation", false); 44 | CHtmlCompiler html = new(); 45 | var res = html.RunFullVbrReport(); 46 | html.Dispose(); 47 | return res; 48 | } 49 | 50 | private void StartM365Report() 51 | { 52 | LOG.Info("Starting VB365 Report genration", false); 53 | CVb365HtmlCompiler compiler = new(); 54 | compiler.Dispose(); 55 | } 56 | private void StartSecurityReport() 57 | { 58 | LOG.Info("Starting Security Report generation", false); 59 | CHtmlCompiler html = new(); 60 | html.RunSecurityReport(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Startup/CVariables.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using VeeamHealthCheck.Shared; 4 | 5 | namespace VeeamHealthCheck 6 | { 7 | public class CVariables 8 | { 9 | public static readonly string outDir = @"C:\temp\vHC"; 10 | public static string safeDir = @"C:\temp\vHC\Anonymous"; 11 | public static string unsafeDir = @"C:\temp\vHC\Original"; 12 | public static string _vb365Dir = "\\VB365"; 13 | public static string _vbrDir = "\\VBR"; 14 | public static string _safeSuffix = @"\vHC-AnonymousReport"; 15 | public static string _unsafeSuffix = @"\vHC-Report"; 16 | public static string desiredDir { get { return CGlobals._desiredPath; } } 17 | public string unSafeDir2() 18 | { 19 | return unsafeDir; 20 | } 21 | public static string vb365dir 22 | { 23 | get 24 | { 25 | return unsafeDir + _vb365Dir; 26 | } 27 | } 28 | public static string vbrDir 29 | { 30 | get { return unsafeDir + _vbrDir; } 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Startup/EntryPoint.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Adam Congdon 2 | // MIT License 3 | using System; 4 | using System.Runtime; 5 | using VeeamHealthCheck.Shared; 6 | 7 | namespace VeeamHealthCheck.Startup 8 | { 9 | public class EntryPoint 10 | { 11 | private static CClientFunctions _functions = new(); 12 | [STAThread] 13 | public static int Main(string[] args) 14 | { 15 | CGlobals.Logger.Debug("Starting the application"); 16 | CGlobals.Logger.Debug("The arguments are: " + string.Join(" ", args)); 17 | 18 | try 19 | { 20 | CArgsParser ap = new(args); 21 | var res = ap.ParseArgs(); 22 | CGlobals.Logger.Info("The result is: " + res, true); 23 | return 0; 24 | } 25 | catch (Exception ex) { 26 | CGlobals.Logger.Error(ex.Message); 27 | CGlobals.Logger.Error("The result is: " + 1, true); 28 | return 1; 29 | } 30 | 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Tools/Scripts/HealthCheck/VBR/Get-NasInfo.ps1: -------------------------------------------------------------------------------- 1 | # VMC log path is hardcoded for now. If logs are sent elsewhere, please adjust accordingly. 2 | $logsPath = "C:\ProgramData\Veeam\Backup\Utils\VMC.log" 3 | 4 | # section identifiers 5 | $unstrucStart = "=====UNSTRUCTURED DATA====" 6 | $nasStart = "=====NAS INFRASTRUCTURE====" 7 | $sectionEnd = "========" 8 | 9 | #output files, feel free to rename and relocate 10 | $csvFilePath = 'Share Breakdown.csv' 11 | $csv2FilePath = 'output2.csv' 12 | 13 | #get file info and set empty containers. 14 | $content = Get-Content $logsPath 15 | $sections = @() 16 | $currentSection = @() 17 | $capturing = $false 18 | 19 | foreach($line in $content){ 20 | if(-not $capturing -and $line -match $unstrucStart){ 21 | $capturing = $true 22 | $currentSection = @() 23 | #$currentSection += $line.Remove(0,50) 24 | } 25 | elseif(-not $capturing -and $line -match $nasStart){ 26 | $capturing = $true 27 | $currentSection = @() 28 | #$currentSection += $line.Remove(0,50) 29 | } 30 | elseif($capturing){ 31 | if($line -match $sectionEnd){ 32 | $capturing = $false 33 | $sections += ,($currentSection) 34 | $currentSection = @() 35 | } 36 | else{ 37 | if( -not $line -match "[VmcStats]"){ 38 | $currentSection += $line.Remove(0,49) 39 | } 40 | } 41 | } 42 | } 43 | 44 | # Here we set a new list to only contain the final data section from the log: 45 | $dataLines = $sections[$sections.Count-1] 46 | $data = @() 47 | 48 | # search each line, looking for these strings: TotalObjectStorageSize, NasBackupSourceShareStats, TotalShareSize. Group each into their own list 49 | $totalObjectStorageSize = @() 50 | $nasBackupSourceShareStats = @() 51 | $totalShareSize = @() 52 | $dataLines | ForEach-Object { 53 | if($_ -match "TotalObjectStorageSize"){ 54 | $totalObjectStorageSize += $_ 55 | } 56 | elseif($_ -match "NasBackupSourceShareStats"){ 57 | $nasBackupSourceShareStats += $_ 58 | } 59 | elseif($_ -match "TotalShareSize"){ 60 | $totalShareSize += $_ 61 | } 62 | } 63 | 64 | 65 | # converting to CSV data based on property for readability 66 | $csvData = $totalObjectStorageSize | ForEach-Object { 67 | $properties = @{} 68 | # Split using comma and create key-value pairs 69 | $_.Trim() -split ', ' | ForEach-Object { 70 | $key, $value = $_.Split(':', 2).Trim() 71 | $properties[$key] = $value 72 | } 73 | # Output as a PSCustomObject 74 | [PSCustomObject]$properties 75 | } 76 | # export to csv 77 | $csvData | Export-Csv -Path "C:\Temp\vHC\Original\VBR\localhost_NasObjectSourceStorageSize.csv" -NoTypeInformation 78 | 79 | #convert $nasBackupSourceShareStats to CSV and export to new csv file 80 | $csvData2 = $nasBackupSourceShareStats | ForEach-Object { 81 | $properties = @{} 82 | # Split using comma and create key-value pairs 83 | $_.Trim() -split ', ' | ForEach-Object { 84 | $key, $value = $_.Split(':', 2).Trim() 85 | $properties[$key] = $value 86 | } 87 | # Output as a PSCustomObject 88 | [PSCustomObject]$properties 89 | } 90 | # export to csv 91 | $csvData2 | Export-Csv -Path "C:\Temp\vHC\Original\VBR\localhost_NasFileData.csv" -NoTypeInformation 92 | 93 | #convert $totalShareSize to CSV and export to new csv file 94 | $csvData3 = $totalShareSize | ForEach-Object { 95 | $properties = @{} 96 | # Split using comma and create key-value pairs 97 | $_.Trim() -split ', ' | ForEach-Object { 98 | $key, $value = $_.Split(':', 2).Trim() 99 | $properties[$key] = $value 100 | } 101 | # Output as a PSCustomObject 102 | [PSCustomObject]$properties 103 | } 104 | # export to csv 105 | $csvData3 | Export-Csv -Path "C:\Temp\vHC\Original\VBR\localhost_NasSharesize.csv" -NoTypeInformation -------------------------------------------------------------------------------- /vHC/HC_Reporting/Tools/Scripts/HotfixDetection/Collect-VBRLogs.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version 4 2 | #Requires -RunAsAdministrator 3 | <# 4 | .Synopsis 5 | Simple Veeam report to dump server & job configurations 6 | .Notes 7 | Version: 0.2 8 | Original Author: Joe Houghes 9 | Butchered by: Adam Congdon 10 | Modified Date: 4 - 24 - 2020 11 | .EXAMPLE 12 | Get - VBRConfig - VBRServer ausveeambr - ReportPath C:\Temp\VBROutput 13 | Get-VBRconfig -VBRSERVER localhost -ReportPath C:\HealthCheck\output 14 | #> 15 | param( 16 | # VBRServer 17 | #[Parameter(Mandatory)] 18 | #[string]$VBRServer 19 | [Parameter(Mandatory)] 20 | [string]$Server, 21 | [Parameter(Mandatory)] 22 | [string]$ReportPath, 23 | [Parameter()] 24 | [DateTime]$To, 25 | [Parameter()] 26 | [DateTime]$From, 27 | [Parameter()] 28 | [int]$LastDays 29 | # [int]$ReportingIntervalDays = -1 30 | ) 31 | 32 | # version get 33 | $corePath = Get-ItemProperty -Path "HKLM:\Software\Veeam\Veeam Backup and Replication\" -Name "CorePath" 34 | $depDLLPath = Join-Path -Path $corePath.CorePath -ChildPath "Packages\VeeamDeploymentDll.dll" -Resolve 35 | $file = Get-Item -Path $depDLLPath 36 | $version = $file.VersionInfo.ProductVersion 37 | 38 | 39 | $s = Get-VBRServer -name $Server 40 | 41 | if($version.StartsWith("12")){ 42 | Export-VBRLogs -Server $s -FolderPath $ReportPath -LastDays 1 43 | } 44 | else{ 45 | Export-VBRLogs -Server $s -FolderPath $ReportPath -From (Get-Date).AddDays(-1) -to (get-date) 46 | } 47 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Tools/Scripts/HotfixDetection/DumpManagedServerToText.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version 4 2 | #Requires -RunAsAdministrator 3 | <# 4 | .Synopsis 5 | Simple Veeam report to dump server & job configurations 6 | .Notes 7 | Version: 0.2 8 | Original Author: Joe Houghes 9 | Butchered by: Adam Congdon 10 | Modified Date: 4 - 24 - 2020 11 | .EXAMPLE 12 | Get - VBRConfig - VBRServer ausveeambr - ReportPath C:\Temp\VBROutput 13 | Get-VBRconfig -VBRSERVER localhost -ReportPath C:\HealthCheck\output 14 | #> 15 | param( 16 | # VBRServer 17 | [Parameter(Mandatory)] 18 | [string]$VBRServer 19 | # [Parameter(Mandatory)] 20 | # [string]$ReportPath, 21 | # [Parameter()] 22 | # [DateTime]$To, 23 | # [Parameter()] 24 | # [DateTime]$From, 25 | # [Parameter()] 26 | # [int]$LastDays 27 | # [int]$ReportingIntervalDays = -1 28 | ) 29 | 30 | # version get 31 | $corePath = Get-ItemProperty -Path "HKLM:\Software\Veeam\Veeam Backup and Replication\" -Name "CorePath" 32 | $depDLLPath = Join-Path -Path $corePath.CorePath -ChildPath "Packages\VeeamDeploymentDll.dll" -Resolve 33 | $file = Get-Item -Path $depDLLPath 34 | $version = $file.VersionInfo.ProductVersion 35 | 36 | $output = "serverlist.txt" 37 | Connect-VBRServer -Server $VBRServer 38 | $servers = Get-VBRServer | Where-Object {($_.type -ne 'CifsShare') -and ($_.type -ne 'VC') -and ($_.type -ne "ESXi") } 39 | $servers.Name | Add-Content -Path $output 40 | -------------------------------------------------------------------------------- /vHC/HC_Reporting/Tools/Veeam.Hotfix.Detector.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeeamHub/veeam-healthcheck/c73fe4dea69319a0fc1004c7da64662fc7517240/vHC/HC_Reporting/Tools/Veeam.Hotfix.Detector.zip -------------------------------------------------------------------------------- /vHC/HC_Reporting/Tools/build/BuildCopy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source path from build output 4 | SOURCE="/Users/adam.congdon/code/veeam-healthcheck/vHC/HC_Reporting/bin/Debug/net8.0-windows7.0/win-x64/" 5 | # Destination (mounted SMB share) 6 | DEST="$HOME/vhc_mount/veeam-healthcheck/vHC/HC_Reporting/bin/" 7 | # SMB details 8 | SMB_SERVER="192.168.20.114" 9 | SMB_SHARE="vhc" 10 | SMB_USER="administrator" 11 | SMB_PASS="${SMB_PASS:-}" # Use an environment variable for the password 12 | 13 | # Mount point 14 | MOUNT_POINT="$HOME/vhc_mount" 15 | 16 | # Ensure mount point exists as a directory 17 | if [ ! -d "$MOUNT_POINT" ]; then 18 | mkdir -p "$MOUNT_POINT" || { 19 | echo "Error: Cannot create mount point $MOUNT_POINT" 20 | exit 1 21 | } 22 | fi 23 | 24 | # Check if the SMB share is mounted; mount it if not 25 | if ! mount | grep -q "$MOUNT_POINT"; then 26 | mount -t smbfs "//$SMB_USER:$SMB_PASS@$SMB_SERVER/$SMB_SHARE" "$MOUNT_POINT" 27 | if [ $? -ne 0 ]; then 28 | echo "Error: Failed to mount SMB share at $MOUNT_POINT" 29 | exit 1 30 | fi 31 | echo "SMB share mounted at $MOUNT_POINT" 32 | fi 33 | 34 | # Ensure destination directory exists 35 | mkdir -p "$DEST" || { 36 | echo "Error: Cannot create destination directory $DEST" 37 | exit 1 38 | } 39 | 40 | # Use rsync to copy files 41 | rsync -avh --progress "$SOURCE" "$DEST" 42 | if [ $? -ne 0 ]; then 43 | echo "Error: rsync failed" 44 | exit 1 45 | fi 46 | 47 | echo "Files successfully copied to $DEST" -------------------------------------------------------------------------------- /vHC/HC_Reporting/Tools/build/BuildVb365Localization.bat: -------------------------------------------------------------------------------- 1 | PowerShell.exe -File C:\code\VeeamHub\veeam-healthcheck\vHC\HC_Reporting\Resources\Localization\VB365\Vb365ResFileBuilder.ps1 2 | EXIT 0 -------------------------------------------------------------------------------- /vHC/HC_Reporting/Tools/build/BuildVbrLocalization.bat: -------------------------------------------------------------------------------- 1 | PowerShell.exe -File C:\code\VeeamHub\veeam-healthcheck\vHC\HC_Reporting\Resources\Localization\VbrResFileBuilder.ps1 2 | PowerShell.exe -File C:\code\VeeamHub\veeam-healthcheck\vHC\HC_Reporting\Resources\Localization\VB365\Vb365ResFileBuilder.ps1 3 | EXIT 0 -------------------------------------------------------------------------------- /vHC/HC_Reporting/increment_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Path to your .csproj file (adjust if needed) 4 | CSPROJ_FILE="/Users/adam.congdon/code/veeam-healthcheck/vHC/HC_Reporting/VeeamHealthCheck.csproj" 5 | 6 | # Extract the current version from the .csproj file 7 | # Extract the current version from the .csproj file using sed 8 | CURRENT_VERSION=$(sed -n 's/.*\(.*\)<\/AssemblyVersion>.*/\1/p' "$CSPROJ_FILE") 9 | echo "Current version: $CURRENT_VERSION" 10 | # Split the version into an array (e.g., "1.0.0" -> [1, 0, 0]) 11 | IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION" 12 | 13 | # Increment the patch version (last number) 14 | ((VERSION_PARTS[2]++)) 15 | 16 | # Join the parts back together 17 | NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}" 18 | 19 | # Replace the old version with the new one in the .csproj file 20 | sed -i '' "s|$CURRENT_VERSION|$NEW_VERSION|" "$CSPROJ_FILE" 21 | 22 | echo "Version updated to $NEW_VERSION" -------------------------------------------------------------------------------- /vHC/VhcXTests/CArgsParserTEST.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Collections.Generic; 3 | //using System.Linq; 4 | //using System.Text; 5 | //using System.Threading.Tasks; 6 | //using VeeamHealthCheck.Startup; 7 | 8 | //namespace VhcXTests 9 | //{ 10 | // public class CArgsParserTEST 11 | // { 12 | // [Fact] 13 | // public void ParseArgs_Default_Success() 14 | // { 15 | // } 16 | // } 17 | //} 18 | -------------------------------------------------------------------------------- /vHC/VhcXTests/Common/Logging/CLogger_TEST.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using VeeamHealthCheck.Shared.Logging; 7 | 8 | namespace VhcXTests.Common.Logging 9 | { 10 | public class CLogger_TEST 11 | { 12 | public CLogger_TEST() 13 | { 14 | 15 | } 16 | 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vHC/VhcXTests/EntryPointTEST.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using VeeamHealthCheck.Startup; 7 | 8 | namespace VhcXTests 9 | { 10 | public class EntryPointTEST 11 | { 12 | //[Fact] 13 | //public void Main_WithArgs_Success() 14 | //{ 15 | // string[] args = new string[1] { "run" }; 16 | // var result = EntryPoint.Main(args); 17 | 18 | // Assert.Equal(1, result); 19 | 20 | //} 21 | //[Fact] 22 | //public void Main_WithArgs_Fail() 23 | //{ 24 | // string[] args = new string[1] { "rum" }; 25 | // var result = EntryPoint.Main(args); 26 | 27 | // Assert.Equal(0, result); 28 | //} 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vHC/VhcXTests/Functions/Reporting/DataTypes/CDataTypesParserTEST.cs: -------------------------------------------------------------------------------- 1 | //using CsvHelper; 2 | //using System; 3 | //using System.Collections.Generic; 4 | //using System.Linq; 5 | //using System.Text; 6 | //using System.Threading.Tasks; 7 | //using VeeamHealthCheck.Functions.Reporting.DataTypes; 8 | //using VeeamHealthCheck.Functions.Reporting.CsvHandlers; 9 | //using VeeamHealthCheck.Functions.Reporting.DataTypes; 10 | //using Moq; 11 | 12 | //namespace VhcXTests.Functions.Reporting.DataTypes 13 | //{ 14 | // public class CDataTypesParserTEST 15 | // { 16 | // //[Fact] 17 | // //public void JobInfo_GetDynamicBjobs_Success() 18 | // //{ 19 | // // var parser = new CCsvParser(); 20 | // // var bjobs = parser.GetDynamicBjobs(); 21 | 22 | // // Assert.NotNull(bjobs); 23 | // //} 24 | // [Fact] 25 | // public void JobInfo_GetDynamicBjobs_Fail() 26 | // { 27 | 28 | // var parser = new CCsvParser(); 29 | // IEnumerable bjobs = null; 30 | // Assert.Null(bjobs); 31 | // } 32 | 33 | // //[Fact] 34 | // //public void SobrInfo_Null_Success() 35 | // //{ 36 | // // CDataTypesParser p = new(); 37 | // // var result = p.SobrInfo; 38 | 39 | // // Assert.NotNull(result); 40 | // //} 41 | // //[Fact] 42 | // //public void SobrInfo_Null_Fail() 43 | // //{ 44 | // // CDataTypesParser p = new(); 45 | // // var result = p.SobrInfo; 46 | 47 | // // Assert.Null(result); 48 | // //} 49 | // //[Fact] 50 | // //public void SobrInfo_List_Success() 51 | // //{ 52 | // // var parser = new Mock(); 53 | // // parser.Setup(x => x.SobrInfo).Returns(new List()); 54 | 55 | // // Assert.NotNull(parser); 56 | // //} 57 | // [Fact] 58 | // public void SobrInfo_EmptyList_Fail() 59 | // { 60 | 61 | // } 62 | 63 | 64 | // [Fact] 65 | // public void SobrCsvResults_ReturnList_Success() 66 | // { 67 | // var parser = new Mock(); 68 | 69 | // } 70 | // } 71 | //} 72 | -------------------------------------------------------------------------------- /vHC/VhcXTests/Functions/Reporting/Html/CHtmlExporterTEST.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Collections.Generic; 3 | //using System.Linq; 4 | //using System.Text; 5 | //using System.Threading.Tasks; 6 | //using VeeamHealthCheck.Functions.Reporting.Html; 7 | 8 | //namespace VhcXTests.Functions.Reporting.Html 9 | //{ 10 | // public class CHtmlExporterTEST 11 | // { 12 | // [Fact] 13 | // public void ExportVb365_Result_Positive() 14 | // { 15 | // Thread.Sleep(10); 16 | // CHtmlExporter e = new("TestSystem"); 17 | // int res = e.ExportVb365Html("testHTML"); 18 | 19 | // Assert.Equal(0, res); 20 | 21 | // } 22 | // [Fact] 23 | // public void ExportVbr_Scrub_Positive() 24 | // { 25 | // Thread.Sleep(200); 26 | // CHtmlExporter e = new("TestSystem"); 27 | // var res = e.ExportVbrHtml("fakeString", true); 28 | 29 | // Assert.Equal(0, res); 30 | // } 31 | // [Fact] 32 | // public void ExportVbr_NoScrub_Positive() 33 | // { 34 | // Thread.Sleep(300); 35 | // CHtmlExporter e = new("TestSystem"); 36 | // var res = e.ExportVbrHtml("fakeString", false); 37 | 38 | // Assert.Equal(0, res); 39 | // } 40 | // //[Fact] 41 | // //public void ExportSecurity_Scrub_Positive() 42 | // //{ 43 | // // CHtmlExporter e = new("TestSystem"); 44 | // // var res = e.ExportVbrSecurityHtml("fakeString", true); 45 | 46 | // // Assert.Equal(0, res); 47 | // //} 48 | 49 | // //[Fact] 50 | // //public void OpenExplorerIfEnabled_True_Success() 51 | // //{ 52 | // // CHtmlExporter e = new("TestServer"); 53 | // // var res = e.OpenHtmlIfEnabled(true); 54 | 55 | // // Assert.Equal(0, res); 56 | // //} 57 | // [Fact] 58 | // public void OpenExplorerIfEnabled_False_Success() 59 | // { 60 | // CHtmlExporter e = new("TestServer"); 61 | // var res = e.OpenHtmlIfEnabled(false); 62 | 63 | // Assert.Equal(1, res); 64 | // } 65 | // } 66 | //} 67 | -------------------------------------------------------------------------------- /vHC/VhcXTests/Functions/Reporting/Html/Shared/CObjectHelpersTEST.cs: -------------------------------------------------------------------------------- 1 | //using Moq; 2 | //using VeeamHealthCheck.Functions.Reporting.Html.Shared; 3 | //using VeeamHealthCheck.Functions.Reporting.CsvHandlers; 4 | //using VeeamHealthCheck.Functions.Collection.DB; 5 | 6 | //namespace VhcXTests.Functions.Reporting.Html.Shared 7 | //{ 8 | // public class CObjectHelpersTEST 9 | // { 10 | // [Fact] 11 | // public void ParseBool_ValidString_True() 12 | // { 13 | // var result = CObjectHelpers.ParseBool("true"); 14 | 15 | // Assert.True(result); 16 | 17 | // } 18 | // [Fact] 19 | // public void ParseBool_NotValidString_True() 20 | // { 21 | // var result = CObjectHelpers.ParseBool("truse"); 22 | 23 | // Assert.False(result); 24 | 25 | // } 26 | // [Fact] 27 | // public void CBJobCsv_String_Success() 28 | // { 29 | // //var result = Mock(); 30 | // CBjobCsv c = new(); 31 | 32 | // c.JobType = "test"; 33 | // c.Name = "testName"; 34 | // c.RepositoryId = "id"; 35 | // c.actualSize = "42"; 36 | 37 | // Assert.Equal("test", c.JobType); 38 | // Assert.Equal("testName", c.Name); 39 | // Assert.Equal("id", c.RepositoryId); 40 | // Assert.Equal("42", c.actualSize); 41 | // } 42 | 43 | // [Fact] 44 | // public void CRegReader_DbString_Null() 45 | // { 46 | // var reader = new CRegReader(); 47 | // var result = reader.DbString; 48 | 49 | // Assert.Equal(null, result); 50 | // } 51 | // [Fact] 52 | // public void CRegReader_HostString_Null() 53 | // { 54 | // var reader = new CRegReader(); 55 | // var result = reader.HostString; 56 | 57 | // Assert.Equal(null, result); 58 | // } 59 | 60 | // } 61 | //} 62 | -------------------------------------------------------------------------------- /vHC/VhcXTests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | //namespace VhcXTests 2 | //{ 3 | // public class UnitTest1 4 | // { 5 | // [Fact] 6 | // public void Test1() 7 | // { 8 | // Assert.True(true); 9 | // } 10 | // } 11 | //} -------------------------------------------------------------------------------- /vHC/VhcXTests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /vHC/VhcXTests/VhcXTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0-windows7.0 5 | enable 6 | enable 7 | 8 | false 9 | true 10 | 1.0.0.338 11 | 1.0.0.338 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | all 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | --------------------------------------------------------------------------------