ok lets try and make the nagios config a bit better
This commit is contained in:
parent
f77e558d0e
commit
9ad5a3666c
6 changed files with 52 additions and 50 deletions
|
@ -31,12 +31,6 @@
|
||||||
path: /nagios
|
path: /nagios
|
||||||
target: https://nagios.fedoraproject.org/nagios/
|
target: https://nagios.fedoraproject.org/nagios/
|
||||||
|
|
||||||
- role: httpd/redirect
|
|
||||||
name: nagios-external
|
|
||||||
website: admin.fedoraproject.org
|
|
||||||
path: /nagios-external
|
|
||||||
target: https://nagios.fedoraproject.org/nagios-external/
|
|
||||||
|
|
||||||
- role: httpd/redirect
|
- role: httpd/redirect
|
||||||
name: docs
|
name: docs
|
||||||
website: fedoraproject.org
|
website: fedoraproject.org
|
||||||
|
|
|
@ -44,13 +44,6 @@
|
||||||
remotepath: /nagios/
|
remotepath: /nagios/
|
||||||
proxyurl: http://noc01.phx2.fedoraproject.org
|
proxyurl: http://noc01.phx2.fedoraproject.org
|
||||||
|
|
||||||
- role: httpd/reverseproxy
|
|
||||||
website: nagios.fedoraproject.org
|
|
||||||
destname: nagios-external
|
|
||||||
localpath: /nagios-external
|
|
||||||
remotepath: /nagios-external/
|
|
||||||
proxyurl: http://noc02.fedoraproject.org
|
|
||||||
|
|
||||||
- role: httpd/reverseproxy
|
- role: httpd/reverseproxy
|
||||||
website: lists.fedoraproject.org
|
website: lists.fedoraproject.org
|
||||||
destname: mailman3
|
destname: mailman3
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
# noc1
|
# noc1
|
||||||
ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
||||||
|
|
||||||
# noc2
|
|
||||||
ScriptAlias /nagios-external/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
|
||||||
|
|
||||||
# test
|
|
||||||
ScriptAlias /nagios-just-a-test/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
|
||||||
|
|
||||||
ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
||||||
|
|
||||||
<Location />
|
<Location />
|
||||||
|
@ -19,7 +13,7 @@ ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
||||||
Require valid-user
|
Require valid-user
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
<Location ~ "/(nagios|nagios-external|nagios-just-a-test)/cgi-bin/">
|
<Location ~ "/(nagios)/cgi-bin/">
|
||||||
Options ExecCGI
|
Options ExecCGI
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
|
@ -27,10 +21,8 @@ ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
||||||
Options None
|
Options None
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
RewriteEngine on
|
||||||
|
RewriteRule ^/$ /nagios/ [R]
|
||||||
|
|
||||||
Alias /nagios /usr/share/nagios/html/
|
Alias /nagios /usr/share/nagios/html/
|
||||||
|
|
||||||
# This will only affect noc2 because the proxies only forward -external to it.
|
|
||||||
Alias /nagios-external /usr/share/nagios/html/
|
|
||||||
|
|
||||||
# Test
|
|
||||||
Alias /nagios-test /usr/share/nagios/html/
|
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
# noc1
|
# noc1
|
||||||
ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
||||||
|
|
||||||
# noc2
|
|
||||||
ScriptAlias /nagios-external/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
|
||||||
|
|
||||||
# test
|
|
||||||
ScriptAlias /nagios-just-a-test/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
|
||||||
|
|
||||||
ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
||||||
|
|
||||||
<Location />
|
<Location />
|
||||||
|
@ -19,7 +13,7 @@ ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
||||||
Require valid-user
|
Require valid-user
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
<Location ~ "/(nagios|nagios-external|nagios-just-a-test)/cgi-bin/">
|
<Location ~ "/(nagios)/cgi-bin/">
|
||||||
Options ExecCGI
|
Options ExecCGI
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
|
@ -32,8 +26,3 @@ RewriteRule ^/$ /nagios/ [R]
|
||||||
|
|
||||||
Alias /nagios /usr/share/nagios/html/
|
Alias /nagios /usr/share/nagios/html/
|
||||||
|
|
||||||
# This will only affect noc2 because the proxies only forward -external to it.
|
|
||||||
Alias /nagios-external /usr/share/nagios/html/
|
|
||||||
|
|
||||||
# Test
|
|
||||||
Alias /nagios-test /usr/share/nagios/html/
|
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
with_items:
|
with_items:
|
||||||
- php
|
- php
|
||||||
- nagios.x86_64
|
- nagios.x86_64
|
||||||
|
- nagios-selinux
|
||||||
|
- nrpe-selinux
|
||||||
- nagios-plugins
|
- nagios-plugins
|
||||||
- nagios-plugins-dig
|
- nagios-plugins-dig
|
||||||
- nagios-plugins-disk
|
- nagios-plugins-disk
|
||||||
|
@ -78,19 +80,6 @@
|
||||||
- nagios_server
|
- nagios_server
|
||||||
|
|
||||||
## Copy over system configs
|
## Copy over system configs
|
||||||
# TODO: Make this a template once they're closer together
|
|
||||||
- name: Copy httpd config (production)
|
|
||||||
copy: src=httpd/nagios.conf dest=/etc/httpd/conf.d/nagios.conf
|
|
||||||
when: env == "production"
|
|
||||||
tags:
|
|
||||||
- nagios_server
|
|
||||||
|
|
||||||
- name: Copy httpd config (staging)
|
|
||||||
copy: src=httpd/nagios-new.conf dest=/etc/httpd/conf.d/nagios.conf
|
|
||||||
when: env == "staging"
|
|
||||||
tags:
|
|
||||||
- nagios_server
|
|
||||||
|
|
||||||
- name: Copy specialized nrpe.cfg for nagios server
|
- name: Copy specialized nrpe.cfg for nagios server
|
||||||
copy: src=nrpe/nrpe.cfg dest=/etc/nagios/nrpe.cfg mode=0644 group=root owner=root
|
copy: src=nrpe/nrpe.cfg dest=/etc/nagios/nrpe.cfg mode=0644 group=root owner=root
|
||||||
notify:
|
notify:
|
||||||
|
@ -265,6 +254,11 @@
|
||||||
|
|
||||||
## Build template files
|
## Build template files
|
||||||
# This one may go to being just a regular config file if we can make remote monitoring work
|
# This one may go to being just a regular config file if we can make remote monitoring work
|
||||||
|
- name: Template out the nagios httpd conf
|
||||||
|
template: src=httpd/nagios.conf.j2 dest=/etc/httpd/conf.d/nagios.conf
|
||||||
|
tags:
|
||||||
|
- nagios_server
|
||||||
|
|
||||||
- name: Template out the cgi.cfg
|
- name: Template out the cgi.cfg
|
||||||
template: src=nagios/configs/cgi.cfg.j2 dest=/etc/nagios/cgi.cfg mode=0644 owner=root group=root
|
template: src=nagios/configs/cgi.cfg.j2 dest=/etc/nagios/cgi.cfg mode=0644 owner=root group=root
|
||||||
tags:
|
tags:
|
||||||
|
|
40
roles/nagios_server/templates/httpd/nagios.conf.j2
Normal file
40
roles/nagios_server/templates/httpd/nagios.conf.j2
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
# noc1
|
||||||
|
ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/
|
||||||
|
|
||||||
|
ScriptAlias /tac.cgi /usr/lib64/nagios/cgi-bin/tac.cgi
|
||||||
|
|
||||||
|
<Location />
|
||||||
|
AuthName "Nagios GSSAPI Login"
|
||||||
|
{% if env == "production" %}
|
||||||
|
{% if vars['nagios_location'] == 'internal' %}
|
||||||
|
GssapiCredStore keytab:/etc/krb5.HTTP_nagios.fedoraproject.org.keytab
|
||||||
|
{% else %}
|
||||||
|
GssapiCredStore keytab:/etc/krb5.HTTP_nagios-external.fedoraproject.org.keytab
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% if vars['nagios_location'] == 'internal' %}
|
||||||
|
GssapiCredStore keytab:/etc/krb5.HTTP_nagios.stg.fedoraproject.org.keytab
|
||||||
|
{% else %}
|
||||||
|
GssapiCredStore keytab:/etc/krb5.HTTP_nagios-external.stg.fedoraproject.org.keytab
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
AuthType GSSAPI
|
||||||
|
# This is off because Apache (and thus mod_auth_gssapi) doesn't know this is proxied over TLS
|
||||||
|
GssapiSSLonly Off
|
||||||
|
GssapiLocalName on
|
||||||
|
Require valid-user
|
||||||
|
</Location>
|
||||||
|
|
||||||
|
<Location ~ "/(nagios)/cgi-bin/">
|
||||||
|
Options ExecCGI
|
||||||
|
</Location>
|
||||||
|
|
||||||
|
<Directory "/usr/share/nagios/html">
|
||||||
|
Options None
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
RewriteEngine on
|
||||||
|
RewriteRule ^/$ /nagios/ [R]
|
||||||
|
|
||||||
|
Alias /nagios /usr/share/nagios/html/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue