diff --git a/contrib/icinga2-commands.conf b/contrib/icinga2-commands.conf new file mode 100644 index 0000000..2233c98 --- /dev/null +++ b/contrib/icinga2-commands.conf @@ -0,0 +1,88 @@ +template CheckCommand "cloud_aws" { + command = [ PluginDir + "/check_cloud_aws" ] + + arguments = { + "-t" = { + value = "$cloud_aws_timeout$" + description = "Timeout for the check" + } + "-P" = { + value= "$cloud_aws_profile$" + description = "AWS credential profile (~/.aws/credentials)" + } + "-R" = { + value = "$cloud_aws_region$" + description = "AWS region name (e.g. eu-central-1)" + } + } +} + +object CheckCommand "cloud_aws_instance" { + import "cloud_aws" + + arguments += { + "ec2" = { + value = "$cloud_aws_ec2$" + description = "Checks in the EC2 context" + } + "instance" { + value = "$cloud_aws_instance$" + description = "Checks a single EC2 instance" + } + "-i" = { + value = "$cloud_aws_id$" + description = "Look for ec2 instance by id" + } + "-n" = { + value = "$cloud_aws_name$" + description = "Look for ec2 instance by name" + } + } + + vars.cloud_aws_ec2 = "ec2" + vars.loud_aws_instance = "instance" +} + +object CheckCommand "cloud_aws_instance" { + import "cloud_aws" + + arguments += { + "ec2" = { + value = "$cloud_aws_ec2$" + description = "Checks in the EC2 context" + } + "instances" = { + value = "$cloud_aws_instances$" + description = "Checks multiple EC2 instances by name" + } + "-n" = { + value = "$cloud_aws_name$" + description = "Search for ec2 instances by name (e.g. instance*)" + } + "-a" = { + value = "$cloud_aws_autoscale$" + description = "Search for ec2 instances by autoscaling group" + } + } + + vars.cloud_aws_ec2 = "ec2" + vars.loud_aws_instances = "instances" +} + +apply Service "cloud_aws_single_instance" { + import "generic-service" + + check_command = "cloud_aws_instance" + + vars.cloud_aws_name = "IcingaMaster" + + assign where host.name == NodeName +} + +apply Service "cloud_aws_multiple_instances" { + import "generic-service" + + check_command = "cloud_aws_instances" + + assign where host.name == NodeName +}