Activate mail in Microsoft SQL

Recently I have written some SQL scripts. When these scripts are ran I would like to know if the steps in the script are completed. For this I want to send an email from an SQL script.

To get this working a SQL mail account needs to be created and the stored procedure for email needs to be activated.

The first step is to create an SQL mail account. This can be done with the following script:

The next step is to activate the email stored procedure. This van be done with the following script:

Mail has been configured. A test email can be send with the following script:

 

 

 

 

 

 

Delen via: Facebooktwittergoogle_pluspinterestlinkedinmail

VMware HP AMS service bug

Recently I ran into a problem with a HP DL380 G8 VMware ESX 5.5 host. It was not possible to logon trough SSH and we could not vMotion Virtual Machines anymore. It seemed like the SSH daemon stopped working. Starting the SSH deamon again did not work. In the vmkernel.log file the following error was displayed:

WARNING: Heap: 3058: Heap_Align(globalCartel-1, 136/136 bytes, 8 align) failed. caller: 0x41802a2ca2fd

I discovered VMware KB2085618 article with the title “ESXi host cannot initiate vMotion or enable services and reports the error: Heap globalCartel-1 already at its maximum size.Cannot expand” which sounded exactly like our problem and seems to be caused by a memory leak in the HP-AMS service.

The KB article suggests to log in trough SSH and stop the HP-AMS service. The problem was the SSH daemon was not running anymore and could not be started.

We had to plan a maintenance window to reboot the ESX host. After the reboot we can connect trough SSH to the host and disable the HP-AMS service by following this steps:

  • Log in to the host using SSH.
  • Run this command to stop the HP service (does not persist on reboot): /etc/init.d/hp-ams.sh stop
  • Run this command to remove the VIB: esxcli software vib remove -n hp-ams
  • Reboot the host.

After removal the problem did not acquire again.

Delen via: Facebooktwittergoogle_pluspinterestlinkedinmail

Netscaler: Logon to GUI error ‘Invalid Argument [ns]’ after upgrading NetScaler

Today I have updated an NetScaler HA pair to the latest version. The NetScalers are using a custom made theme. After upgrading the HA pair management access trough the GUI was not possible anymore. The NetScaler showed the ‘Invalid argument [ns]’ error.

Citrix-NetScaler-Error

As a quick fix it is possible to copy the default admin GUI to the running config. The copy must be done by accessing the NetScaler shell. After accessing the shell the copy can be done with the following command:

  • # cp -r /var/netscaler/gui/admin_ui  /var/ns_gui_custom/ns_gui/

Citrix-NetScaler-Fix

Be aware that is only a temporary fix, the configuration will be lost after a reboot. To fix this permanently you have to rebuild the custom made theme. Before proceeding, check if all functionality works on the NetScaler.

If everything’s working, then we can create the customtheme.tar.gz again so that it persists across config change or reboots. This can be done with the following commands:

  • # cd /var/ns_gui_custom/
  • # tar -cvzf customtheme.tar.gz ns_gui/*

 

Delen via: Facebooktwittergoogle_pluspinterestlinkedinmail

Enable Remote Desktop remotely by using the registry

A few times I have encountered the fact that I cannot access a remote workstation or server by Remote Desktop (RDP). To solve this you can enable RDP trough a registery key remotely. The following steps can be taken to enable RDP remotely.

  1. Log in on a computer or server as an Domain Admin and open Regedit as an administrator.
  2. On the File menu, click Connect Network Registry.
  3. In the Select Computer dialog box, under Enter the object name to select, type the computer name and then click Check Names.
  4. After the computer name resolves, click OK.
  5. In the computer node that appears in the Registry Editor, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server.
  6. In the console tree, click Terminal Server, and then, in the details pane, double-click fDenyTSConnections.
  7. In the Edit DWORD Value box, in Value data, type 0, and then click OK. This value enables connections at the level that allows connections from computers running any version of Remote Desktop.

To implement the change, restart the server or workstation remotely, as follows:

  1. Log in on a computer or server as an Domain Admin and open Command Prompt as an administrator.
  2. At the command prompt, type the following command: shutdown /m \\[Name of computer that has to be rebooted] /r
Delen via: Facebooktwittergoogle_pluspinterestlinkedinmail