Postagens

Mostrando postagens de julho, 2017

How to Resize a Linux Swap Partition

# Resize Linux Partition root@linux:~# fdisk -l /dev/das  Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 sectors  Units: sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disklabel type: dos  Disk identifier: 0x0041f8a8  Device     Boot    Start       End  Sectors Size Id Type  /dev/vda1           2048  96471039 96468992  46G 83 Linux  /dev/vda2       96471040 104857599  8386560   4G 82 Linux swap / Solaris root@linux:~# swapoff -a root@linux:~# fdisk /dev/das  Command (m for help): d  Partition number (1,2, default 2):  Partition 2 has been deleted.  Command (m for help): d  Selected partition 1  Partition 1 has been deleted.  Command (m for help): n  Partition type     p   primary (0 primary, 0 extended, 4 free)     e   extended (container for logical partitions)  Select (default p): p  Partition number (1-4, default 1): 1  First sector (2048-209715199, default 2048):  Last

How to Install or Upgrade Nagios Core

1) Backup mkdir /backup-nagios cp -p /etc/init.d/nagios  /usr/local/nagios/ tar czf /backup-nagios/nagios-pro.tar.gz /usr/local/nagios 2) Atualização S.O. sudo apt-get update && apt-get ugprade sudo apt-get install build-essential apache2 apache2-utils libapache2-mod-php5 php5 make php5-gd libgd2-xpm-dev libperl-dev libssl-dev 3) Download wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.1.1.tar.gz wget https://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz 4) Descompactar tar zxvf nagios-4.0.2.tar.gz tar zxvf nagios-plugins-1.5.tar.gz 5) Configurar sudo useradd nagios sudo groupadd nagcmd sudo usermod -a -G nagcmd nagios 6) Compilar e Instalar Nagios Core cd nagios-4.0.2 sudo ./configure --with-command-group=nagcmd sudo make all sudo make install sudo make install-init sudo make install-config sudo make install-commandmode sudo make install-webconf (*** sudo /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-enabled/

Add the Exchange 2013 PowerShell module into a standard PowerShell session

Add the Exchange 2013 PowerShell module into a standard PowerShell session: Add-PSSnapin Microsoft . Exchange . Management . PowerShell . SnapIn

Zabbix 3.0 Install

Install Zabbix 3.0 LTS for Ubuntu 14.04 LTS # Add Zabbix Repository $ wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-2+trusty_all.deb $ sudo dpkg -i zabbix-release_3.0-2+trusty_all.deb $ sudo apt update # Install Zabbix server, frontend, agent $ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent # Create Database Schema $ mysql -u root -p mysql> create database zabbix character set utf8 collate utf8_bin; mysql> GRANT ALL on zabbix.* to zabbix@localhost IDENTIFIED BY 'zabbix'; mysql> quit; # Import Schema and Data $ zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -u zabbix -p zabbix # Edit Zabbix Configuration File $ sudo vi /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=password # Config PHP $ sudo vi /etc/zabbix/apache.conf php_value date.timezone America/Sao_Paulo # Config Apache $ sudo apache2ctl configtest $ sudo vi /

Zabbix - Backup Script

Example of Script for backup database Zabbix # Variável com a data do dia DATA=$(date +%Y-%m-%d) # Parar o serviço do Zabbix service zabbix_server stop # Faz um Dump do banco de dados MySQL para um arquivo .sql mysqldump -uzabbix -pzabbix zabbix > backup_Zabbix_$DATA.sql # Iniciar o serviço do Zabbix service zabbix_server start # Montar uma pasta do Windows Windows mount -t cifs "//IP-do-Servidor/Share" /mnt/bkp -o username=”usuario”,password=”senha”,uid=1000,gid=1000 # Copiar o arquivo para a pasta cp ‘backup_Zabbix_’$DATA.sql” ‘/mnt/bkp/’ # Desmontar pasta umount /mnt/bkp