config/director/Invoke-IcingaCheckCertificate.json

{"DataList":{"PowerShell ExecutionPolicies":{"list_name":"PowerShell ExecutionPolicies","originalId":"2","entries":[{"allowed_roles":null,"entry_value":"AllSigned","entry_name":"AllSigned","format":"string"},{"allowed_roles":null,"entry_value":"Bypass","entry_name":"Bypass","format":"string"},{"allowed_roles":null,"entry_value":"Default","entry_name":"Default","format":"string"},{"allowed_roles":null,"entry_value":"RemoteSigned","entry_name":"RemoteSigned","format":"string"},{"allowed_roles":null,"entry_value":"Restricted","entry_name":"Restricted","format":"string"},{"allowed_roles":null,"entry_value":"Undefined","entry_name":"Undefined","format":"string"},{"allowed_roles":null,"entry_value":"Unrestricted","entry_name":"Unrestricted","format":"string"}],"owner":"stein"},"IcingaCheckCertificate CertStore":{"list_name":"IcingaCheckCertificate CertStore","originalId":"2","entries":[{"allowed_roles":null,"entry_value":"None","entry_name":"None","format":"string"},{"allowed_roles":null,"entry_value":"*","entry_name":"*","format":"string"},{"allowed_roles":null,"entry_value":"LocalMachine","entry_name":"LocalMachine","format":"string"},{"allowed_roles":null,"entry_value":"CurrentUser","entry_name":"CurrentUser","format":"string"}],"owner":"stein"},"IcingaCheckCertificate Verbosity":{"list_name":"IcingaCheckCertificate 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"},{"allowed_roles":null,"entry_value":"3","entry_name":"3","format":"string"}],"owner":"stein"}},"Command":{"Invoke-IcingaCheckCertificate":{"fields":[{"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},{"datafield_id":10,"is_required":"n","var_filter":null},{"datafield_id":11,"is_required":"n","var_filter":null},{"datafield_id":12,"is_required":"n","var_filter":null},{"datafield_id":13,"is_required":"n","var_filter":null},{"datafield_id":14,"is_required":"n","var_filter":null},{"datafield_id":15,"is_required":"n","var_filter":null},{"datafield_id":16,"is_required":"n","var_filter":null},{"datafield_id":17,"is_required":"n","var_filter":null},{"datafield_id":18,"is_required":"n","var_filter":null}],"object_name":"Invoke-IcingaCheckCertificate","arguments":{"-CertStorePath":{"value":"$IcingaCheckCertificate_Object_CertStorePath$","order":"9"},"-CriticalEnd":{"value":"$IcingaCheckCertificate_Object_CriticalEnd$","order":"4"},"-Verbosity":{"value":"$IcingaCheckCertificate_Int32_Verbosity$","order":"12"},"-CertSubject":{"value":{"body":"var arr = macro(\"$IcingaCheckCertificate_Array_CertSubject$\");\r\n if (len(arr) == 0) {\r\n return \"@()\";\r\n }\r\n return arr.map(\r\n x =\u003e if (typeof(x) == String) {\r\n var argLen = len(x);\r\n if (argLen != 0 \u0026\u0026 x.substr(0,1) == \"\u0027\" \u0026\u0026 x.substr(argLen - 1, argLen) == \"\u0027\") {\r\n x;\r\n } else {\r\n \"\u0027\" + x + \"\u0027\";\r\n }\r\n } else {\r\n x;\r\n }\r\n ).join(\",\");","type":"Function"},"order":"7"},"-IgnoreEmpty":{"set_if":"$IcingaCheckCertificate_Switchparameter_IgnoreEmpty$","set_if_format":"string","order":"99"},"-WarningEnd":{"value":"$IcingaCheckCertificate_Object_WarningEnd$","order":"3"},"-C":{"value":"try { Use-Icinga -Minimal; } 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; Write-Output \u0027Error:\u0027 $$($$_.Exception.Message)Components:`r`n$$( Get-Module -ListAvailable \u0027icinga-powershell-*\u0027 )`r`n\u0027Module-Path:\u0027`r`n$$($$Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command \u0027Invoke-IcingaCheckCertificate\u0027 ","order":"0"},"-CriticalStart":{"value":"$IcingaCheckCertificate_Object_CriticalStart$","order":"2"},"-ThresholdInterval":{"value":"$IcingaCheckCertificate_String_ThresholdInterval$","order":"100"},"-CertStore":{"value":"$IcingaCheckCertificate_String_CertStore$","order":"5"},"-Trusted":{"set_if":"$IcingaCheckCertificate_Switchparameter_Trusted$","set_if_format":"string","order":"99"},"-ExcludePattern":{"value":{"body":"var arr = macro(\"$IcingaCheckCertificate_Array_ExcludePattern$\");\r\n if (len(arr) == 0) {\r\n return \"@()\";\r\n }\r\n return arr.map(\r\n x =\u003e if (typeof(x) == String) {\r\n var argLen = len(x);\r\n if (argLen != 0 \u0026\u0026 x.substr(0,1) == \"\u0027\" \u0026\u0026 x.substr(argLen - 1, argLen) == \"\u0027\") {\r\n x;\r\n } else {\r\n \"\u0027\" + x + \"\u0027\";\r\n }\r\n } else {\r\n x;\r\n }\r\n ).join(\",\");","type":"Function"},"order":"8"},"-CertPaths":{"value":{"body":"var arr = macro(\"$IcingaCheckCertificate_Array_CertPaths$\");\r\n if (len(arr) == 0) {\r\n return \"@()\";\r\n }\r\n return arr.map(\r\n x =\u003e if (typeof(x) == String) {\r\n var argLen = len(x);\r\n if (argLen != 0 \u0026\u0026 x.substr(0,1) == \"\u0027\" \u0026\u0026 x.substr(argLen - 1, argLen) == \"\u0027\") {\r\n x;\r\n } else {\r\n \"\u0027\" + x + \"\u0027\";\r\n }\r\n } else {\r\n x;\r\n }\r\n ).join(\",\");","type":"Function"},"order":"10"},"-CertThumbprint":{"value":{"body":"var arr = macro(\"$IcingaCheckCertificate_Array_CertThumbprint$\");\r\n if (len(arr) == 0) {\r\n return \"@()\";\r\n }\r\n return arr.map(\r\n x =\u003e if (typeof(x) == String) {\r\n var argLen = len(x);\r\n if (argLen != 0 \u0026\u0026 x.substr(0,1) == \"\u0027\" \u0026\u0026 x.substr(argLen - 1, argLen) == \"\u0027\") {\r\n x;\r\n } else {\r\n \"\u0027\" + x + \"\u0027\";\r\n }\r\n } else {\r\n x;\r\n }\r\n ).join(\",\");","type":"Function"},"order":"6"},"-Recurse":{"set_if":"$IcingaCheckCertificate_Switchparameter_Recurse$","set_if_format":"string","order":"99"},"-CertName":{"value":{"body":"var arr = macro(\"$IcingaCheckCertificate_Array_CertName$\");\r\n if (len(arr) == 0) {\r\n return \"@()\";\r\n }\r\n return arr.map(\r\n x =\u003e if (typeof(x) == String) {\r\n var argLen = len(x);\r\n if (argLen != 0 \u0026\u0026 x.substr(0,1) == \"\u0027\" \u0026\u0026 x.substr(argLen - 1, argLen) == \"\u0027\") {\r\n x;\r\n } else {\r\n \"\u0027\" + x + \"\u0027\";\r\n }\r\n } else {\r\n x;\r\n }\r\n ).join(\",\");","type":"Function"},"order":"11"}},"imports":["PowerShell Base"],"object_type":"object","vars":{"IcingaCheckCertificate_Switchparameter_Recurse":false,"IcingaCheckCertificate_Switchparameter_Trusted":false,"IcingaCheckCertificate_Switchparameter_IgnoreEmpty":false}},"PowerShell Base":{"methods_execute":"PluginCheck","object_name":"PowerShell Base","vars":{"IcingaPowerShellBase_String_ExecutionPolicy":"ByPass"},"is_string":null,"command":"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe","zone":null,"disabled":false,"fields":[{"datafield_id":2,"is_required":"n","var_filter":null}],"arguments":{"-ExecutionPolicy":{"value":"$IcingaPowerShellBase_String_ExecutionPolicy$","order":"-1"},"-NoProfile":{"set_if":true,"order":"-3"},"-NoLogo":{"set_if":true,"order":"-2"}},"imports":[],"object_type":"object","timeout":"180"}},"Datafield":{"16":{"settings":{"visibility":"visible"},"description":"Includes sub-directories and entries while looking for certificates on a given path","caption":"Recurse","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeBoolean","originalId":"16","varname":"IcingaCheckCertificate_Switchparameter_Recurse","format":null},"7":{"settings":{"visibility":"visible"},"description":"Used to specify a Warning range for the end date of an certificate. In this case a string.\nAllowed units include: ms, s, m, h, d, w, M, y","caption":"WarningEnd","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"7","varname":"IcingaCheckCertificate_Object_WarningEnd","format":null},"5":{"settings":{"visibility":"visible"},"description":"Used to switch on trusted behavior. Whether to check, If the certificate is trusted by the system root.\nWill return Critical in case of untrusted.\n\nNote: it is currently required that the root and intermediate CA is known and trusted by the local system.","caption":"Trusted","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeBoolean","originalId":"5","varname":"IcingaCheckCertificate_Switchparameter_Trusted","format":null},"18":{"settings":{"datalist":"IcingaCheckCertificate 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\n3: Identical to Verbose 2, but prints in addition the check package configuration e.g (All must be [OK])","caption":"Verbosity","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeDatalist","originalId":"18","varname":"IcingaCheckCertificate_Int32_Verbosity","format":null},"12":{"settings":{"visibility":"visible"},"description":"Used to specify an array of exclusions, tested against Subject, Subject Alternative Name and Issuer.","caption":"ExcludePattern","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeArray","originalId":"12","varname":"IcingaCheckCertificate_Array_ExcludePattern","format":null},"10":{"settings":{"visibility":"visible"},"description":"Used to specify an array of Thumbprints, which are used to determine what certificate to check, within the CertStore.","caption":"CertThumbprint","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeArray","originalId":"10","varname":"IcingaCheckCertificate_Array_CertThumbprint","format":null},"2":{"settings":{"datalist":"PowerShell ExecutionPolicies","behavior":"strict","data_type":"string"},"description":"Defines with which Execution Policy the PowerShell is started","caption":"PowerShell Execution Policy","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeDatalist","originalId":"2","varname":"IcingaPowerShellBase_String_ExecutionPolicy","format":null},"8":{"settings":{"visibility":"visible"},"description":"Used to specify a Critical range for the end date of an certificate. In this case a string.\nAllowed units include: ms, s, m, h, d, w, M, y","caption":"CriticalEnd","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"8","varname":"IcingaCheckCertificate_Object_CriticalEnd","format":null},"17":{"settings":{"visibility":"visible"},"description":"Will return `OK` instead of `UNKNOWN`, in case no certificates for the given filter and path were found","caption":"IgnoreEmpty","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeBoolean","originalId":"17","varname":"IcingaCheckCertificate_Switchparameter_IgnoreEmpty","format":null},"11":{"settings":{"visibility":"visible"},"description":"Used to specify an array of Subjects, which are used to determine what certificate to check, within the CertStore.","caption":"CertSubject","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeArray","originalId":"11","varname":"IcingaCheckCertificate_Array_CertSubject","format":null},"9":{"settings":{"datalist":"IcingaCheckCertificate CertStore","behavior":"strict","data_type":"string"},"description":"Used to specify which CertStore to check. Valid choices are \u0027None\u0027, \u0027*\u0027, \u0027LocalMachine\u0027, \u0027CurrentUser\u0027.\nUse \u0027None\u0027 if you do not want to check the certificate store (Default)","caption":"CertStore","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeDatalist","originalId":"9","varname":"IcingaCheckCertificate_String_CertStore","format":null},"14":{"settings":{"visibility":"visible"},"description":"Used to specify an array of paths on your system, where certificate files are. Use with CertName.","caption":"CertPaths","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeArray","originalId":"14","varname":"IcingaCheckCertificate_Array_CertPaths","format":null},"15":{"settings":{"visibility":"visible"},"description":"Used to specify an array of certificate names of certificate files to check. Use with CertPaths.","caption":"CertName","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeArray","originalId":"15","varname":"IcingaCheckCertificate_Array_CertName","format":null},"6":{"settings":{"visibility":"visible"},"description":"Used to specify a date. The start date of the certificate has to be past the date specified, otherwise the check results in critical. Use carefully.\nUse format like: \u0027yyyy-MM-dd\u0027","caption":"CriticalStart","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"6","varname":"IcingaCheckCertificate_Object_CriticalStart","format":null},"4":{"settings":{"visibility":"visible"},"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.","caption":"ThresholdInterval","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"4","varname":"IcingaCheckCertificate_String_ThresholdInterval","format":null},"13":{"settings":{"visibility":"visible"},"description":"Used to specify which path within the CertStore should be checked.","caption":"CertStorePath","datatype":"Icinga\\Module\\Director\\DataType\\DataTypeString","originalId":"13","varname":"IcingaCheckCertificate_Object_CertStorePath","format":null}}}