-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhost.tpl
More file actions
61 lines (55 loc) · 2.26 KB
/
host.tpl
File metadata and controls
61 lines (55 loc) · 2.26 KB
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
<?PHP
if ( stripos($groupName, "sdproduction") !== false ) {
$memorytemplate = "sportsdata-memory";
} else {
$memorytemplate = "generic-service";
}
$hostdata =
"define host{\n" .
" use linux-server\n" .
" host_name " . $instanceID . "\n" .
" hostgroups " . $groupName . "\n" .
" alias " . $instanceID . "\n" .
" address " . $instanceHostName . "\n" .
" contact_groups admins" . $contactgroups . "\n" .
" }\n" .
"define service{\n" .
" use generic-service\n" .
" host_name " . $instanceID . "\n" .
" service_description SSH\n" .
" check_command check_ssh\n" .
" contact_groups admins" . $contactgroups . "\n" .
" }\n";
if ( stripos($groupName, "ImporterASGroup") === false ) {
$hostdata .=
"define service{\n" .
" use " . $memorytemplate . "\n" .
" host_name " . $instanceID . "\n" .
" service_description CPU Load\n" .
" check_command check_nrpe!check_load\n" .
" contact_groups admins" . $contactgroups . "\n" .
" }\n";
}
$hostdata .=
"define service{\n" .
" use generic-service\n" .
" host_name " . $instanceID . "\n" .
" service_description Memory\n" .
" check_command check_nrpe!check_mem\n" .
" contact_groups admins" . $contactgroups . "\n" .
" }\n" .
"define service{\n" .
" use generic-service\n" .
" host_name $instanceID\n" .
" service_description HTTP Apache\n" .
" check_command check_http! -u http://" . $instanceHostName . "/status\n" .
" contact_groups admins" . $contactgroups . "\n" .
" }\n" .
"define service{\n" .
" use generic-service\n" .
" host_name $instanceID\n" .
" service_description Disk Use\n" .
" check_command check_nrpe!check_sda1\n" .
" contact_groups admins" . $contactgroups . "\n" .
" }\n";
?>