Usando Linux para muchas cosas y disfrutando de videojuegos, en dispositivos moviles, consolas y pc. Using Linux for many things and enjoying video games, mobile devices, consoles and pc

Mostrando entradas con la etiqueta nagios configuration. Mostrar todas las entradas
Mostrando entradas con la etiqueta nagios configuration. Mostrar todas las entradas

Como crear un usuario de solo lectura en Nagios

Quieres darle acceso a una persona a Nagios pero no quieres que haga cambios? Ok, sigue leyendo y aprenderás como crear un usuario de solo lectura. Este podrá mirar (leer) pero no ejecutar comandos, deshabilitar notificaciones, etc. Una opción importante para que personas sin dominio técnico puedan entrar sin peligro de dañar algo. Quieres instalar Nagios? en este articulo te muestro paso a paso como en un Linux Centos 6.4.
Todos los comandos lo ejecutaremos desde la cuenta root y aunque es un Centos debe funcionar en otras distribuciones linux.

-Nos cambiamos al directorio de htpasswd.users
cd /usr/local/nagios/etc

-Creamos el usuario userlectura
htpasswd -m /usr/local/nagios/etc/htpasswd.users userlectura

-Nos conectamos vía web y verificamos al entrar que aunque nos muestra la interfaz, no hay datos en ella.

-Editamos cgi.cfg y agregamos el usuario. Salimos guardando.
vi cgi.cfg

authorized_for_all_services=nagiosadmin,userlectura
authorized_for_all_hosts=nagiosadmin,userlectura

-Reiniciamos el servicio.
service nagios reload

-Cerramos el browser y nos conectamos nuevamente con userlectura. Ya dentro si intentamos ejecutar alguna acción como por ejemplo deshabilitar el envió de alertas, Nagios nos sacara un error no permitiendolo.

Con esto ya tenemos un usuario de solo lectura, podrá mirar pero no modificar.
Si te resulto útil este articulo, se social, compártelo con otros por medio de los botones o sígueme en twitter google+ o email y podrás estar enterado de todas mis publicaciones.
Disfrútenlo.

Share/Bookmark

Como actualizar nagios 3 paso a paso

Hoy sale una nueva versión de Nagios, llegando a la 3.5.1, la cual corrige varios errores reportados y los desarrolladores sugieren actualizar lo mas pronto posible por lo tanto hoy les mostrare como actualizar su Nagios 3.5 a la 3.5.1 sin perder sus datos y configuración anterior.
En el proceso tomaremos un backup antes previendo algún problema podamos devolvernos así que no entremos en pánico. ;-)
No tienes Nagios?, ok, en un anterior articulo te muestro como instalarlo en un Centos 6.4 y así puedas monitorear tus dispositivos, servidores, etc.

-Hacemos un backup del nagios actual
tar czvf nagios-backup.tgz /usr/local/nagios/

-Eliminamos los siguientes html. Es muy posible que ya no existan porque fueron reemplazados por versiones en php.
rm /usr/local/nagios/share/{main,side,index}.html
rm: cannot remove `/usr/local/nagios/share/main.html': No such file or directory
rm: cannot remove `/usr/local/nagios/share/side.html': No such file or directory
rm: cannot remove `/usr/local/nagios/share/index.html': No such file or directory

-Descargamos la ultima versión estable al momento.
cd /root
wget -c http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.5.1.tar.gz

-Extraemos y entramos a su directorio
tar xzvf nagios-3.5.1.tar.gz
cd nagios

-Comenzamos a compilar
./configure --with-command-group=nagcmd
.....
*** Configuration summary for nagios 3.5.1 08-30-2013 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagcmd
            Embedded Perl:  no
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
                Lock file:  ${prefix}/var/nagios.lock
   Check result directory:  ${prefix}/var/spool/checkresults
           Init directory:  /etc/rc.d/init.d
  Apache conf.d directory:  /etc/httpd/conf.d
             Mail program:  /bin/mail
                  Host OS:  linux-gnu

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /bin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

-Compilamos
make all
....
*** Compile finished ***

If the main program and CGIs compiled without any errors, you
can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):

  make install
     - This installs the main program, CGIs, and HTML files

  make install-init
     - This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-config
     - This installs *SAMPLE* config files in /usr/local/nagios/etc
       You'll have to modify these sample files before you can
       use Nagios.  Read the HTML documentation for more info
       on doing this.  Pay particular attention to the docs on
       object configuration files, as they determine what/how
       things get monitored!

  make install-webconf
     - This installs the Apache config file for the Nagios
       web interface

  make install-exfoliation
     - This installs the Exfoliation theme for the Nagios
       web interface

  make install-classicui
     - This installs the classic theme for the Nagios
       web interface


*** Support Notes *******************************************

If you have questions about configuring or running Nagios,
please make sure that you:

     - Look at the sample config files
     - Read the documentation on the Nagios Library at:
           http://library.nagios.com

before you post a question to one of the mailing lists.
Also make sure to include pertinent information that could
help others help you.  This might include:

     - What version of Nagios you are using
     - What version of the plugins you are using
     - Relevant snippets from your config files
     - Relevant error messages from the Nagios log file

For more information on obtaining support for Nagios, visit:

       http://support.nagios.com

*************************************************************

Enjoy.

-Instalamos los binarios
make install
....
*** Main program, CGIs and HTML files installed ***

You can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):

  make install-init
     - This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-config
     - This installs sample config files in /usr/local/nagios/etc

make[1]: Leaving directory `/root/nagios'

-Verificamos este todo ok
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
...
Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

-Reiniciamos el servicio
service nagios restart
Running configuration check...done.
Stopping nagios: .done.
Starting nagios: done.

-Abrimos un browser y nos conectamos a su interfaz web.

-Perfecto, todos nuestros dispositivos están disponibles y no perdimos configuración.


Que les pareció, rápido y certero, cierto? Ya usas Nagios, que te ha parecido?
Si te resulto útil este articulo, se social, compártelo con otros por medio de los botones o sígueme en twitter google+ o email y podrás estar enterado de todas mis publicaciones.
Disfrútenlo.

Share/Bookmark