Translate

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

15/2/13

Cómo insertar automáticamente un valor en un archivo bat




Un programa de línea de comandos tiene generalmente un interruptor para responder automáticamente a las preguntas con Y (esto es por lo general -Y), pero si su programa no tiene un interruptor para apagar el comportamiento interactivo, puede utilizar:

echo Y | someprogram.exe

que se verá a someprogram como si hubiera introducido por el usuario Y.


Fuente: http://es.softuses.com/129135

Jorge D.

2/11/10

Changing the IP address, default gateway, hostname of the Service Console in ESX 3.x and 4.x host.

Changing settings from the physical or remote console connection
Changing the IP for the Service Console must be done from the physical console or through a remote console session. If you make changes through a network connection such as SSH, network connectivity to the Service Console disconnects because the Service Console's network interface changes.
  1. Run the following command to set the IP address:[root@server root]# esxcfg-vswif -i <a.b.c.d> -n <w.x.y.z> vswif0 , where <a.b.c.d> is the IP address and <w.x.y.z> is the subnet mask.

    Note: In this example, v swif0 is the Service Console adapter that is the interface to which you are applying the IP address change.
  2. Open the /etc/hosts file with a text editor and modify it so that it reflects the correct IP address and hostname.
  3. To change the default gateway address and the hostname, edit the /etc/sysconfig/network file and change the GATEWAY and HOSTNAME parameters to the proper values.
  4. For the changes to take place, reboot the host or restart the network service with the command: [root@server root]# service network restart Note: This command breaks any current network connections to the Service Console.
Changing the hostname without rebooting
To dynamically change the hostname, run the command:
[root@server root]# hostname newnameNote: This command creates a temporary hostname change. This change is lost when the system is rebooted.
Changing the DNS server settings
To change the DNS server settings, update the nameserver IPs and search domain the /etc/resolv.conf file.
Changing settings in VMware vSphere or Infrastructure Client
To change the hostname, domain, DNS servers, and default gateway in VMware vSphere or Infrastructure (VI) Client:
  1. Highlight the ESX host and click the Configuration tab.
  2. Click DNS and Routing.
  3. Click Properties.
  4. To change the hostname, domain, and DNS servers, click the DNS Configuration tab and enter the appropriate values.

    Note: Disable VMware High Availability if you do not want virtual machines to failover during the hostname IP change.
  5. To change the default gateway, click the Routing tab and enter the appropriate value.
  6. Reboot the ESX host for the changes to take effect.
  7. Reconnect the ESX host to vCenter Server with the new IP address.
    Jorge D.
     

4/3/10

Esxcfg command help

Networking: Esxcfg-firewall Esxcfg-nics Esxcfg-vswitch Esxcfg-vswif Esxcfg-route Esxcfg-vmknic
Storage: Esxcfg-mpath Esxcfg-nas Esxcfg-swisci Esxcfg-vmhbadevs
General: Esxcfg-advcfg Esxcfg-auth Esxcfg-info Esxcfg-resgrp Esxcfg-upgrade
Boot/Diagnostic: Esxcfg-boot Esxcfg-dumppart Esxcfg-init Esxcfg-linuxnet Esxcfg-module


Esxcfg-firewall
Description: Configures the service console firewall ports
Syntax: esxcfg-firewall <options>

Options:


-q Lists current settings
-q <service> Lists settings for the specified service
-q incoming|outgoing Lists settings for non-required incoming/outgoing ports
-s Lists known services
-l Loads current settings
-r Resets all options to defaults
-e <service> Allows specified service through the firewall (enables)
-d <service> Blocks specified service (disables)
-o <port, tcp|udp,in|out,name> Opens a port
-c <port, tcp|udp,in|out> Closes a port previously opened by –o
-h Displays command help
-allowincoming Allow all incoming ports
-allowoutgoing Allow all outgoing ports
-blockincoming Block all non-required incoming ports (default value)
-blockoutgoing Block all non-required outgoing ports (default value)

Default Services:

AAMClient Added by the vpxa RPM: Traffic between ESX Server hosts for VMware High Availability (HA) and EMC Autostart Manager – inbound and outbound TCP and UDP Ports 2050 – 5000 and 8042 – 8045
activeDirectorKerberos Active Directory Kerberos - outbound TCPs Port 88 and 464
CIMHttpServer First-party optional service: CIM HTTP Server - inbound TCP Port 5988
CIMHttpsServer First-party optional service: CIM HTTPS Server - inbound TCP Port 5989
CIMSLP First-party optional service: CIM SLP - inbound and outbound TCP and UDP Ports 427
commvaultDynamic Backup agent: Commvault dynamic – inbound and outbound TCP Ports 8600 – 8619
commvaultStatic Backup agent: Commvault static – inbound and outbound TCP Ports 8400 – 8403
ftpClient FTP client - outbound TCP Port 21
ftpServer FTP server - inbound TCP Port 21
kerberos Kerberos - outbound TCPs Port 88 and 749
LicenseClient FlexLM license server client - outbound TCP Ports 27000 and 27010
nfsClient NFS client - outbound TCP and UDP Ports 111 and 2049 (0 – 65535)
nisClient NIS client - outbound TCP and UDP Ports 111 (0 – 65535)
ntpClient NTP client - outbound UDP Port 123
smbClient SMB client - outbound TCP Ports 137 – 139 and 445
snmpd SNMP services - inbound TCP Port 161 and outbound TCP Port 162
sshClient SSH client - outbound TCP Port 22
sshServer SSH server - inbound TCP Port 22
swISCSIClient First-party optional service: Software iSCSI client - outbound TCP Port 3260
telnetClient NTP client - outbound TCP Port 23
TSM Backup agent: IBM Tivoli Storage Manager – inbound and outbound TCP Ports 1500
veritasBackupExec Backup agent: Veritas BackupExec – inbound TCP Ports 10000 – 10200
veritasNetBackup Backup agent: Veritas NetBackup – inbound TCP Ports 13720, 13732, 13734, and 13783
vncServer VNC server - Allow VNC sessions 0-64: inbound TCP Ports 5900 – 5964
vpxHeartbeats vpx heartbeats - outbound UDP Port 902

Note: You can configure your own services in the file /etc/vmware/firewall/services.xml

esxcfg-firewall examples:
Enable ssh client connections from the Service Console:
# esxcfg-firewall -e sshClient
Disable the Samba client connections:
# esxcfg-firewall -d smbClient
Allow syslog outgoing traffic:
# esxcfg-firewall -o 514,udp,out,syslog
Turn off the firewall:
# esxcfg-firewall -allowIncoming
# esxcfg-firewall -allowOutgoing
Re-enable the firewall:
# esxcfg-firewall -blockIncoming
# esxcfg-firewall –blockOutgoing


18/11/09

Configurar Clariion por iSCSI en Windows 2008 con MPIO nativo


Antes que nada tenemos que instalar el componente de MPIO en el sistema operativo desde la ventana del Server Manager.
La configuración básica de MPIO no funciona con cabinas clariion, tenemos que añadirle una serie de parámetros para que reconozca los discos correctamente. Para ello abrimos la consola de comandos para añadir los siguientes valores:

%systemroot%\system32\mpclaim.exe -n -i -d "DGC RAID 5 "
%systemroot%\system32\mpclaim.exe -n -i -d "DGC RAID 3 "
%systemroot%\system32\mpclaim.exe -n -i -d "DGC RAID 1 "
%systemroot%\system32\mpclaim.exe -n -i -d "DGC RAID 0 "
%systemroot%\system32\mpclaim.exe -n -i -d "DGC RAID 10 "
%systemroot%\system32\mpclaim.exe -n -i -d "DGC VRAID "

Es muy importante que la cadena de caracteres tenga la métrica exacta, para ello debemos respetar este espaciado entre caracteres:
5 espacios despues de DSG
10 espacios despues de RAID 0, 1, 3, 5 hasta el cierre de comillas
9 espacios despues de RAID 10 hasta el cierre de comillas
11 espacios despues de VRAID hasta el cierre de comillas

Hecho esto vamos a la configuración de MPIO y comprobamos que aparecen los parámetros que hemos añadido, luego marcamos la casilla de Añadir soporte para iSCSI.

Pasamos a configurar el iniciador iSCSI desde el panel de control, añadiendo las IPs de la cabina. Una vez hecho el discover de los targets iniciamos sesión y pulsamos en autoconfigurar dispositivos.

En la parte de Navisphere debemos configurar los Host como Clariion Open y el ajustar el modo de failover en 4.

Para comprobar que todo funciona correctamente vamos al administrador de dispositivos y en la pestaña de discos aparecerán las LUNs con el nombre DSG. Si vemos las propiedades del disco, en la pestaña MPIO deben aparecer todos los caminos en Activo y Optimizado para la SP propietaria de la LUN.

Para más información detallada sobre procedimientos personalizados de Clariion en el siguiente enlace:

Fuente: http://www.emc.com/microsites/clariion-support/central.htm

F.


2/10/09

Permisos root por ssh a ESX


Conceder permisos a root para acceder por SSH directamente en VMware ESX.


Hay veces que surge la necesidad de disponer de más permisos de los normales para realizar ciertas acciones en nuestros sistemas.
En este artículo os voy a mostrar como configurar el ESX para que se pueda acceder a él mediante una conexión telnet segura (SSH) con el usuario con los máximos permisos en nuestro sistema VMWARE ESX que es el usuario root.
Por defecto en todas las instalaciones del ESX esta opción viene des-configurada por un tema claro de seguridad.
Nosotros como somos los administradores del sistema y necesitamos disponer del mayor número de permisos existentes lo vamos a modificar para poder por ejemplo entrar con WinSCP y poder mover a nuestro antojo desde un entorno Windows (amigable) ficheros de una carpeta a otra sin necesidad de entrar con una herramienta como putty para desde una línea de comandos mover los ficheros.
Pues allá vamos:
Lo podemos hacer de 2 formas: Una es accediendo directamente a la máquina y pulsando ALT+F1 para entrar en una sesión de consola y realizar los comandos que os explico a continuación
La otra forma es acceder mediante putty y elevando los permisos.
Entramos con putty a una sesión de pantalla del servidor ESX que vamos a modificar.
Login: <user>
Password: <password>
Escribimos su -
Introducir la contraseña del usuario root
Editar el fichero sshd_config mediante el comando vi /etc/ssh/sshd_config
Pulsar I.
Añadir # delante la línea PermitRootLogin.
Pulsar la tecla Esc y escribir :wq
Escribir el comando: service sshd restart.
A partir de ahora ya podremos acceder directamente sin necesidad de elevar los permisos.

Fuente: http://megacracks.wordpress.com/2009/08/14/conceder-permisos-a-root-para-acceder-por-ssh-directamente-en-vmware-esx/

Jorge.

Tarjeta de red oculta en el registro

Aparece un mensaje de error al intentar establecer una dirección IP en un adaptador de red

Imagino que os habréis encontrado como chiquicientas mil veces el problema de que se quita por el procedimiento mecagoendios una tarjeta de red de un sistema Windows y se instala otra a la que se quiere asignar la misma dirección IP. Ahí es cuando se nos pregunta aquello de:

La dirección IP 192.168.0.69 que ha especificado para este adaptador de red ya está asignada a otro adaptador pepito. pepito está oculto en la red y la carpeta Conexiones de acceso telefónico porque no está físicamente en el equipo o es un adaptador heredado que no funciona. Si la misma dirección está asignada a ambos adaptadores y ambos se vuelven activos, sólo uno de ellos usará esta dirección. Esto puede generar una configuración incorrecta del sistema. ¿Desea escribir una dirección IP diferente para este adaptador en la lista de direcciones IP en el cuadro de diálogo Avanzada?

Total que si dices que sí regresas al cuadro de diálogo para cambiar la IP y si decides que no realmente estás poniendo la IP que quieres poner.

Pero te queda aquél gusanillo de ¿andecosño estará el puto adaptador asqueroso ese que está oculto en el registro de los www?

Afortunadamente para todo hay solución en esta vida menos para la muerte (y para ser político). La gente de Microsoft lo tienen todo previsto y nos proponen dos soluciones de lo más majas, a escoger. Ambas están en este interesante artículo de la KB de Microsoft:

http://support.microsoft.com/kb/269155/es

La primera de las dos soluciones propuesta es la menos compleja. Se basa en hacer 6 pasos:

1. Abrir una línea de comandos ejecutando cmd.exe.
2. Escribir: set devmgr_show_nonpresent_devices=1 y presionar ENTRAR.
3. Abrir el administrador de dispositivos escribiendo en la línea de comandos: DEVMGMT.MSC y pulsar ENTRAR.
4. En el Administrador de dispositivos pulsar en el menú Ver y marcar Mostrar dispositivos ocultos.
5. Expandir el ítem Adaptadores de red.
6. Seleccionar los adaptadores que aparecen en color atenuado, clic con el botón secundario del ratón y Desintalar.

Fuente: http://josepros.blogspot.com/2007/07/quitar-tarjeta-de-red-oculta-en-el.html

Jorge.


26/9/09

VMware vSphere ESX4 Server | Modo mantenimiento desde la linea de comandos


Muchas tareas como la aplicación de parches y actualizaciones dentro de la plataforma de VMware vSphere se deben realizar con el host en modo mantenimiento. Debido a que muchas de estas tareas también se deben ejecutar desde la consola del ESX donde estamos trabajando, no viene mal conocer cuales son los comandos necesarios para poner y sacar al mismo del modo mantenimiento.

Para realizar esto debemos ejecutar desde la consola y con privilegios de root:

    vimsh -n -e /hostsvc/maintenance_mode_enter    

Para salir del modo mantenimiento:

    vimsh -n -e /hostsvc/maintenance_mode_exit      


Fuente : http://www.wetcom.com.ar/content/vmware-vsphere-esx4-server-modo-mantenimiento-desde-la-linea-de-comandos/

Jorge.