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

Commitf75fae6

Browse files
committed
Updates config and dependencies for IfW v1.10.0
1 parent4a285c6 commitf75fae6

13 files changed

+523
-91
lines changed

‎compiled/icinga-powershell-mssql.ifw_compilation.psm1‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ if ($null -eq (Get-Command -Name 'Write-IcingaForWindowsComponentCompilationFile
1717
Write-IcingaForWindowsComponentCompilationFile`
1818
-ScriptRootPath$PSScriptRoot`
1919
-CompiledFilePath ($MyInvocation.MyCommand.Path);
20+
21+
if ($null-ne$env:TERM_PROGRAM-Or$Global:Icinga.Protected.DeveloperMode) {
22+
Copy-IcingaFrameworkCacheTemplate;
23+
}

‎config/director/Invoke-IcingaCheckMSSQLBackupStatus.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎config/director/Invoke-IcingaCheckMSSQLHealth.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎config/director/Invoke-IcingaCheckMSSQLPerfCounter.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎config/director/Invoke-IcingaCheckMSSQLResource.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎config/director/Mssql_Bundle.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎config/icinga/Invoke-IcingaCheckMSSQLBackupStatus.conf‎

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@ object CheckCommand "Invoke-IcingaCheckMSSQLBackupStatus" {
1111
description = "Specifies the database or databases which will be checked. Leave empty to fetch metrics from all databases on the given system"
1212
value = {{
1313
var arr = macro("$IcingaCheckMSSQLBackupStatus_Array_IncludeDatabase$");
14-
if (len(arr) == 0) {
15-
return "@()";
16-
}
17-
return arr.map(
18-
x => if (typeof(x) == String) {
19-
var argLen = len(x);
20-
if (argLen != 0 && x.substr(0,1) == "'" && x.substr(argLen - 1, argLen) == "'") {
21-
x;
22-
} else {
23-
"'" + x + "'";
24-
}
25-
} else {
14+
if (len(arr) == 0) {
15+
return "@()";
16+
}
17+
var psarr = arr.map(
18+
x => if (typeof(x) == String) {
19+
var argLen = len(x);
20+
if (argLen != 0 && x.substr(0,1) == "'" && x.substr(argLen - 1, argLen) == "'") {
2621
x;
22+
} else {
23+
"'" + x + "'";
2724
}
28-
).join(",");
25+
} else {
26+
x;
27+
}
28+
).join(",");
29+
return "@(" + psarr + ")";
2930
}}
3031
order = 14
3132
}
@@ -44,8 +45,21 @@ object CheckCommand "Invoke-IcingaCheckMSSQLBackupStatus" {
4445
order = 99
4546
}
4647
"-SqlUsername" = {
48+
set_if = {{
49+
var str = macro("$IcingaCheckMSSQLBackupStatus_String_SqlUsername$"); if (len(str) == 0) { return false; }; return true;
50+
}}
4751
description = "The username for connecting to the MSSQL database"
48-
value = "$IcingaCheckMSSQLBackupStatus_String_SqlUsername$"
52+
value = {{
53+
var str = macro("$IcingaCheckMSSQLBackupStatus_String_SqlUsername$");
54+
var argLen = len(str);
55+
if (argLen == 0) {
56+
return;
57+
}
58+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
59+
return str;
60+
}
61+
return ("'" + str + "'");
62+
}}
4963
order = 15
5064
}
5165
"-LastBackupLogAgeCritical" = {
@@ -62,8 +76,21 @@ object CheckCommand "Invoke-IcingaCheckMSSQLBackupStatus" {
6276
order = 0
6377
}
6478
"-ThresholdInterval" = {
79+
set_if = {{
80+
var str = macro("$IcingaCheckMSSQLBackupStatus_String_ThresholdInterval$"); if (len(str) == 0) { return false; }; return true;
81+
}}
6582
description = "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."
66-
value = "$IcingaCheckMSSQLBackupStatus_String_ThresholdInterval$"
83+
value = {{
84+
var str = macro("$IcingaCheckMSSQLBackupStatus_String_ThresholdInterval$");
85+
var argLen = len(str);
86+
if (argLen == 0) {
87+
return;
88+
}
89+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
90+
return str;
91+
}
92+
return ("'" + str + "'");
93+
}}
6794
order = 100
6895
}
6996
"-ExecutionTimeWarning" = {
@@ -91,8 +118,21 @@ object CheckCommand "Invoke-IcingaCheckMSSQLBackupStatus" {
91118
order = 13
92119
}
93120
"-SqlHost" = {
121+
set_if = {{
122+
var str = macro("$IcingaCheckMSSQLBackupStatus_String_SqlHost$"); if (len(str) == 0) { return false; }; return true;
123+
}}
94124
description = "The IP address or FQDN to the MSSQL server to connect to"
95-
value = "$IcingaCheckMSSQLBackupStatus_String_SqlHost$"
125+
value = {{
126+
var str = macro("$IcingaCheckMSSQLBackupStatus_String_SqlHost$");
127+
var argLen = len(str);
128+
if (argLen == 0) {
129+
return;
130+
}
131+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
132+
return str;
133+
}
134+
return ("'" + str + "'");
135+
}}
96136
order = 17
97137
}
98138
"-TotalBackupSizeCritical" = {

‎config/icinga/Invoke-IcingaCheckMSSQLHealth.conf‎

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,43 @@ object CheckCommand "Invoke-IcingaCheckMSSQLHealth" {
1212
order = 10
1313
}
1414
"-Instance" = {
15+
set_if = {{
16+
var str = macro("$IcingaCheckMSSQLHealth_String_Instance$"); if (len(str) == 0) { return false; }; return true;
17+
}}
1518
description = "The name of the database instance to check the service state for. Can either the MSSQL$DB1 or simply DB1 for example"
16-
value = "$IcingaCheckMSSQLHealth_String_Instance$"
19+
value = {{
20+
var str = macro("$IcingaCheckMSSQLHealth_String_Instance$");
21+
var argLen = len(str);
22+
if (argLen == 0) {
23+
return;
24+
}
25+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
26+
return str;
27+
}
28+
return ("'" + str + "'");
29+
}}
1730
order = 4
1831
}
1932
"-C" = {
2033
value = "try { Use-Icinga -Minimal; } catch { Write-Output 'The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'; Write-Output 'Error:' $$($$_.Exception.Message)Components:`r`n$$( Get-Module -ListAvailable 'icinga-powershell-*' )`r`n'Module-Path:'`r`n$$($$Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command 'Invoke-IcingaCheckMSSQLHealth' "
2134
order = 0
2235
}
2336
"-ThresholdInterval" = {
37+
set_if = {{
38+
var str = macro("$IcingaCheckMSSQLHealth_String_ThresholdInterval$"); if (len(str) == 0) { return false; }; return true;
39+
}}
2440
description = "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."
25-
value = "$IcingaCheckMSSQLHealth_String_ThresholdInterval$"
41+
value = {{
42+
var str = macro("$IcingaCheckMSSQLHealth_String_ThresholdInterval$");
43+
var argLen = len(str);
44+
if (argLen == 0) {
45+
return;
46+
}
47+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
48+
return str;
49+
}
50+
return ("'" + str + "'");
51+
}}
2652
order = 100
2753
}
2854
"-SqlPort" = {
@@ -40,13 +66,39 @@ object CheckCommand "Invoke-IcingaCheckMSSQLHealth" {
4066
order = 99
4167
}
4268
"-SqlUsername" = {
69+
set_if = {{
70+
var str = macro("$IcingaCheckMSSQLHealth_String_SqlUsername$"); if (len(str) == 0) { return false; }; return true;
71+
}}
4372
description = "The username for connecting to the MSSQL database"
44-
value = "$IcingaCheckMSSQLHealth_String_SqlUsername$"
73+
value = {{
74+
var str = macro("$IcingaCheckMSSQLHealth_String_SqlUsername$");
75+
var argLen = len(str);
76+
if (argLen == 0) {
77+
return;
78+
}
79+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
80+
return str;
81+
}
82+
return ("'" + str + "'");
83+
}}
4584
order = 5
4685
}
4786
"-SqlHost" = {
87+
set_if = {{
88+
var str = macro("$IcingaCheckMSSQLHealth_String_SqlHost$"); if (len(str) == 0) { return false; }; return true;
89+
}}
4890
description = "The IP address or FQDN to the MSSQL server to connect to"
49-
value = "$IcingaCheckMSSQLHealth_String_SqlHost$"
91+
value = {{
92+
var str = macro("$IcingaCheckMSSQLHealth_String_SqlHost$");
93+
var argLen = len(str);
94+
if (argLen == 0) {
95+
return;
96+
}
97+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
98+
return str;
99+
}
100+
return ("'" + str + "'");
101+
}}
50102
order = 7
51103
}
52104
"-Critical" = {
@@ -60,8 +112,21 @@ object CheckCommand "Invoke-IcingaCheckMSSQLHealth" {
60112
order = 6
61113
}
62114
"-SqlDatabase" = {
115+
set_if = {{
116+
var str = macro("$IcingaCheckMSSQLHealth_String_SqlDatabase$"); if (len(str) == 0) { return false; }; return true;
117+
}}
63118
description = "The name of a specific database to connect to. Leave empty to connect 'globally'"
64-
value = "$IcingaCheckMSSQLHealth_String_SqlDatabase$"
119+
value = {{
120+
var str = macro("$IcingaCheckMSSQLHealth_String_SqlDatabase$");
121+
var argLen = len(str);
122+
if (argLen == 0) {
123+
return;
124+
}
125+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
126+
return str;
127+
}
128+
return ("'" + str + "'");
129+
}}
65130
order = 9
66131
}
67132
}

‎config/icinga/Invoke-IcingaCheckMSSQLPerfCounter.conf‎

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ object CheckCommand "Invoke-IcingaCheckMSSQLPerfCounter" {
1515
description = "List of Performance Counters specified by their full path (example '\\SQLServer:Buffer Manager\\Buffer cache hit ratio') to fetch information for"
1616
value = {{
1717
var arr = macro("$IcingaCheckMSSQLPerfCounter_Array_PerformanceCounter$");
18-
if (len(arr) == 0) {
19-
return "@()";
20-
}
21-
return arr.map(
22-
x => if (typeof(x) == String) {
23-
var argLen = len(x);
24-
if (argLen != 0 && x.substr(0,1) == "'" && x.substr(argLen - 1, argLen) == "'") {
25-
x;
26-
} else {
27-
"'" + x + "'";
28-
}
29-
} else {
18+
if (len(arr) == 0) {
19+
return "@()";
20+
}
21+
var psarr = arr.map(
22+
x => if (typeof(x) == String) {
23+
var argLen = len(x);
24+
if (argLen != 0 && x.substr(0,1) == "'" && x.substr(argLen - 1, argLen) == "'") {
3025
x;
26+
} else {
27+
"'" + x + "'";
3128
}
32-
).join(",");
29+
} else {
30+
x;
31+
}
32+
).join(",");
33+
return "@(" + psarr + ")";
3334
}}
3435
order = 4
3536
}
@@ -38,8 +39,21 @@ object CheckCommand "Invoke-IcingaCheckMSSQLPerfCounter" {
3839
order = 0
3940
}
4041
"-ThresholdInterval" = {
42+
set_if = {{
43+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_ThresholdInterval$"); if (len(str) == 0) { return false; }; return true;
44+
}}
4145
description = "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."
42-
value = "$IcingaCheckMSSQLPerfCounter_String_ThresholdInterval$"
46+
value = {{
47+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_ThresholdInterval$");
48+
var argLen = len(str);
49+
if (argLen == 0) {
50+
return;
51+
}
52+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
53+
return str;
54+
}
55+
return ("'" + str + "'");
56+
}}
4357
order = 100
4458
}
4559
"-SqlPort" = {
@@ -57,13 +71,39 @@ object CheckCommand "Invoke-IcingaCheckMSSQLPerfCounter" {
5771
order = 99
5872
}
5973
"-SqlUsername" = {
74+
set_if = {{
75+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_SqlUsername$"); if (len(str) == 0) { return false; }; return true;
76+
}}
6077
description = "The username for connecting to the MSSQL database"
61-
value = "$IcingaCheckMSSQLPerfCounter_String_SqlUsername$"
78+
value = {{
79+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_SqlUsername$");
80+
var argLen = len(str);
81+
if (argLen == 0) {
82+
return;
83+
}
84+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
85+
return str;
86+
}
87+
return ("'" + str + "'");
88+
}}
6289
order = 5
6390
}
6491
"-SqlHost" = {
92+
set_if = {{
93+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_SqlHost$"); if (len(str) == 0) { return false; }; return true;
94+
}}
6595
description = "The IP address or FQDN to the MSSQL server to connect to"
66-
value = "$IcingaCheckMSSQLPerfCounter_String_SqlHost$"
96+
value = {{
97+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_SqlHost$");
98+
var argLen = len(str);
99+
if (argLen == 0) {
100+
return;
101+
}
102+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
103+
return str;
104+
}
105+
return ("'" + str + "'");
106+
}}
67107
order = 7
68108
}
69109
"-Critical" = {
@@ -77,8 +117,21 @@ object CheckCommand "Invoke-IcingaCheckMSSQLPerfCounter" {
77117
order = 6
78118
}
79119
"-SqlDatabase" = {
120+
set_if = {{
121+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_SqlDatabase$"); if (len(str) == 0) { return false; }; return true;
122+
}}
80123
description = "The name of a specific database to connect to. Leave empty to connect 'globally'"
81-
value = "$IcingaCheckMSSQLPerfCounter_String_SqlDatabase$"
124+
value = {{
125+
var str = macro("$IcingaCheckMSSQLPerfCounter_String_SqlDatabase$");
126+
var argLen = len(str);
127+
if (argLen == 0) {
128+
return;
129+
}
130+
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
131+
return str;
132+
}
133+
return ("'" + str + "'");
134+
}}
82135
order = 9
83136
}
84137
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp