tecnologia:red:monitorizacion
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tecnologia:red:monitorizacion [2021/11/22 23:31] – jose | tecnologia:red:monitorizacion [2021/11/23 00:13] (current) – jose | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Instalación Raspberry ====== | + | Usaremos |
| - | Descargamos la imagen de raspberry: | + | |
| - | + | ||
| - | https:// | + | |
| - | + | ||
| - | He descargado la lite. | + | |
| - | + | ||
| - | La planchamos en una micro SD que no esté montada: | + | |
| - | dd if=2021-10-30-raspios-bullseye-armhf-lite.img of=/ | + | |
| - | Tarda en mi portátil unos 50 segundos: | + | |
| - | < | + | |
| - | 466+0 records in | + | |
| - | 466+0 records out | + | |
| - | 1954545664 bytes (2.0 GB, 1.8 GiB) copied, 50.1178 s, 39.0 MB/s | + | |
| - | + | ||
| - | real 0m50.120s | + | |
| - | user 0m0.001s | + | |
| - | sys 0m1.786s | + | |
| - | </ | + | |
| - | + | ||
| - | Para poder conectarnos sin necesidad de teclado ni pantalla, le damos IP y configuramos SSH: | + | |
| - | + | ||
| - | Nos ha creado dos particiones: | + | |
| - | * boot | + | |
| - | * rootfs | + | |
| - | + | ||
| - | ===== IP Fija ===== | + | |
| - | Pondremos una IP del rango admin del EKO, que es 192.168.0.x \\ | + | |
| - | Por ejemplo 192.168.0.10 | + | |
| - | + | ||
| - | Editamos el fichero: | + | |
| - | rootfs/ | + | |
| - | < | + | |
| - | interface eth0 | + | |
| - | static ip_address=192.168.0.10/ | + | |
| - | static routers=192.168.0.1 | + | |
| - | static domain_name_servers=8.8.8.8 | + | |
| - | </ | + | |
| - | + | ||
| - | ===== Habilitar SSH ===== | + | |
| - | Creamos un fichero que se llame ssh en la partición boot. Da igual que esté vacio. Podemos hacer: | + | |
| - | touch boot/ssh | + | |
| - | + | ||
| - | Metemos la tarjeta en la Raspberry y la arrancamos. Tarda un poco al ser la primera vez porque hace resize de tarjeta, inicia servicios.... | + | |
| - | + | ||
| - | Conectamos por ssh y cambiamos timezone: | + | |
| - | timedatectl set-timezone Europe/ | + | |
| - | + | ||
| - | ====== Instalación de LibreMS ====== | + | |
| - | Fuente: https:// | + | |
| - | + | ||
| - | Como root: | + | |
| - | apt install acl curl composer fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-gmp php7.4-json php7.4-mbstring php7.4-mysql php7.4-snmp php7.4-xml php7.4-zip python3-dotenv python3-pip python3-pymysql python3-redis python3-setuptools python3-systemd rrdtool snmp snmpd whois | + | |
| - | + | ||
| - | useradd librenms -d / | + | |
| - | + | ||
| - | cd /opt | + | |
| - | git clone https:// | + | |
| - | + | ||
| - | chown -R librenms: | + | |
| - | chmod 771 / | + | |
| - | setfacl -d -m g::rwx / | + | |
| - | setfacl -R -m g::rwx / | + | |
| - | + | ||
| - | Cambiamos a usuario librenms | + | |
| - | su - librenms | + | |
| - | Ejecutamos script: | + | |
| - | ./ | + | |
| - | Volvemos a root | + | |
| - | exit | + | |
| - | Cambiamos timezone en php: | + | |
| - | vi / | + | |
| - | vi / | + | |
| - | En la sección [Date] cambiamos | + | |
| - | [Date] | + | |
| - | ; Defines the default timezone used by the date functions | + | |
| - | ; http:// | + | |
| - | ; | + | |
| - | + | ||
| - | Por: | + | |
| - | date.timezone = Europe/ | + | |
| - | + | ||
| - | Configuración BBDD: | + | |
| - | + | ||
| - | vi / | + | |
| - | + | ||
| - | En la sección [mysqld] añadir: | + | |
| - | innodb_file_per_table=1 | + | |
| - | lower_case_table_names=0 | + | |
| - | + | ||
| - | Habilitamos mariadb para que arranque al reiniciar y reiniciamos mariadb | + | |
| - | systemctl enable mariadb | + | |
| - | systemctl restart mariadb | + | |
| - | + | ||
| - | Creamos la BBDD de librenms | + | |
| - | + | ||
| - | mysql -u root | + | |
| - | + | ||
| - | < | + | |
| - | CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | + | |
| - | CREATE USER ' | + | |
| - | GRANT ALL PRIVILEGES ON librenms.* TO ' | + | |
| - | FLUSH PRIVILEGES; | + | |
| - | exit | + | |
| - | </ | + | |
| - | + | ||
| - | Configuración php | + | |
| - | mv / | + | |
| - | vi / | + | |
| - | + | ||
| - | Cambiar [www] a [librenms]: | + | |
| - | + | ||
| - | Cambiar | + | |
| - | user = www-data | + | |
| - | group = www-data | + | |
| - | Por | + | |
| - | user = librenms | + | |
| - | group = librenms | + | |
| - | + | ||
| - | Cambiar | + | |
| - | listen = / | + | |
| - | por | + | |
| - | listen = / | + | |
| - | + | ||
| - | Configuración nginx: | + | |
| - | vi / | + | |
| - | Cambiad server_name por el que toque: | + | |
| - | < | + | |
| - | server { | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | | + | |
| - | gzip on; | + | |
| - | | + | |
| - | | + | |
| - | try_files $uri $uri/ / | + | |
| - | } | + | |
| - | | + | |
| - | fastcgi_pass unix:/ | + | |
| - | fastcgi_split_path_info ^(.+\.php)(/ | + | |
| - | include fastcgi.conf; | + | |
| - | } | + | |
| - | | + | |
| - | deny all; | + | |
| - | } | + | |
| - | } | + | |
| - | </ | + | |
| - | | + | |
tecnologia/red/monitorizacion.1637623898.txt.gz · Last modified: by jose
