Mostrando entradas con la etiqueta centos. Mostrar todas las entradas
Mostrando entradas con la etiqueta centos. Mostrar todas las entradas

3 ene 2019

PART 2. Installing Nagios Core on CentOS 7 Minimal



In this article we are going to prepare our CentOS 7 VM for Nagios Core installation and perform the installation itself. Then we're going to try a simple check.

NAGIOS AND PLUGINS INSTALLATION

1. First of all, we will need to disable Selinux module:



2. Install all the needed dependencies, including web server, php libaries, ssl libraries, etc:



3. Once done, we are going to add nagios user and group, then we assign nagios group to nagios and apache user:


4. Download Nagios Core and Nagios Plugins package and uncompress them:





5. Once uncompressed, we're compiling Nagios Core and correspondant plugins:




6. Afterwards we are going to create a password in order to being able to acces web interface:


7. After compiling Nagios plugins we're starting the web server and nagios daemon itself:


8. If we cannot access the web server on this stage, we will need to open port 80 on the Nagios machine using the next command:


9. The web page is going to request the password defined in previous steps:



10. Now, if we go to "Tactical overview" we can see the Nagios server itself wich is defined as "localhost". From there we can also see the status of its different services:





DEFINING A NEW HOST

In this step we are going to define a new host which is going to be our Windows 10 machine.

1. Uncomment the "servers" directory line in nagios.cfg file:


2. Create host configuration file in /usr/local/nagios/etc/objects/servers directory:


3. Configure static IP@ on monitord machine:



 4. Define monitored host like in the next example and restart nagios service:


The most important parameters are the address, which is the IP@ of our machine, check_command and the other ones which detailed description you can find on official nagios core web site.


5. Now we are able to see the new host in "tactical overview" tab in our web interface, however pending for now:


6. Configure NTP server in order to show time/date correctly:

Update repositories, install NTP package, set the timezone and check the date:




7. Finally enable http, nagios and ntpd service to launch automatically on startup:


That's it for now. Hope you enjoyed this article and see you soon! :) Happy New Nerdy Year!

30 sept 2015

Servidor DHCP en CentOS 7


CentOS es una distribución gratuita de Linux proveniente de RedHat y se emplea con frecuencia en el entorno empresarial. Por ello ha sido elegida en este artículo.

1. Configuramos la interfaz de red

Al arrancar el sistema, tecleamos su para entrar en modo root e introducimos la contraseña del superusuario.




a) Comprobamos el nombre de nuestra interfaz.

De manera predeterminada no tiene configuración alguna, por ello para poder utilizar los repositorios primero hay que configurar la conexión a internet.

Comprobamos el nombre de nuestra interfaz ejecutando ip a. Normalmente tendremos una loopback y otra ethernet, que se corresponden con la misma interfaz física. 


En mi caso la interfaz que necesitamos es la enp0s3.

El fichero de configuración de la interfaz se encuentra en /etc/sysconfig/network-scripts/ifcfg-enp0s3, donde enp0s3 es el nombre de vuestra interfaz. Ejecutamos vi /etc/sysconfig/network-scripts/ifcfg-enp0s3


Tenemos que cambiar el parametro ONBOOT a yes.


Iniciamos el servicio de red ejecutando service network start:


Es posible que haya que reiniciar la máquina mediante un reboot.
Mediante ip a comprobamos que nuestra interfaz ya tiene asignada una IP.



2. Actualizamos los repositorios e instalamos el servidor DHCP

Ejecutamos yum update y esperamos a que terminen de actualizarse los repositorios.


Ejecutamos yum install dhcp y confirmamos en caso necesario.


3. Asignamos una IP estática al servidor

Nuestra red va a ser una privada de clase A con la dirección de red 10.0.0.0 y máscara 255.0.0.0; Asignaremos 10.0.0.1 al servidor.
Vamos al fichero /etc/sysconfig/network-scripts/ifcfg-enp0s3 donde enp0s3 es el nombre de vuestra interfaz.

Indicamos en una nueva línea la dirección IP fija y su máscara correspondiente con IPADDR=ip y NETMASK=máscara. Además cambiaremos BOOTPROTO a none.


Salimos y guardamos cambios.

Ejecutamos ifdown enp0s3 && ifup enp0s3 para que coja la configuración y comprobamos que lo ha hecho correctamente con un ip a:


4. Configuramos el servidor

Abrimos /etc/sysconfig/dhcpd en modo administrador. Voy a emplear el editor de texto VI. La configuración es prácticamente la misma que en ISC DHCP que instalamos en Ubuntu Server.


Con los siguientes comandos iniciamos el servicio DHCP y hacemos que se inicie automáticamente en el arranque del sistema:


5. Prueba con Windows 7