Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
Feature/icinga2 commands conf (#1)
Browse files Browse the repository at this point in the history
* Add icinga2-commands.conf

* Add icinga2-service-example.conf
  • Loading branch information
Philipp Dorschner authored Mar 31, 2022
1 parent db1f035 commit 65db1fa
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
45 changes: 45 additions & 0 deletions contrib/icinga2-commands.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
template CheckCommand "microsoft365" {
command = [ PluginContribDir + "/check_microsoft365" ]

arguments = {
"--clientid" = {
value = "$microsoft365_clientid$"
description = "The client id from your app registration"
}
"--clientsecret" = {
value = "$microsoft365_clientsecret$"
description = "The client secret from your app registration"
}
"--tenantid" = {
value = "$microsoft365_tenantid$"
description = "The tenant id from your app registration"
}
"--scope" = {
value = "$microsoft365_scope$"
description = "Represents the definition of a delegated permission"
}
"--timeout" = {
value = "$microsoft365_timeout$"
description = "Timeout for the check"
}
}
}

object CheckCommand "microsoft365-servicehealth" {
import "microsoft365"

command += ["servicehealth"]

arguments += {
"--servicenames" = {
value = "$microsoft365_servicenames$"
repeat_key = true
description = "The name of one or more specific service/s"
}
"--state-override" = {
value = "$microsoft365_stateoverrides$"
repeat_key = true
description = "States to override (e.g. STATENAME=ok)"
}
}
}
11 changes: 11 additions & 0 deletions contrib/icinga2-service-example.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apply Service "microsoft365-servicehealth" {
check_command = "microsoft365-servicehealth"

vars.microsoft365_tenantid = "example_tenant_id"
vars.microsoft365_clientsecret = "example_client_secret"
vars.microsoft365_clientid = "example_client_id"
vars.microsoft365_servicenames = [ "Exchange Online" ]
vars.microsoft365_stateoverrides = [ "EXTENDEDRECOVERY=warning" ]

assign where host.name == NodeName
}

0 comments on commit 65db1fa

Please sign in to comment.