add option to exclude hosts from public status page

This commit is contained in:
Franzi 2023-05-21 06:59:34 +02:00
parent b35bfc85e9
commit 9fc0004746
Signed by: kunsi
GPG key ID: 12E3D2136B818350
10 changed files with 18 additions and 16 deletions

View file

@ -33,3 +33,11 @@ object ServiceGroup "checks_with_sms" {
assign where service.vars.notification.sms == true assign where service.vars.notification.sms == true
ignore where host.vars.notification.sms == false ignore where host.vars.notification.sms == false
} }
object ServiceGroup "statuspage" {
display_name = "Checks which are show on the public status page"
assign where service.vars.notification.sms == true
ignore where host.vars.notification.sms == false
ignore where host.vars.show_on_statuspage == false
}

View file

@ -14,7 +14,8 @@ object Host "${rnode.name}" {
vars.os = "${rnode.os}" vars.os = "${rnode.os}"
# used for status page # used for status page
vars.pretty_name = "${rnode.metadata.get('icinga_options/pretty_name', rnode.name)}" vars.pretty_name = "${rnode.metadata.get('icinga_options/pretty_name', rnode.metadata.get('hostname'))}"
vars.show_on_statuspage = ${str(rnode.metadata.get('icinga_options/show_on_statuspage', True)).lower()}
vars.period = "${rnode.metadata.get('icinga_options/period', '24x7')}" vars.period = "${rnode.metadata.get('icinga_options/period', '24x7')}"

View file

@ -78,6 +78,7 @@ groups['home'] = {
'home.router', 'home.router',
}, },
'vars.notification.sms': False, 'vars.notification.sms': False,
'show_on_statuspage': False,
}, },
'postfix': { 'postfix': {
# It's fine to do this without authentificating to the relayhost. # It's fine to do this without authentificating to the relayhost.
@ -117,6 +118,9 @@ groups['voc'] = {
'day': 1, 'day': 1,
}, },
}, },
'icinga_options': {
'show_on_statuspage': False,
},
'location': 'voc', 'location': 'voc',
}, },
} }

View file

@ -3,7 +3,7 @@ dummy = true
[metadata.icinga_options] [metadata.icinga_options]
period = "daytime" period = "daytime"
pretty_name = "ticket.gulas.ch" show_on_statuspage = false
[metadata.icinga2_api.nginx.services."NGINX VHOST ticket-redirect CERTIFICATE"] [metadata.icinga2_api.nginx.services."NGINX VHOST ticket-redirect CERTIFICATE"]
check_command = "check_https_cert_at_url" check_command = "check_https_cert_at_url"

View file

@ -44,7 +44,8 @@ nodes['htz-cloud.influxdb'] = {
'login_max_duration': '30d', 'login_max_duration': '30d',
}, },
'icinga_options': { 'icinga_options': {
'pretty_name': 'InfluxDB', # no public access
'show_on_statuspage': False,
}, },
'nginx': { 'nginx': {
'vhosts': { 'vhosts': {

View file

@ -12,9 +12,6 @@ ips = [
gateway4 = "46.101.80.1" gateway4 = "46.101.80.1"
gateway6 = "2a03:b0c0:1:d0::1" gateway6 = "2a03:b0c0:1:d0::1"
[metadata.icinga_options]
pretty_name = "ns-ghirahim.kunbox.net"
[metadata.postfix] [metadata.postfix]
# It's fine to do this without authentificating to the relayhost. # It's fine to do this without authentificating to the relayhost.
# These Systems are not supposed to send mail anywhere else # These Systems are not supposed to send mail anywhere else

View file

@ -17,9 +17,6 @@ ips = [
gateway4 = "10.255.255.1" gateway4 = "10.255.255.1"
gateway6 = "fe80::250:56ff:fea8:628f" gateway6 = "fe80::250:56ff:fea8:628f"
[metadata.icinga_options]
pretty_name = "ns-mephisto.kunbox.net"
[metadata.nginx.vhosts.powerdnsadmin] [metadata.nginx.vhosts.powerdnsadmin]
domain = "ns-mephisto.kunbox.net" domain = "ns-mephisto.kunbox.net"

View file

@ -127,7 +127,7 @@ nodes['ovh.icinga2'] = {
'password': vault.password_for('ovh.icinga2 icinga2 api_user dashboard'), 'password': vault.password_for('ovh.icinga2 icinga2 api_user dashboard'),
}, },
'filters': { 'filters': {
'services': '"checks_with_sms" in service.groups', 'services': '"statuspage" in service.groups',
}, },
'output': { 'output': {
'page_title': 'franzi.business Service Status', 'page_title': 'franzi.business Service Status',

View file

@ -22,9 +22,6 @@ nodes['voc.infobeamer-cms'] = {
'gateway6': '2001:67c:20a0:e::1', 'gateway6': '2001:67c:20a0:e::1',
}, },
}, },
'icinga_options': {
'pretty_name': 'infobeamer-cms.c3voc.de',
},
'infobeamer-cms': { 'infobeamer-cms': {
'domain': 'infobeamer-cms.c3voc.de', 'domain': 'infobeamer-cms.c3voc.de',
'event_start_date': '2023-04-07', 'event_start_date': '2023-04-07',

View file

@ -35,9 +35,6 @@ nodes['voc.pretalx'] = {
'gateway6': '2a01:a700:48d1::1', 'gateway6': '2a01:a700:48d1::1',
}, },
}, },
'icinga_options': {
'pretty_name': 'pretalx.c3voc.de',
},
'nginx': { 'nginx': {
'vhosts': { 'vhosts': {
'pretalx': { 'pretalx': {