Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding base nagios packages

  • Loading branch information...
commit f14c28f72c14d96c447222f09793bf4314e2dd64 1 parent 6baa908
@chischaschos authored
View
28 provisioning/roles/nagios/tasks/main.yml
@@ -0,0 +1,28 @@
+---
+- name: install nagios dependencies
+ action: apt pkg={{ item }} state=present
+ with_items:
+ - python-passlib
+ - fcgiwrap
+ - php5-fpm
+ - nagios3
+ - nagios-nrpe-plugin
+ - nagios-nrpe-server
+
+- name: Configure nginx for nagios
+ template: src=etc_nginx_sites-available_nagios.conf.j2 dest=/etc/nginx/sites-available/nagios group=www-data owner=www-data force=yes
+
+- name: Add nagios user
+ htpasswd: path=/etc/nagios3/htpasswd.users name=admin password=admin state=present
+
+- name: Enable the nginx's nagios
+ command: ln -fs /etc/nginx/sites-available/nagios /etc/nginx/sites-enabled/nagios
+
+- name: Restart nagios-nrpe-server
+ service: name=nagios-nrpe-server state=restarted
+
+- name: Restart nagios3
+ service: name=nagios3 state=restarted
+
+- name: Restart nginx
+ action: service name=nginx state=restarted
View
42 provisioning/roles/nagios/templates/etc_nginx_sites-available_nagios.conf.j2
@@ -0,0 +1,42 @@
+server {
+ listen 8080;
+
+ access_log /var/log/nginx/nagios.access.log;
+ error_log /var/log/nginx/nagios.error.log info;
+
+ expires 31d;
+
+ root /usr/share/nagios3/htdocs;
+ index index.php index.html;
+
+ auth_basic "Nagios Restricted Access";
+ auth_basic_user_file /etc/nagios3/htpasswd.users;
+
+ location /nagios3 {
+ alias /usr/share/nagios3/htdocs/;
+ }
+
+ location /stylesheets {
+ alias /etc/nagios3/stylesheets;
+ }
+
+ location ~ \.cgi$ {
+ root /usr/lib/cgi-bin/nagios3;
+
+ rewrite ^/cgi-bin/nagios3/(.*)$ /$1;
+
+ include /etc/nginx/fastcgi_params;
+
+ fastcgi_param AUTH_USER $remote_user;
+ fastcgi_param REMOTE_USER $remote_user;
+ fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name;
+
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ }
+
+ location ~ \.php$ {
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass localhost:9000;
+ }
+
+}
View
4 provisioning/roles/webserver/tasks/deploy.yml
@@ -4,7 +4,7 @@
action: apt update_cache=yes upgrade=yes
- name: install ruby dependencies
- action: apt pkg={{item}} state=installed
+ action: apt pkg={{item}} state=present
with_items:
- build-essential
- automake
@@ -29,8 +29,6 @@
action: apt pkg={{item}} state=installed
with_items:
- libpq-dev
- - nodejs
- - imagemagick
tags: package
# Install correct version of ruby from source
View
1  provisioning/site.yml
@@ -8,6 +8,7 @@
roles:
- webserver
- database
+ - nagios
handlers:
- name: restart puma
Please sign in to comment.
Something went wrong with that request. Please try again.