Skip to content

Commit

Permalink
Add icinga2-commands.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Dorschner committed Feb 28, 2022
1 parent 42f6dc2 commit 196fbae
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions contrib/icinga2-commands.conf
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 196fbae

Please sign in to comment.