mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
parent
44193f341e
commit
87cead02ed
@ -27,7 +27,16 @@ install_if_not_exists(icinga2/conf.d/generic-host.conf ${CMAKE_INSTALL_SYSCONFDI
|
|||||||
install_if_not_exists(icinga2/conf.d/generic-service.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/generic-service.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
install_if_not_exists(icinga2/conf.d/generic-user.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/generic-user.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
install_if_not_exists(icinga2/conf.d/groups.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/groups.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
install_if_not_exists(icinga2/conf.d/localhost.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/hosts/localhost.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/disk.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/http.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/icinga.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/kernel.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/load.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/processes.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/ssh.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/swap.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
|
install_if_not_exists(icinga2/conf.d/hosts/localhost/users.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d/hosts/localhost)
|
||||||
install_if_not_exists(icinga2/conf.d/notifications.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/notifications.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
install_if_not_exists(icinga2/conf.d/timeperiods.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/timeperiods.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
install_if_not_exists(icinga2/conf.d/users.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/users.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
|
11
etc/icinga2/conf.d/hosts/localhost.conf
Normal file
11
etc/icinga2/conf.d/hosts/localhost.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* A host definition. You can create your own configuration files
|
||||||
|
* in the conf.d directory (e.g. one per host). By default all *.conf
|
||||||
|
* files in this directory are included.
|
||||||
|
*/
|
||||||
|
object Host "localhost" {
|
||||||
|
import "linux-server"
|
||||||
|
|
||||||
|
address = "127.0.0.1"
|
||||||
|
address6 = "::1"
|
||||||
|
}
|
@ -1,81 +0,0 @@
|
|||||||
/**
|
|
||||||
* A host definition. You can create your own configuration files
|
|
||||||
* in the conf.d directory (e.g. one per host). By default all *.conf
|
|
||||||
* files in this directory are included.
|
|
||||||
*/
|
|
||||||
object Host "localhost" {
|
|
||||||
import "linux-server"
|
|
||||||
|
|
||||||
address = "127.0.0.1"
|
|
||||||
address6 = "::1"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "icinga" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "icinga"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "http" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "http_ip"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "ssh" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "ssh"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "load" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "load"
|
|
||||||
}
|
|
||||||
|
|
||||||
object ScheduledDowntime "backup-downtime" {
|
|
||||||
import "backup-downtime"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
service_name = "load"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "processes" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "processes"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "users" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "users"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "disk" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "disk"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "swap" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "swap"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Service "kernel" {
|
|
||||||
import "generic-service"
|
|
||||||
|
|
||||||
host_name = "localhost"
|
|
||||||
check_command = "kernel"
|
|
||||||
}
|
|
@ -40,7 +40,7 @@ if [ -n "$1" ]; then
|
|||||||
|
|
||||||
if [ "$master" = "n" ]; then
|
if [ "$master" = "n" ]; then
|
||||||
while true; do
|
while true; do
|
||||||
echo -n "Upstream Icinga instance name: "
|
echo -n "Master Icinga instance name: "
|
||||||
if ! read upstream_name; then
|
if ! read upstream_name; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -91,7 +91,7 @@ if [ -n "$1" ]; then
|
|||||||
|
|
||||||
if [ "$master" = "n" ]; then
|
if [ "$master" = "n" ]; then
|
||||||
while true; do
|
while true; do
|
||||||
echo -n "Do you want this agent instance to connect to the upstream instance? [y] "
|
echo -n "Do you want this agent instance to connect to the master instance? [y] "
|
||||||
if ! read upstream_connect; then
|
if ! read upstream_connect; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -109,7 +109,7 @@ if [ -n "$1" ]; then
|
|||||||
|
|
||||||
if [ "$upstream_connect" = "y" ]; then
|
if [ "$upstream_connect" = "y" ]; then
|
||||||
while true; do
|
while true; do
|
||||||
echo -n "Upstream IP address/hostname: "
|
echo -n "Master instance IP address/hostname: "
|
||||||
if ! read upstream_host; then
|
if ! read upstream_host; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -118,11 +118,11 @@ if [ -n "$1" ]; then
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Please enter the upstream instance's hostname."
|
echo "Please enter the master instance's hostname."
|
||||||
done
|
done
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
echo -n "Upstream port: "
|
echo -n "Master instace port: "
|
||||||
if ! read upstream_port; then
|
if ! read upstream_port; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -131,7 +131,7 @@ if [ -n "$1" ]; then
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Please enter the upstream instance's port."
|
echo "Please enter the master instance's port."
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -157,14 +157,12 @@ AGENT
|
|||||||
if [ "$master" = "n" ]; then
|
if [ "$master" = "n" ]; then
|
||||||
cat >>$ICINGA2CONFIG/features-available/agent.conf <<AGENT
|
cat >>$ICINGA2CONFIG/features-available/agent.conf <<AGENT
|
||||||
upstream_name = "$upstream_name"
|
upstream_name = "$upstream_name"
|
||||||
|
|
||||||
AGENT
|
AGENT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$listener" = "y" ]; then
|
if [ "$listener" = "y" ]; then
|
||||||
cat >>$ICINGA2CONFIG/features-available/agent.conf <<AGENT
|
cat >>$ICINGA2CONFIG/features-available/agent.conf <<AGENT
|
||||||
bind_port = "$listener_port"
|
bind_port = "$listener_port"
|
||||||
|
|
||||||
AGENT
|
AGENT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -172,7 +170,6 @@ AGENT
|
|||||||
cat >>$ICINGA2CONFIG/features-available/agent.conf <<AGENT
|
cat >>$ICINGA2CONFIG/features-available/agent.conf <<AGENT
|
||||||
upstream_host = "$upstream_host"
|
upstream_host = "$upstream_host"
|
||||||
upstream_port = "$upstream_port"
|
upstream_port = "$upstream_port"
|
||||||
|
|
||||||
AGENT
|
AGENT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -183,6 +180,10 @@ AGENT
|
|||||||
echo "Enabling agent feature..."
|
echo "Enabling agent feature..."
|
||||||
@CMAKE_INSTALL_FULL_SBINDIR@/icinga2-enable-feature agent
|
@CMAKE_INSTALL_FULL_SBINDIR@/icinga2-enable-feature agent
|
||||||
|
|
||||||
|
if [ ! -e "@CMAKE_INSTALL_FULL_SYSCONFDIR@/monitoring" ]; then
|
||||||
|
ln -s $ICINGA2CONFIG/conf.d/hosts/localhost @CMAKE_INSTALL_FULL_SYSCONFDIR@/monitoring
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$master" = "n" ]; then
|
if [ "$master" = "n" ]; then
|
||||||
echo "Disabling notification feature..."
|
echo "Disabling notification feature..."
|
||||||
@CMAKE_INSTALL_FULL_SBINDIR@/icinga2-disable-feature notification
|
@CMAKE_INSTALL_FULL_SBINDIR@/icinga2-disable-feature notification
|
||||||
|
Loading…
x
Reference in New Issue
Block a user