In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
When Douzi logged on to Vsphere VCenter today, I inadvertently found an alarm message about DataStore. Some DataStore uses more than 90% of its space, so it is necessary to clear the Snapshot of SAN Volume. This is a common problem in operation and maintenance, so by the way, write a script in PowerShell and check the emails regularly.
The script itself is easy, but I want him to be as beautiful as possible.
I wrote a blog post that can customize the style of sytle http://beanxyz.blog.51cto.com/5570417/1786712, but now it seems a little troublesome. I still think it would be nice to find a good-looking ready-made css file that can be called directly.
I searched table for ready-made css templates on the Internet, and randomly found a https://codepen.io/anon/pen/vJmLWL, which looked all right.
Download his css.
Download the css file and save it in the C:\ tmp directory
@ import url (https://fonts.googleapis.com/css?family=Roboto:400,500,700,300,100);body {background-color: # 3e94EC; font-family: "Roboto", helvetica, arial, sans-serif; font-size: 16px; font-weight: 400; text-rendering: optimizeLegibility;} div.table-title {display: block; margin: auto; max-width: 600px; padding:5px; width: 100%;} .table-title h4 {color: # fafafa; font-size: 30px Font-weight: 400; font-style:normal; font-family: "Roboto", helvetica, arial, sans-serif; text-shadow:-1px-1px 1px rgba (0,0,0,0.1); text-transform:uppercase;} / * * Table Styles * * / .table-fill {background: white; border-radius:3px; border-collapse: collapse; height: 200px; margin: auto; max-width: 600px; padding:5px; width: 100% Box-shadow: 0 5px 10px rgba (0,0,0,0.1); animation: float 5s infinite;} th {color:#D5DDE5;; background:#1b1e24; border-bottom:4px solid # 9ea7af; border-right: 1px solid # 343a45; font-size:23px; font-weight: 100; padding:24px; text-align:left; text-shadow: 0 1px 1px rgba (0,0,0,0.1); vertical-align:middle } th:first-child {border-top-left-radius:3px;} th:last-child {border-top-right-radius:3px; border-right:none;} tr {border-top: 1px solid # C1C3D1; border-bottom-: 1px solid # C1C3D1; color:#666B85; font-size:16px; font-weight:normal; text-shadow: 0 1px 1px rgba (256,256,256,0.1);} tr:hover td {background:#4E5066; color:#FFFFFF Border-top: 1px solid # 22262e; border-bottom: 1px solid # 22262e;} tr:first-child {border-top:none;} tr:last-child {border-bottom:none;} tr:nth-child (odd) td {background:#EBEBEB;} tr:nth-child (odd): hover td {background:#4E5066;} tr:last-child td:first-child {border-bottom-left-radius:3px;} tr:last-child td:last-child {border-bottom-right-radius:3px } td {background:#FFFFFF; padding:20px; text-align:left; vertical-align:middle; font-weight:300; font-size:18px; text-shadow:-1px-1px 1px rgba (0,0,0,0.1); border-right: 1px solid # C1C3D1;} td:last-child {border-right: 0px;} th.text-left {text-align:left;} th.text-center {text-align: center;} th.text-right {text-align: right } td.text-left {text-align: left;} td.text-center {text-align: center;} td.text-right {text-align: right;}
The following is the official script, Set-CellColor is also someone else wrote ready-made, I directly used, the main function is to change the html file table grid color according to conditions, such as a value greater than the alarm line marked as red, and so on. Load Vsphere SnapIn in the middle of the script, query the status of datastore, finally convert the result to html, and send mail through Office365
# modify the settings of the color block Function Set-CellColor {[CmdletBinding ()] Param ([Parameter (Mandatory,Position=0)] [string] $Property, [Parameter (Mandatory,Position=1)] [string] $Color, [Parameter (Mandatory,ValueFromPipeline)] [Object []] $InputObject, [Parameter (Mandatory)] [string] $Filter [switch] $Row) Begin {Write-Verbose "$(Get-Date): Function Set-CellColor begins" If ($Filter) {If ($Filter.ToUpper (). IndexOf ($Property.ToUpper ()-ge 0) {$Filter = $Filter.ToUpper () .Replace ($Property.ToUpper ()) "`$Value") Try {[scriptblock] $Filter = [scriptblock]:: Create ($Filter)} Catch {Write-Warning "$(Get-Date):"$Filter"caused an error, stopping script!" Write-Warning $Error [0] Exit} Else {Write-Warning "Could not locate $Property in the Filter, which is required. Filter: $Filter "Exit}} Process {ForEach ($Line in $InputObject) {If ($Line.IndexOf (" (. *?)'- AllMatches $Index = 0 ForEach ($Match in $Search.Matches) {If ($Match.Groups [1] .value-eq $Property) {Break} $Index + +} If ($Index-eq $Search.Matches.Count) {Write-Warning "$(Get-Date): Unable to locate property: $Property in table header" Exit} Write- Verbose "$(Get-Date): $Property column found at index: $Index"} If ($Line-match "(. *?)'- AllMatches $Value = $Search.Matches [$Index] .groups [1] .value-as [double] If (- not $Value) {$Value = $Search.Matches [$Index] .groups [1] .value} If (Invoke-Command $Filter) {If ($Row) {Write-Verbose "$(Get-Date): Criteria met! Changing row to $Color... " If ($Line-match "") {$Line = $Line-replace "
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.