Skip to content

Commit d6b5e8d

Browse files
authored
Merge pull request #140 from Icinga:feature/check_plugin_for_unc_path_monitoring
Adds new plugin Invoke-IcingaCheckUNCPath Adds new plugin `Invoke-IcingaCheckUNCPath` to test for network share paths or other volumes to fetch the size and free space from them.
2 parents 131bab2 + 7ff13a2 commit d6b5e8d

File tree

10 files changed

+991
-176
lines changed

10 files changed

+991
-176
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"DataList":{"IcingaCheckUNCPath Verbosity":{"list_name":"IcingaCheckUNCPath Verbosity","originalId":"2","entries":[{"allowed_roles":null,"entry_value":"0","entry_name":"0","format":"string"},{"allowed_roles":null,"entry_value":"1","entry_name":"1","format":"string"},{"allowed_roles":null,"entry_value":"2","entry_name":"2","format":"string"}],"owner":"stein"}},"Command":{"PowerShell Base":{"methods_execute":"PluginCheck","object_name":"PowerShell Base","vars":{},"is_string":null,"command":"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe","zone":null,"disabled":false,"fields":[],"arguments":{},"imports":[],"object_type":"object","timeout":"180"},"Invoke-IcingaCheckUNCPath":{"fields":[{"datafield_id":2,"is_required":"n","var_filter":null},{"datafield_id":3,"is_required":"n","var_filter":null},{"datafield_id":4,"is_required":"n","var_filter":null},{"datafield_id":5,"is_required":"n","var_filter":null},{"datafield_id":6,"is_required":"n","var_filter":null},{"datafield_id":7,"is_required":"n","var_filter":null},{"datafield_id":8,"is_required":"n","var_filter":null},{"datafield_id":9,"is_required":"n","var_filter":null}],"object_name":"Invoke-IcingaCheckUNCPath","arguments":{"-C":{"value":"try { Use-Icinga; } catch { Write-Output \u0027The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details\u0027; exit 3; }; Exit-IcingaPluginNotInstalled \u0027Invoke-IcingaCheckUNCPath\u0027; exit Invoke-IcingaCheckUNCPath","order":"0"},"-Path":{"value":"$IcingaCheckUNCPath_String_Path$","order":"2"},"-Warning":{"value":"$IcingaCheckUNCPath_Object_Warning$","order":"4"},"-Verbosity":{"value":"$IcingaCheckUNCPath_Object_Verbosity$","order":"8"},"-CriticalTotal":{"value":"$IcingaCheckUNCPath_Object_CriticalTotal$","order":"7"},"-WarningTotal":{"value":"$IcingaCheckUNCPath_Object_WarningTotal$","order":"6"},"-Critical":{"value":"$IcingaCheckUNCPath_Object_Critical$","order":"5"},"-NoPerfData":{"set_if":"$IcingaCheckUNCPath_Switchparameter_NoPerfData$","set_if_format":"string","order":"99"},"-DisplayAlias":{"value":"$IcingaCheckUNCPath_String_DisplayAlias$","order":"3"}},"imports":["PowerShell Base"],"object_type":"object","vars":{"IcingaCheckUNCPath_Switchparameter_NoPerfData":false}}},"Datafield":{"7":{"settings":{"visbility":"visible"},"description":"A warning threshold for the shares total free space in byte units, like \"50GB:\"\nPlease note that this value is decreasing over time, therefor you will have to use the plugin handler and add \":\" at the end\nof your input to check for \"current value \u003c threshold\" like in the previous example\n\nAllowed units: B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB","caption":"CriticalTotal","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"7","varname":"IcingaCheckUNCPath_Object_CriticalTotal","format":null},"9":{"settings":{"datalist":"IcingaCheckUNCPath Verbosity","behavior":"strict","data_type":"string"},"description":"Changes the behavior of the plugin output which check states are printed:\n0 (default): Only service checks/packages with state not OK will be printed\n1: Only services with not OK will be printed including OK checks of affected check packages including Package config\n2: Everything will be printed regardless of the check state","caption":"Verbosity","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeDatalist","originalId":"9","varname":"IcingaCheckUNCPath_Object_Verbosity","format":null},"3":{"settings":{"visbility":"visible"},"description":"Modifies the plugin output to not display the value provided within the `-Path` argument but to use this string value\ninstead of shorten the output and make it more visual appealing.","caption":"DisplayAlias","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"3","varname":"IcingaCheckUNCPath_String_DisplayAlias","format":null},"2":{"settings":{"visbility":"visible"},"description":"The path to a volume or network share you want to monitor, like \"\\\\example.com\\Home\" or \"C:\\ClusterSharedVolume\\Volume1\"","caption":"Path","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"2","varname":"IcingaCheckUNCPath_String_Path","format":null},"4":{"settings":{"visbility":"visible"},"description":"A warning threshold for the shares free space in either % or byte units, like \"20%:\" or \"50GB:\"\nPlease note that this value is decreasing over time, therefor you will have to use the plugin handler and add \":\" at the end\nof your input to check for \"current value \u003c threshold\" like in the previous example\n\nAllowed units: %, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB","caption":"Warning","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"4","varname":"IcingaCheckUNCPath_Object_Warning","format":null},"6":{"settings":{"visbility":"visible"},"description":"A warning threshold for the shares total free space in byte units, like \"50GB:\"\nPlease note that this value is decreasing over time, therefor you will have to use the plugin handler and add \":\" at the end\nof your input to check for \"current value \u003c threshold\" like in the previous example\n\nAllowed units: B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB","caption":"WarningTotal","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"6","varname":"IcingaCheckUNCPath_Object_WarningTotal","format":null},"5":{"settings":{"visbility":"visible"},"description":"A critical threshold for the shares free space in either % or byte units, like \"20%:\" or \"50GB:\"\nPlease note that this value is decreasing over time, therefor you will have to use the plugin handler and add \":\" at the end\nof your input to check for \"current value \u003c threshold\" like in the previous example\n\nAllowed units: %, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB","caption":"Critical","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"5","varname":"IcingaCheckUNCPath_Object_Critical","format":null},"8":{"settings":{"visbility":"visible"},"description":"Disables the performance data output of this plugin. Default to FALSE.","caption":"NoPerfData","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeBoolean","originalId":"8","varname":"IcingaCheckUNCPath_Switchparameter_NoPerfData","format":null}}}

config/director/Plugins_Bundle.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
object CheckCommand "Invoke-IcingaCheckUNCPath" {
2+
import "PowerShell Base"
3+
4+
arguments += {
5+
"-C" = {
6+
value = "try { Use-Icinga; } 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'; exit 3; }; Exit-IcingaPluginNotInstalled 'Invoke-IcingaCheckUNCPath'; exit Invoke-IcingaCheckUNCPath"
7+
order = 0
8+
}
9+
"-Path" = {
10+
description = "The path to a volume or network share you want to monitor, like '\\\\example.com\\Home' or 'C:\\ClusterSharedVolume\\Volume1'"
11+
value = "$IcingaCheckUNCPath_String_Path$"
12+
order = 2
13+
}
14+
"-Warning" = {
15+
description = "A warning threshold for the shares free space in either % or byte units, like '20%:' or '50GB:' Please note that this value is decreasing over time, therefor you will have to use the plugin handler and add ':' at the end of your input to check for 'current value < threshold' like in the previous example Allowed units: %, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB"
16+
value = "$IcingaCheckUNCPath_Object_Warning$"
17+
order = 4
18+
}
19+
"-Verbosity" = {
20+
description = "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"
21+
value = "$IcingaCheckUNCPath_Object_Verbosity$"
22+
order = 8
23+
}
24+
"-CriticalTotal" = {
25+
description = "A warning threshold for the shares total free space in byte units, like '50GB:' Please note that this value is decreasing over time, therefor you will have to use the plugin handler and add ':' at the end of your input to check for 'current value < threshold' like in the previous example Allowed units: B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB"
26+
value = "$IcingaCheckUNCPath_Object_CriticalTotal$"
27+
order = 7
28+
}
29+
"-WarningTotal" = {
30+
description = "A warning threshold for the shares free space in either % or byte units, like '20%:' or '50GB:' Please note that this value is decreasing over time, therefor you will have to use the plugin handler and add ':' at the end of your input to check for 'current value < threshold' like in the previous example Allowed units: %, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB"
31+
value = "$IcingaCheckUNCPath_Object_WarningTotal$"
32+
order = 6
33+
}
34+
"-Critical" = {
35+
description = "A critical threshold for the shares free space in either % or byte units, like '20%:' or '50GB:' Please note that this value is decreasing over time, therefor you will have to use the plugin handler and add ':' at the end of your input to check for 'current value < threshold' like in the previous example Allowed units: %, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB"
36+
value = "$IcingaCheckUNCPath_Object_Critical$"
37+
order = 5
38+
}
39+
"-NoPerfData" = {
40+
set_if = "$IcingaCheckUNCPath_Switchparameter_NoPerfData$"
41+
order = 99
42+
}
43+
"-DisplayAlias" = {
44+
description = "Modifies the plugin output to not display the value provided within the `-Path` argument but to use this string value instead of shorten the output and make it more visual appealing."
45+
value = "$IcingaCheckUNCPath_String_DisplayAlias$"
46+
order = 3
47+
}
48+
}
49+
vars.IcingaCheckUNCPath_Switchparameter_NoPerfData = false
50+
}

0 commit comments

Comments
 (0)