lunes, 15 de octubre de 2018

Upgradear LibreNMS


sudo -s
su - librenms
cd /opt/librenms

git config --global http.proxy http://10.16.1.8:3128/
git config --global https.proxy http://10.16.1.8:3128/
$ ./scripts/composer_wrapper.php install --no-dev


chown -R librenms:librenms /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs

setfacl -R -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs

setfacl -d -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs

estos comandos no me los reconocia el sistema pues tube que instalar acl

al final quedaron asi

sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chown -R librenms:librenms /opt/librenms



[FAIL]  Database: incorrect column (notifications/datetime)
[FAIL]  Database: incorrect column (users/created_at)
[FAIL]  We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
        [FIX] Run the following SQL statements to fix.
        SQL Statements:
         ALTER TABLE `notifications` CHANGE `datetime` `datetime` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00' ;
         ALTER TABLE `users` CHANGE `created_at` `created_at` timestamp NOT NULL DEFAULT '1970-01-02 00:00:01' ;
[FAIL]  Discovery has not completed in the last 24 hours.
        [FIX] Check the cron job to make sure it is running and using discovery-wrapper.py
[WARN]  Your install is over 24 hours out of date, last update: Sat, 13 Oct 2018 22:05:33 +0000
        [FIX] Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[FAIL]  We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
        [FIX] sudo chown -R librenms:librenms /opt/librenms

martes, 9 de octubre de 2018

Te gusta el buceo?

Si eres de las personas amantes del buceo y piensas venir a Varadero puedes mirar este sitio https://blueholedivingcenter.com/ Buenos precios y bonitos lugares.

Solucion a los buzones de correo llenos.

A veces bienen usuarios con el problema que se les llena el buzón y es porque no borran la carpeta de la papelera.

Solución automatizar para que esto se haga sin que intervenga el usuario final hay 2 vias con el servidor que utilizamos para pop3 e imap en este caso dovecot o con un script

La primera dovecot, busque en sus plugins y opciones y no vi una forma adecuada y rapida de resolver el problema, la segunda fue este script que readacte de otro que encontre en internet.

Aca les dejo el script que esta en cat /etc/cron.daily/ se llama cleanoldmails y contiene lo siguiente y borra los correos que estan en papelera por mas de 30 dias.

#!/bin/sh

find /home/mailbox/*/Maildir/.Trash/cur/ -mtime +30 -type f -delete
find /home/mailbox/*/Maildir/.Trash/new/ -mtime +30 -type f -delete
find /home/mailbox/*/Maildir/.INBOX.Trash/cur/ -mtime +30 -type f -delete
find /home/mailbox/*/Maildir/.INBOX.Trash/new/ -mtime +30 -type f -delete

exit 0

Resultado el script borro 13 gigas de correos de las papeleras.

Ponerle certificados a nuestro sitio web con apache2

Crear un directorio para guardar los certificados  /etc/apache2/ssl Dentro poner los certificados  cert.crt  private.key  bundle.crt Configu...