Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit667cde3

Browse files
committed
Adds support for IfW 1.9.0
1 parent17351d7 commit667cde3

9 files changed

+77
-31
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<#
2+
Icinga for Windows Component compilation file.
3+
Will be overwritten to defaults with every update and contains
4+
all code pre-compiled for faster execution and for providing
5+
private/public commands.
6+
7+
Fetches the current module and file location, reads all .psm1 files and compiles them into one large environment
8+
#>
9+
if ($null-eq (Get-Command-Name'Write-IcingaForWindowsComponentCompilationFile'-ErrorAction SilentlyContinue)) {
10+
Write-Host'['-NoNewline;
11+
Write-Host'Error'-ForegroundColor Red-NoNewline;
12+
Write-Host ([string]::Format(']: Failed to compile Icinga for Windows component at location "{0}", because the required function "Write-IcingaForWindowsComponentCompilationFile" is not installed. Please ensure Icinga PowerShell Framework v1.9.0 or later is installed and try again.',$MyInvocation.MyCommand.Path));
13+
14+
return;
15+
}
16+
17+
Write-IcingaForWindowsComponentCompilationFile`
18+
-ScriptRootPath$PSScriptRoot`
19+
-CompiledFilePath ($MyInvocation.MyCommand.Path);

‎doc/10-Icinga-Plugins.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Please ensure that you will escape the `@` if you are configuring it on the Icin
1414

1515
To test thresholds with different input values, you can use the Framework Cmdlet`Get-IcingaHelpThresholds`.
1616

17-
Each plugin ships with a constant Framework argument`-ThresholdInterval`. This can be used to modify the value your thresholds are compared against from the current, fetched value to one collected over time by the Icinga for Windows daemon. In case you[registered service checks](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/) for specific time intervals, you can for example set the argument to`15m` to get the average value of 15m as base for your monitoring values. Please note that in this example, you will require to have collected the`15m` average for`Invoke-IcingaCheckCPU`.
17+
Each plugin ships with a constant Framework argument`-ThresholdInterval`. This can be used to modify the value your thresholds are compared against from the current, fetched value to one collected over time by the Icinga for Windows daemon. In case you[Collect Metrics Over Time](https://icinga.com/docs/icinga-for-windows/latest/doc/110-Installation/06-Collect-Metrics-over-Time/) for specific time intervals, you can for example set the argument to`15m` to get the average value of 15m as base for your monitoring values. Please note that in this example, you will require to have collected the`15m` average for`Invoke-IcingaCheckCPU`.
1818

1919
```powershell
2020
icinga> icinga { Invoke-IcingaCheckCPU -Warning 20 -Critical 40 -Core _Total -ThresholdInterval 15m }
@@ -23,7 +23,10 @@ icinga> icinga { Invoke-IcingaCheckCPU -Warning 20 -Critical 40 -Core _Total -Th
2323
\_ [WARNING] Core Total: 29,14817700% is greater than threshold 20% (15m avg.)
2424
| 'core_total_1'=31.545677%;;;0;100 'core_total_15'=29.148177%;20;40;0;100 'core_total_5'=28.827410%;;;0;100 'core_total_20'=30.032942%;;;0;100 'core_total_3'=27.731669%;;;0;100 'core_total'=33.87817%;;;0;100
2525
```
26-
*[Invoke-IcingaCheckMSSQLBackupStatus](plugins/01-Invoke-IcingaCheckMSSQLBackupStatus.md)
27-
*[Invoke-IcingaCheckMSSQLHealth](plugins/02-Invoke-IcingaCheckMSSQLHealth.md)
28-
*[Invoke-IcingaCheckMSSQLPerfCounter](plugins/03-Invoke-IcingaCheckMSSQLPerfCounter.md)
29-
*[Invoke-IcingaCheckMSSQLResource](plugins/04-Invoke-IcingaCheckMSSQLResource.md)
26+
27+
| Plugin Name| Description|
28+
| ---| ---|
29+
|[Invoke-IcingaCheckMSSQLBackupStatus](plugins/01-Invoke-IcingaCheckMSSQLBackupStatus.md)| MSSQL plugin which checks for total backupsize, average backupsize, last backup age, last backup log age, last backup execution time, database status of a given database|
30+
|[Invoke-IcingaCheckMSSQLHealth](plugins/02-Invoke-IcingaCheckMSSQLHealth.md)| Checks if MSSQL services for a specific instance are running and if the connection to a database instance can be established|
31+
|[Invoke-IcingaCheckMSSQLPerfCounter](plugins/03-Invoke-IcingaCheckMSSQLPerfCounter.md)| Checks specified Performance Counter inside the MSSQL database by fetching counters by a given name and compares them to input thresholds|
32+
|[Invoke-IcingaCheckMSSQLResource](plugins/04-Invoke-IcingaCheckMSSQLResource.md)| MSSQL plugin which checks for page life expectancy, buffer cache hit ratio', average latch wait time (ms) Performance Counters|

‎doc/31-Changelog.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ documentation before upgrading to a new release.
77

88
Released closed milestones can be found on[GitHub](https://github.com/Icinga/icinga-powershell-mssql/milestones?state=closed).
99

10+
##1.3.0 (2022-05-03)
11+
12+
[Issue and PRs](https://github.com/Icinga/icinga-powershell-mssql/milestone/5?closed=1)
13+
14+
###Enhancements
15+
16+
*[44](https://github.com/Icinga/icinga-powershell-mssql/pull/44) Adds support for Icinga for Windows v1.9.0 module isolation
17+
1018
##1.2.0 (2021-06-02)
1119

1220
[Issue and PRs](https://github.com/Icinga/icinga-powershell-mssql/milestone/4?closed=1)

‎doc/plugins/01-Invoke-IcingaCheckMSSQLBackupStatus.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ No special permissions required.
3838
| IntegratedSecurity| SwitchParameter| false| False| Allows this plugin to use the credentials of the current PowerShell session inherited by the user the PowerShell is running with. If this is set and the user the PowerShell is running with can access to the MSSQL database you will not require to provide username and password|
3939
| NoPerfData| SwitchParameter| false| False| Disables the performance data output of this plugin|
4040
| Verbosity| Object| false| 0| Changes the behavior of the plugin output which check states are printed: 0 (default): Only service checks/packages with state not OK will be printed 1: Only services with not OK will be printed including OK checks of affected check packages including Package config 2: Everything will be printed regardless of the check state 3: Identical to Verbose 2, but prints in addition the check package configuration e.g (All must be[OK])|
41-
| ThresholdInterval|Object||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
41+
| ThresholdInterval|String||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
4242

4343
##Examples
4444

@@ -51,7 +51,9 @@ Invoke-IcingaMSSQLBackupOverallStatus -SqlUsername 'username' -SqlPassword (Conv
5151
###Example Output 1
5252

5353
```powershell
54-
[OK] Check package "MSSQL Backup"| 'status'=0;6;5 'size'=10110976b;; 'execution_time'=0s;; 'age'=144000s;; 'average_size'=3370325.333333b;; 'status'=0;6;5 'size'=12664832b;;'execution_time'=0s;; 'age'=493200s;; 'average_size'=6332416b;; 'status'=0;6;5 'size'=33445888b;; 'execution_time'=0s;; 'age'=144000s;; 'average_size'=16722944b;;
54+
[OK] Check package "MSSQL Backup"
55+
| 'status'=0;6;5 'size'=10110976b;; 'execution_time'=0s;; 'age'=144000s;; 'average_size'=3370325.333333b;; 'status'=0;6;5 'size'=12664832b;;
56+
'execution_time'=0s;; 'age'=493200s;; 'average_size'=6332416b;; 'status'=0;6;5 'size'=33445888b;; 'execution_time'=0s;; 'age'=144000s;; 'average_size'=16722944b;;
5557
```
5658

5759
###Example Command 2
@@ -63,5 +65,7 @@ Get-IcingaMSSQLBackupOverallStatus -IntegratedSecurity -SqlHost 'example.com' -I
6365
###Example Output 2
6466

6567
```powershell
66-
[OK] Check package "MSSQL Backup"| 'status'=0;6;5 'size'=12664832b;; 'execution_time'=0s;; 'age'=493200s;; 'average_size'=6332416b;; 'status'=0;6;5 'size'=10110976b;;'execution_time'=0s;; 'age'=144000s;; 'average_size'=3370325.333333b;;
68+
[OK] Check package "MSSQL Backup"
69+
| 'status'=0;6;5 'size'=12664832b;; 'execution_time'=0s;; 'age'=493200s;; 'average_size'=6332416b;; 'status'=0;6;5 'size'=10110976b;;
70+
'execution_time'=0s;; 'age'=144000s;; 'average_size'=3370325.333333b;;
6771
```

‎doc/plugins/02-Invoke-IcingaCheckMSSQLHealth.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ No special permissions required.
2929
| IntegratedSecurity| SwitchParameter| false| False| Allows this plugin to use the credentials of the current PowerShell session inherited by the user the PowerShell is running with. If this is set and the user the PowerShell is running with can access to the MSSQL database you will not require to provide username and password|
3030
| NoPerfData| SwitchParameter| false| False| Disables the performance data output of this plugin|
3131
| Verbosity| Int32| false| 0| Changes the behavior of the plugin output which check states are printed: 0 (default): Only service checks/packages with state not OK will be printed 1: Only services with not OK will be printed including OK checks of affected check packages including Package config 2: Everything will be printed regardless of the check state 3: Identical to Verbose 2, but prints in addition the check package configuration e.g (All must be[OK])|
32-
| ThresholdInterval|Object||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
32+
| ThresholdInterval|String||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
3333

3434
##Examples
3535

@@ -42,7 +42,8 @@ Invoke-IcingaCheckMSSQLHealth -SqlUsername 'username' -SqlPassword (ConvertTo-Ic
4242
###Example Output 1
4343

4444
```powershell
45-
[OK] Check package "MSSQL Health"| 'connection_time'=19ms;;
45+
[OK] Check package "MSSQL Health"
46+
| 'connection_time'=19ms;;
4647
```
4748

4849
###Example Command 2
@@ -54,5 +55,6 @@ Invoke-IcingaCheckMSSQLHealth -IntegratedSecurity -SqlHost example.com;
5455
###Example Output 2
5556

5657
```powershell
57-
[OK] Check package "MSSQL Health"| 'connection_time'=26ms;;
58+
[OK] Check package "MSSQL Health"
59+
| 'connection_time'=26ms;;
5860
```

‎doc/plugins/03-Invoke-IcingaCheckMSSQLPerfCounter.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ No special permissions required.
2929
| IntegratedSecurity| SwitchParameter| false| False| Allows this plugin to use the credentials of the current PowerShell session inherited by the user the PowerShell is running with. If this is set and the user the PowerShell is running with can access to the MSSQL database you will not require to provide username and password|
3030
| NoPerfData| SwitchParameter| false| False| Disables the performance data output of this plugin|
3131
| Verbosity| Int32| false| 0| Changes the behavior of the plugin output which check states are printed: 0 (default): Only service checks/packages with state not OK will be printed 1: Only services with not OK will be printed including OK checks of affected check packages including Package config 2: Everything will be printed regardless of the check state 3: Identical to Verbose 2, but prints in addition the check package configuration e.g (All must be[OK])|
32-
| ThresholdInterval|Object||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
32+
| ThresholdInterval|String||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
3333

3434
##Examples
3535

@@ -42,7 +42,8 @@ Invoke-IcingaCheckMSSQLHealth -SqlUsername 'username' -SqlPassword (ConvertTo-Ic
4242
###Example Output 1
4343

4444
```powershell
45-
[OK] Check package "MSSQL Performance Counter"| 'sqlserverbuffer_manager'=22;; 'sqlserverlatches'=384199;;
45+
[OK] Check package "MSSQL Performance Counter"
46+
| 'sqlserverbuffer_manager'=22;; 'sqlserverlatches'=384199;;
4647
```
4748

4849
###Example Command 2
@@ -54,5 +55,6 @@ Invoke-IcingaCheckMSSQLHealth -IntegratedSecurity -SqlHost 'example.com' -Perfor
5455
###Example Output 2
5556

5657
```powershell
57-
[OK] Check package "MSSQL Performance Counter"| 'sqlserverbuffer_manager'=24;; 'sqlserverlatches'=387257;;
58+
[OK] Check package "MSSQL Performance Counter"
59+
| 'sqlserverbuffer_manager'=24;; 'sqlserverlatches'=387257;;
5860
```

‎doc/plugins/04-Invoke-IcingaCheckMSSQLResource.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ No special permissions required.
3232
| IntegratedSecurity| SwitchParameter| false| False| Allows this plugin to use the credentials of the current PowerShell session inherited by the user the PowerShell is running with. If this is set and the user the PowerShell is running with can access to the MSSQL database you will not require to provide username and password|
3333
| NoPerfData| SwitchParameter| false| False| Disables the performance data output of this plugin|
3434
| Verbosity| Int32| false| 0| Changes the behavior of the plugin output which check states are printed: 0 (default): Only service checks/packages with state not OK will be printed 1: Only services with not OK will be printed including OK checks of affected check packages including Package config 2: Everything will be printed regardless of the check state 3: Identical to Verbose 2, but prints in addition the check package configuration e.g (All must be[OK])e|
35-
| ThresholdInterval|Object||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
35+
| ThresholdInterval|String||| Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described[here](https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/). An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring.|
3636

3737
##Examples
3838

@@ -45,7 +45,8 @@ Invoke-IcingaCheckMSSQLResource -SqlUsername 'username' -SqlPassword (ConvertTo-
4545
###Example Output 1
4646

4747
```powershell
48-
[OK] Check package "MSSQL Performance"| 'buffer_cache_hit_ratio'=62;; 'page_life_expectancy'=300;; 'average_latch_wait_time_ms'=389839;;
48+
[OK] Check package "MSSQL Performance"
49+
| 'buffer_cache_hit_ratio'=62;; 'page_life_expectancy'=300;; 'average_latch_wait_time_ms'=389839;;
4950
```
5051

5152
###Example Command 2
@@ -57,5 +58,6 @@ Invoke-IcingaCheckMSSQLResource -IntegratedSecurity -SqlHost 'example.com';
5758
###Example Output 2
5859

5960
```powershell
60-
[OK] Check package "MSSQL Performance"| 'buffer_cache_hit_ratio'=2;; 'page_life_expectancy'=300;; 'average_latch_wait_time_ms'=389839;;
61+
[OK] Check package "MSSQL Performance"
62+
| 'buffer_cache_hit_ratio'=2;; 'page_life_expectancy'=300;; 'average_latch_wait_time_ms'=389839;;
6163
```

‎icinga-powershell-mssql.psd1‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,23 @@
88
Description='A collection of Icinga PowerShell MSSQL plugins for the Icinga PowerShell Framework'
99
PowerShellVersion='4.0'
1010
RequiredModules=@(
11-
@{ModuleName='icinga-powershell-framework';ModuleVersion='1.5.0' },
11+
@{ModuleName='icinga-powershell-framework';ModuleVersion='1.9.0' },
1212
@{ModuleName='icinga-powershell-plugins';ModuleVersion='1.5.0' }
1313
)
1414
NestedModules=@(
15-
'.\plugins\Invoke-IcingaCheckMSSQLBackupStatus.psm1',
16-
'.\plugins\Invoke-IcingaCheckMSSQLHealth.psm1',
17-
'.\plugins\Invoke-IcingaCheckMSSQLPerfCounter.psm1',
18-
'.\plugins\Invoke-IcingaCheckMSSQLResource.psm1',
19-
'.\provider\enums\Icinga_MSSQLProviderEnums.psm1',
20-
'.\provider\mssql\Get-IcingaMSSQLBackupOverallStatus.psm1',
21-
'.\provider\mssql\Get-IcingaMSSQLPerfCounterNameFromDBObject.psm1',
22-
'.\provider\mssql\Get-IcingaMSSQLPerfCounterPathFromDBObject.psm1',
23-
'.\provider\mssql\Get-IcingaMSSQLPerformanceCounter.psm1'
15+
'.\compiled\icinga-powershell-mssql.ifw_compilation.psm1'
16+
)
17+
FunctionsToExport=@(
18+
'Invoke-IcingaCheckMSSQLBackupStatus',
19+
'Invoke-IcingaCheckMSSQLHealth',
20+
'Invoke-IcingaCheckMSSQLPerfCounter',
21+
'Invoke-IcingaCheckMSSQLResource'
22+
)
23+
CmdletsToExport=@(
24+
)
25+
VariablesToExport=@(
26+
'MSSQLProviderEnums'
2427
)
25-
FunctionsToExport=@('*')
26-
CmdletsToExport=@('*')
27-
VariablesToExport='*'
28-
AliasesToExport=@()
2928
PrivateData=@{
3029
PSData=@{
3130
Tags=@('icinga','icinga2','mssqlplugins','icingamssql','icinga2mssql','icingawindows')
@@ -41,3 +40,4 @@
4140
}
4241
HelpInfoURI='https://github.com/Icinga/icinga-powershell-mssql'
4342
}
43+

‎icinga-powershell-mssql.psm1‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
functionImport-IcingaPowerShellComponentMSSQL()
2+
{
3+
# Allows other components to load this component
4+
}
5+
6+
Export-ModuleMember-Variable@('MSSQLProviderEnums');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp