domingo, 27 de março de 2016

Comandos XenServer Citrix.


Por algumas vezes já precisei realizar  algumas manutenções no ambiente do XenServer porém estava longe do XenCenter (Client de Administração do XenServer que infelizmente só roda em ambiente Windows) então deixo a dica de alguns comandos que são úteis neste momento de aperto. 
Para executar estes comandos você pode utilizar o Console do XenServer diretamente no servidor que este está instalado,  acesso ssh ou até mesmo o  console do XenCenter.

Comandinho para listar todas as Máquinas Virtuais instaladas

# xe vm-list

  uuid ( RO)           : 30ecba2c-1656-c131-5360-e62cc35330fb
       name-label ( RW): Teste 1
       power-state ( RO): running

  uuid ( RO)           : 0705326d-a545-fd79-2495-e67a2228e7f4
       name-label ( RW): Teste 2
       power-state ( RO): halted

*** Observem que o comando mostra a lista de Vms juntamente com sua 
identificação (uuid),o nome da Vm e também o estado.

Comandinho para listar todas as máquinas virtuais que estão rodando.

 xe vm-list power-state=running

Comandinho para listar todas as máquinas virtuais que estão desligadas

  xe vm-list power-state=halted

Comandinho para forçar reboot da máquina virtual

 xe vm-reset-powerstate --force uuid=25f4a01a-946f-acdd-44e3-eb657

Comandinho para dar Reboot na máquina virtual

 xe vm-reboot uuid=25f4a01a-946f-acdd-44e3-eb6577e75

Comandinho para “Desligar” a máquina virtual

 xe vm-shutdown --force uuid=25f4a01a-946f-acdd-44e3-eb6577e75e9c 

Comandinho para “Pausar” a máquina virtual

 xe vm-pause uuid=25f4a01a-946f-acdd-44e3-eb6577e75e9c 

Comandinho para “Iniciar” a máquina virtual

  xe start uuid=25f4a01a-946f-acdd-44e3-eb6577e75e9c 

Comandinho para Listar Tarefas em execução pendentes

  xe task-list

Comandinho “Cancelar” tarefas que estão em execução

xe task-cancel --force uuid=25f4a01a-946f-acdd-44e3-eb6577e75e9c

Comandinho para “Reinicializar” todas as tarefas

 xe-toolstack-restart

Comandinho para Inicializar a máquina virtual automaticamente

 xe vm-param-set uuid=25f4a01a-946f-acdd-44e3-eb6577e75e9c 
 other-config:auto_poweron=true

Bom, sem muita frescura deixo esta dica que espero que seja útil para outras pessoas assim como é para mim.
Até breve!

quarta-feira, 16 de março de 2016

Enchugando o squid.conf


Removendo os comentarios do Squid.conf

cd /etc/squid
cp squid.conf squid.conf.old
egrep -v "#|^$" squid.conf.old > squid.conf


segunda-feira, 22 de fevereiro de 2016

Zoneminder and Linux Mint 17.2


During several years of using linux I’ve had many frustrations and solved many problems, learning a great deal along the way.  One of the biggest thorns in my side in that time has been
 Zoneminder – security camera software for linux.  I’ve tried multiple times over the years to get it working on different distros, spending many hours each time on the internet troubleshooting.  All attempts ended in failure, until today.  I thought with my first blog post I could possibly help others in the same situation.
My specific setup is as follows:

The Problems

  1. After installing via apt-get, going to localhost/zm gives a 404 error.
    First off, as of mid-August 2015, the default Mint repo Zoneminder is outdated. So after removing Zoneminder with
    sudo apt-get purge zoneminder
    I added Isaac Connor’s Zoneminder repository, which had a more up-to-date version.
    sudo add-apt-repository ppa:iconnor/zoneminder
    sudo apt-get update
    sudo apt-get install zoneminder
    
    Now to solve the 404 error, I needed to create a symbolic link from my Apache web directory to the Zoneminder directory:
    sudo ln -s /usr/share/zoneminder /var/www/html/zm
    And I needed to link the Zoneminder config file for Apache:
    sudo ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf
    Now going to localhost/zm brought up the console properly.
  2. After adding the camera, nothing is displayed
    This is what gave me trouble for the longest time. I finally found the solution that worked for me in a bug report HERE. It turns out the Zoneminder requires CGI to be enabled in Apache, but it’s disabled by default. Enable it with:
    sudo service apache2 stop
    sudo service zoneminder stop
    sudo a2enmod cgi
    sudo service zoneminder start
    sudo service apache2 start
    After this, upon reloading the console and opening the monitor, I saw the camera feed. Finally SUCCESS!! Hopefully this will help others who’ve been stuck as well.