-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaws.cfg
112 lines (99 loc) · 3.93 KB
/
aws.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# sample configuration for check_cloudwatch
# definition of check-cloudwatch command
define command{
command_name check-cloudwatch
command_line $USER1$/check_cloudwatch $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8
}
# 'check_mysql_port' command definition for RDS , you need to open mysql port to Nagios server
define command{
command_name check-mysql-port
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 3306 $ARG2$
}
# definition of basic template for each service
define host{
name ec2-instance
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_interval 120
notification_options d,u,r
contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
define host{
name rds-instance
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-mysql-port
notification_interval 120
notification_options d,u,r
contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
# definition of actual instances
define host{
use ec2-instance
host_name instance1
alias i-xxxxxxxx
parents us-east-1
address ec2-12-34-56-789.compute-1.amazonaws.com
}
define host{
use ec2-instance
host_name instance2
alias i-yyyyyyyy
address ec2-98-76-54-321.compute-1.amazonaws.com
}
define host{
use ec2-instance
host_name instance3
alias i-zzzzzzzz
address ec2-12-34-56-789.us-west-1.compute.amazonaws.com
}
define host{
use rds-instance
host_name rds1
alias nameofrdsinstance
address nameofrdsinstance.somesubdomain.us-east-1.rds.amazonaws.com
}
# region setting !!! THIS IS REQUIRED AND REALLY IMPORTANT !!!
define hostgroup{
hostgroup_name us-east-1
members instance1,instance2,rds1
}
define hostgroup{
hostgroup_name us-west-1
members instance3
}
# EC2 CPU
define service{
use generic-service
host_name instance1,instance2,instance3
service_description CPU
check_command check-cloudwatch!$HOSTGROUPNAME$!CPUUtilization!"Average"!"AWS/EC2"!"InstanceId=$HOSTALIAS$"!360!60!90
}
# RDS CPU/Memory/Storage
define service{
use generic-service
host_name rds1
service_description CPU
check_command check-cloudwatch!$HOSTGROUPNAME$!CPUUtilization!"Average"!"AWS/RDS"!"DBInstanceIdentifier=$HOSTALIAS$"!360!60!90
}
define service{
use generic-service
host_name rds1
service_description Memory
check_command check-cloudwatch!$HOSTGROUPNAME$!FreeableMemory!"Minimum"!"AWS/RDS"!"DBInstanceIdentifier=$HOSTALIAS$"!360!250000000!100000000
}
define service{
use generic-service
host_name rds1
service_description Storage
check_command check-cloudwatch!$HOSTGROUPNAME$!FreeStorageSpace!"Minimum"!"AWS/RDS"!"DBInstanceIdentifier=$HOSTALIAS$"!360!2000000000!1000000000
}