-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull request includes various changes to improve the documentation, scripts, and workflows of the project. The most important changes include adding a new version to the CHANGELOG.md file, modifying the check_smartarray.sh script to improve its functionality, and adding new workflows for linting shell scripts and formatting Markdown files. Documentation and versioning changes: README.md: Added badges for CodeFactor, License, Latest Release, Contributors, Issues, and build status to the README.md file. Script and workflow improvements: check_smartarray.sh: Modified the check_smartarray.sh file to unset variables, add double quotes around email addresses, and change conditions in the case statement. [1] [2] [3] .github/workflows/lint-shell.yml: Added a new workflow called "lint-shell" that runs ShellCheck on the check_smartarray.sh file. .github/workflows/lint-markdown.yml: Added a new workflow called "lint-markdown" that uses Prettier to format changed Markdown files.
- Loading branch information
Showing
5 changed files
with
129 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
on: | ||
pull_request: | ||
|
||
name: lint-markdown | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v40 | ||
with: | ||
files_yaml: | | ||
markdown: | ||
- '**.md' | ||
- name: Prettify code | ||
if: steps.changed-files.outputs.markdown_any_changed == 'true' | ||
uses: creyD/prettier_action@v4.3 | ||
with: | ||
prettier_options: --write ${{ steps.changed-files.outputs.markdown_all_changed_files }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
on: | ||
pull_request: | ||
|
||
name: lint-shell | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
sh: | ||
name: sh-noexec-verify | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ShellCheck | ||
run: sh -n check_smartarray.sh | ||
shellcheck: | ||
name: shellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ShellCheck | ||
uses: ludeeus/action-shellcheck@2.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,86 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [1.3.0] - 2007-01-13 | ||
|
||
### Added | ||
|
||
- Initial public release | ||
|
||
## [1.3.1] - 2007-01-19 | ||
|
||
### Changed | ||
|
||
- Using tr to replace the string-output from camcontrol, for a more human-readable script, no changes in functionality. | ||
|
||
## [1.4.0] - 2007-02-08 | ||
|
||
### Changed | ||
|
||
- If a volume didn't have a known state, it just wouldn't show that volume, it now exits with errorcode3 and outputs as "unknown state" | ||
|
||
## [1.4.1] - 2007-02-14 | ||
|
||
### Changed | ||
|
||
- Patch by Christoph Schug applied to replace two (cut) systemcalls with one (sed) when getting DEVICESTRING. | ||
- Added quotes in various places for consistency | ||
- Don't set state to unknown if state is already critical (for code added in 1.4) | ||
- unset $ERR before doing anything to avoid problems if the variable is already set | ||
|
||
## [1.4.2] - 2007-02-27 | ||
|
||
### Changed | ||
|
||
- The nagios web interface would only show one RAID volume, it seems nagios blocks "|" in the input and throws everything after that away. | ||
- Changed the "|" to a "/" in output | ||
- Thanks to Kai Gallasch for reporting this | ||
## [1.4.3] - 2007-03-23 | ||
|
||
## [1.4.3] - 2007-03-23 | ||
|
||
### Changed | ||
|
||
- Changed tr A-Z a-z to tr [:upper:] [:lower:] to prevent problems with various locales. | ||
- Thanks to Oliver Fromme for reporting this | ||
|
||
## [1.4.4] - 2007-04-20 | ||
|
||
### Added | ||
|
||
- Added online expansion | ||
- Thanks to Mikael Antonsen for reporting this | ||
|
||
## [1.4.5] - 2007-10-08 | ||
|
||
### Changed | ||
|
||
- Problems with status of ADG (Advanced Data Guarding) Volumes fixed. | ||
- Thanks to Peter Larsen for reporting this | ||
|
||
## [1.5.0] - 2014-06-25 | ||
|
||
### Added | ||
|
||
- Can now email an address of choice, just use email address(es) as arguments to shellscript | ||
|
||
### Changed | ||
|
||
- check if camcontrol binary exists on system before running script | ||
|
||
## [1.6.0] - 2014-11-18 | ||
|
||
### Changed | ||
|
||
- HP Finally changed the SCSI output of their latest smart array controllers, updated script to be compatible with both versions | ||
- Thanks to Paul Yates for reporting this and providing sample output | ||
|
||
## [1.7.0] - 2014-11-19 | ||
|
||
### Added | ||
|
||
- Added support for FreeBSD 10.1 and later | ||
- Thanks to Marc Peters for reporting this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,43 @@ | ||
# monitor HP Smart Array from NRPE / cron for FreeBSD | ||
|
||
[![CodeFactor](https://www.codefactor.io/repository/github/klintrup/check_smartarray/badge)](https://www.codefactor.io/repository/github/klintrup/check_smartarray) | ||
[![License Apache 2.0](https://img.shields.io/github/license/Klintrup/check_smartarray)](https://github.com/Klintrup/check_smartarray/blob/main/LICENSE) | ||
[![Latest Release](https://img.shields.io/github/v/release/Klintrup/check_smartarray)](https://github.com/Klintrup/check_smartarray/releases) | ||
[![Contributors](https://img.shields.io/github/contributors-anon/Klintrup/check_smartarray)](https://github.com/Klintrup/check_smartarray/graphs/contributors) | ||
[![Issues](https://img.shields.io/github/issues/Klintrup/check_smartarray)](https://github.com/Klintrup/check_smartarray/issues) | ||
[![build](https://img.shields.io/github/actions/workflow/status/Klintrup/check_smartarray/lint-shell.yml)](https://github.com/Klintrup/check_smartarray/actions/workflows/lint-shell.yml) | ||
|
||
## Synopsis | ||
|
||
I wrote this little check-script for nrpe/nagios to get the status of various raids in a box, and output the failed volumes if any such exist. | ||
|
||
## Syntax | ||
``$path/check_smartarray.sh [email] [email]`` | ||
|
||
`$path/check_smartarray.sh [email] [email]` | ||
|
||
If no arguments are specified, the script will assume its run for NRPE. | ||
If one or more email addresses are specified, the script will send an email in case an array reports an error. | ||
|
||
## Output Examples | ||
| output | description | | ||
|--|--| | ||
| ok | The device is reported as ok by the smart array controller | | ||
| DEGRADED | The RAID volume is degraded, it's still working but without the safety of RAID, and in some cases with severe performance loss. | | ||
| rebuilding | The RAID is rebuilding, will return to OK when done | | ||
| expanding | The RAID is expanding, will return to OK when done | | ||
|
||
| output | description | | ||
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| ok | The device is reported as ok by the smart array controller | | ||
| DEGRADED | The RAID volume is degraded, it's still working but without the safety of RAID, and in some cases with severe performance loss. | | ||
| rebuilding | The RAID is rebuilding, will return to OK when done | | ||
| expanding | The RAID is expanding, will return to OK when done | | ||
| ready for recovery | The RAID is ready for recovery, but not recovering. This can happen if automatic recovery is disabled, and on some smaller versions of the Smart Array Controllers where only one RAID volume can be rebuild at a time | | ||
| unknown state | Volume is in an unknown state. Please submit a bug report so I can udate the script, include the following output. ``camcontrol devlist``, ``camcontrol inquiry da0 -D`` - run the inquiry for every volume on the system. | | ||
| unknown state | Volume is in an unknown state. Please submit a bug report so I can udate the script, include the following output. `camcontrol devlist`, `camcontrol inquiry da0 -D` - run the inquiry for every volume on the system. | | ||
|
||
# Compability | ||
|
||
Should work on all smartarray controllers though - if you test on another (working or not) controller, I would like to know, please mail me on soren at klintrup.dk. | ||
|
||
I have tested the script on the following controllers | ||
|
||
* HP Smart Array 6i | ||
* HP Smart Array 5i | ||
* HP Smart Array P400 | ||
* HP Smart Array P410 | ||
* HP Smart Array P420 | ||
* HP Smart Array P800 | ||
- HP Smart Array 6i | ||
- HP Smart Array 5i | ||
- HP Smart Array P400 | ||
- HP Smart Array P410 | ||
- HP Smart Array P420 | ||
- HP Smart Array P800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters