Skip to content

Instantly share code, notes, and snippets.

@flaudisio
Created January 28, 2012 18:23
Show Gist options
  • Save flaudisio/1695347 to your computer and use it in GitHub Desktop.
Save flaudisio/1695347 to your computer and use it in GitHub Desktop.
Nagios - Compilação e Instalação (básico)
#!/bin/sh
#
# Nagios - Compilação e Instalação (básico)
#
# Variáveis
USUARIO=nagios
GRUPO=nagios
GRUPOCMD=nagioscmd
USUARIOAPACHE=www-data
# Grupos e Usuário
groupadd $GRUPO
groupadd $GRUPOCMD
useradd -c "Nagios Control User" -d /usr/local/nagios -M -s /bin/bash -g $GRUPO $USUARIO
# Configuração
./configure --prefix=/usr/local/nagios --with-nagios-user=$USUARIO --with-nagios-group=$GRUPO --with-command-user=$USUARIO --with-command-group=$GRUPOCMD --with-httpd-conf=/etc/apache2/conf.d
# Compilação
JOBS=$(expr `cat /proc/cpuinfo | grep 'model name' | wc -l` \* 2)
make all -j$JOBS
###### Patch para evitar Erro 2 na Instalação ######
sed -i 's:for file in includes/rss/\*;:for file in includes/rss/\*.\*;:g' ./html/Makefile
sed -i 's:for file in includes/rss/extlib/\*;:for file in includes/rss/extlib/\*.\*;:g' ./html/Makefile
#####################################################
# Instalação
make install
make install-init
make install-config
make install-commandmode
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment