define service {
  hostgroup_name        proxies
  service_description   http-ipsilon
  check_command         check_website_ssl!id.fedoraproject.org!/!your Fedora Account
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-fedoraproject.org
  check_command         check_website!fedoraproject.org!/!https://fedoraproject.org/
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-fedoraproject.org-hotspot.txt
  check_command         check_website!fedoraproject.org!/static/hotspot.txt!OK
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-fedoraproject.org-wiki
  check_command         check_website_ssl!fedoraproject.org!/wiki/Fedora_Project_Wiki!Looking for help
  max_check_attempts    10
  use                   websitetemplate
  servicegroups		fp-wiki
}

define service {
  hostgroup_name        proxies
  service_description   http-fedoraproject.org-wiki-non-cached
  check_command         check_website_ssl!fedoraproject.org!/wiki/Special:Version!MediaWiki is free software
  max_check_attempts    10
  use                   websitetemplate
  servicegroups		fp-wiki-non-cached
}

define service {
  hostgroup_name        proxies
  service_description   http-mirrors.fedoraproject.org-mirrorlist
  check_command         check_website!mirrors.fedoraproject.org!/mirrorlist?repo=rawhide&arch=x86_64&country=global!development
  use                   websitetemplate
  servicegroups		mirrorlist
}

define service {
  hostgroup_name        proxies
  service_description   http-docs.fedoraproject.org
  check_command         check_website_ssl!docs.fedoraproject.org!/en-US/docs/index.html!Antora
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies_ocp4
  service_description   http-accounts
  check_command         check_website_ssl!accounts.fedoraproject.org!/healthz/ready!OK
  use                   websitetemplate
#  servicegroups		fas
}

define service {
  hostgroup_name        proxies_ocp4
  service_description   http-bodhi
  check_command         check_website_ssl!bodhi.fedoraproject.org!/!Fedora
  max_check_attempts    8
  use                   websitetemplate
  servicegroups		bodhi
}

define service {
  hostgroup_name        proxies_ocp4
  service_description   http-bodhi2
  check_command         check_website_ssl!bodhi.fedoraproject.org!/!Active Testers
  max_check_attempts    8
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-koschei
  check_command         check_website_ssl!koschei.fedoraproject.org!/!Package summary
  max_check_attempts    8
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-moby-registry
  check_command         check_website_ssl!registry.fedoraproject.org!/v2/!{}
  max_check_attempts    8
  use                   websitetemplate
}

define service {
  host_name		registry-cdn
  service_description   http-moby-registry-cdn
  check_command         check_website_ssl!cdn.registry.fedoraproject.org!/v2/!{}
  max_check_attempts    8
  use                   websitetemplate
}

define service {
  host_name             proxy01.fedoraproject.org, proxy10.fedoraproject.org
  service_description   http-oci-registry-api
  check_command         check_website_ssl!registry.fedoraproject.org!/v2/_catalog!fedora
  use                   websitetemplate
}

define service {
  host_name             proxy01.fedoraproject.org, proxy10.fedoraproject.org
  service_description   http-oci-registry-webui
  check_command         check_website_ssl!registry.fedoraproject.org!/repo/fedora/tags/!rawhide
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-mbs
  check_command         check_website_ssl!mbs.fedoraproject.org!/module-build-service/1/component-builds/!items
  max_check_attempts    8
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-odcs
  check_command         check_website_ssl!odcs.fedoraproject.org!/api/1/composes/!result_repofile
  max_check_attempts    8
  use                   websitetemplate
}

# Some openshift apps
define service {
  hostgroup_name        proxies
  service_description   http-waiverdb
  check_command         check_website_ssl!waiverdb-web-waiverdb.apps.ocp.fedoraproject.org!/api/v1.0/waivers/!first
  max_check_attempts    8
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies
  service_description   http-greenwave
  check_command         check_website_ssl!greenwave-web-greenwave.apps.ocp.fedoraproject.org!/api/v1.0/policies!bodhi_update_push_stable
  max_check_attempts    8
  use                   websitetemplate
}

##
## Individual hosts

define service {
  host_name             status
  service_description   http-status.fedoraproject.org
  check_command         check_website_ssl!www.fedorastatus.org!/index.html!Fedora Infrastructure Status
  use                   websitetemplate
}

define service {
  host_name             lists.fedoraproject.org
  service_description   http-lists.fedoraproject.org
  check_command         check_website_ssl!lists.fedoraproject.org!/archives/!Fedora Mailing-Lists
  use                   websitetemplate
}

{% if vars['nagios_location'] == 'iad2_internal' %}
##
## Other Frontend Websites

define service {
  hostgroup_name        badges_web
  service_description   http-badges.fedoraproject.org-tahrir
  check_command         check_website!localhost!/!Tahrir
  use                   websitetemplate
  event_handler         restart_httpd
}

define service {
  hostgroup_name        moby_registry
  service_description   http-moby-registry
  check_command         check_website!localhost:5000!/v2/!{}
  max_check_attempts    8
  use                   internalwebsitetemplate
}

#define service {
#  hostgroup_name        fas
#  service_description   http-accounts
#  check_command         check_website!localhost!/accounts/help/get_help/user_telephone!emergency
#  use                   internalwebsitetemplate
#  servicegroups		fas
#}

define service {
  hostgroup_name        github2fedmsg
  service_description	http-github2fedmsg-internal
  check_command		check_website!localhost!/github2fedmsg/!stuff
  max_check_attempts	8
  use			internalwebsitetemplate
  event_handler         restart_httpd
}

define service {
  hostgroup_name        ipa
  service_description   http-ipa-internal
  check_command         check_website!localhost!/ipa/ui/!Identity Management
  max_check_attempts    8
  use                   internalwebsitetemplate
  event_handler         restart_httpd
}

define service {
  hostgroup_name        ocp_workers
  service_description   http-koschei-internal
  check_command         check_website_ssl!koschei.fedoraproject.org!/!Package summary
  max_check_attempts    8
  use                   internalwebsitetemplate
}

define service {
  hostgroup_name        mm_frontend
  service_description   http-mm-publiclist-internal
  check_command         check_website_publiclist!localhost!/mirrormanager/api/mirroradmins/?name=dl.fedoraproject.org
  use                   internalwebsitetemplate
  event_handler         restart_httpd
}

define service {
  hostgroup_name        proxies_ocp4
  service_description   http-fmn-web
  check_command         check_website_ssl!notifications.fedoraproject.org!/!FMN
  use                   websitetemplate
}

define service {
  hostgroup_name        proxies_ocp4
  service_description   http-fmn-api
  check_command         check_website_ssl!fmn-api.apps.ocp.fedoraproject.org!/api/v1/healthz/ready!OK
  use                   websitetemplate
}

#define service {
#  hostgroup_name	packages
#  service_description	http-packages-internal
#  check_command		check_website!localhost!/packages/!Packages
#  max_check_attempts	8
#  use			internalwebsitetemplate
#  event_handler         restart_httpd
#}
#
#define service {
#  hostgroup_name        packages
#  service_description   http-packages-internal-bugstab
#  check_command         check_website!localhost!/packages/fcomm_connector/bugzilla/query/query_bugs/%7B%22filters%22:%7B%22package%22:%22nethack%22,%22version%22:%22%22%7D,%22rows_per_page%22:10,%22start_row%22:0%7D!total_rows
#  max_check_attempts    8
#  use                   internalwebsitetemplate
#  # When this thing dies, you usually just need to nuke /var/cache/fedoracommunity/bugzillacookies
#  #event_handler         nuke_bugzillacookies_handler
#}


define service {
  hostgroup_name        pkgs
  service_description   http-pkgs-pagure
  check_command         check_website_follow!localhost!/rpms/moreutils!The moreutils rpms
  use                   websitetemplate
}

define service {
  hostgroup_name        sundries
  service_description   http-freemedia-internal
  check_command         check_website!localhost!/freemedia/FreeMedia-form.html!Media
  use                   internalwebsitetemplate
  servicegroups         freemedia
}


## Internal services

define service {
  hostgroup_name        koji
  service_description   http-koji
  check_command         check_website!koji.fedoraproject.org!/koji/hosts!fedoraproject.org
  use                   websitetemplate
}

define service {
  hostgroup_name        koji
  service_description   http-koji-frontend
  check_command         check_website_ppc!localhost!/koji/!Recent
  use                   ppc-secondarytemplate
}

## Auxillary to websites but necessary to make them happen

{% endif %}

{% if vars['nagios_location'] == 'iad2_internal' %}

define service {
  host_name             mailman01.iad2.fedoraproject.org
  service_description   http-mailman-internal
  check_command         check_website!mailman01.iad2.fedoraproject.org!/archives/!Fedora Mailing-Lists
  use                   websitetemplate
}

{% endif %}

define service {
  host_name             copr-be
  service_description   http-download.copr.fedorainfracloud.org
  check_command         check_website_ssl!download.copr.fedorainfracloud.org!/!Index of /
  max_check_attempts    8
  use                   websitetemplate
}

define service {
  host_name             pagure02.fedoraproject.org
  service_description   https://pagure.io/fedora-infrastructure/issues
  check_command         check_website_follow!pagure02.fedoraproject.org!https://pagure.io/fedora-infrastructure/issues!Issues
  max_check_attempts    8
  use                   websitetemplate
}
