Jul 20, 2010

Twitter you alerts with SCOM 2007 R2

Thinking about ways to be notified by OpsMgr we where talking about Twitter this afternoon, can SCOM twitter alerts and state changes and what can be the use. Why do we want to use twitter to be notified?
One thing was clear in a sec it would be cool to let SCOM twitter in the first place! Second of all Twitter is fast and you just need a internet connection. But you don’t want everybody to read your alerts, warnings with domain names and ip addresses will expose company data to everyone to see, but if you protect your Twitter account where you have to accept your followers you can manage the alert receivers. So think about the security risk before you let SCOM Tweet your alerts.



What can be nice is to create multiple twitter accounts and subscription channel to Twitter for just the exchange admin’s or de AD guys to get the alerts fast and don’t have the SCOM console open all day (every phone has an Twitter app so no problem there).
So how can i make my SCOM 2007 R2 Twitter alerts?
It’s not really difficult to do so you got to have internet access a Twitter account with password and cUrl.
You have to obtain cUrl from the following location for you system, both x64 and x32 are available here so choose the one you need.
Copy cUrl into you c:\windows\system32 directory and cUrl will be available.
I’ve created a Twitter account wwwally_OpsMgr with a password which in the example will be password.
First test from a command line if cUrl is working from you SCOM RMS server to make sure it will works.
cmdcurl
curl --basic --user wwwally_OpsMgr:password --data status="I'm twittering from #SCOM!!" http://twitter.com/statuses/update.xml
If your response looks like this your all set to go!
cmdcurloutput
Now you can start creating the SCOM Twitter Channel which you can use to tweet you alerts.
In the OpsMgr console open the Administration pane and navigate to Notifications / Channels and create a new channel.
curlchannel
In the settings pane of the command notification channel wizard use the following settings:
  1. In the Full path use: C:\windows\system32\curl.exe
  2. In the Command line parameters use: --basic --user wwwally_OpsMgr:password --data status="$Data/Context/DataItem/AlertName$!" http://twitter.com/statuses/update.xml
  3. In the Startup folder use: C;\windows\system32
  4. Click Finish to create the notification channel.
Now your done setting up the Twitter notification channel and you can start connecting it to the subscriptions.
For more information on how to create the subscription and subscribers have a look at: http://technet.microsoft.com/en-us/library/dd440890.aspx

How to monitor new line entries in a log/text file

You may wish to monitor any new entry in a log/text file and want to get an alert generated no matter what the entry is. Usually we want an alert to be generated once a word or expression is logged, but in this post I will be shedding lights on monitoring a log file and generate an alert when any new entry is logged in the log/text file.


  • Open OpsMgr Console and go to Authoring—> Management Pack Objects—> Rules
  • Click on “Scope“ button in the tool bar to narrow down our selection.
  • I assume the file is located on a windows computer, so we will search for “Windows Computer”
  • Select Windows Computer and then click Ok
clip_image001
  • Right click on rules and select “Create a new rule”
  • Expand Alert Generating Rules—>Event Based—>Generic Text Log(Alert)
clip_image001[5]
  • In the above window click new to create a new management pack to save this new rule in it. In my case I have created a management pack called “TestRuleMP”
  • In the next screen, give a meaningful name to this rule.
  • The Rule Target should be Windows Computer
  • Make sure to to uncheck the option “Rule is enable” before you proceed
clip_image001[7]
  • In the next screen provide the pattern of the file. If the file name is fixed and not changing every time the file is created, then you may give the exact name of the log as LogName.txt  but if the log file name is changing every time is created (LogFileName01, LogFileName02, etc..) then you may put the log file name as the following: LogFileName*.txt and then click next
clip_image001[11]
  • Now it is time to set your event expression to generate the alert .
  • Click Insert so a new line will be added.
  • In the parameter name write: Params/Param[1]
  • In the operator select "Match wildcard
  • In the value put “?” – without quotes
clip_image001[13]
  • Proceed to configure the alert as the following:
A new Entry was detect in the c:\log\bader.log
Logfile Directory : $Data/EventData/DataItem/LogFileDirectory$
Logfile name: $Data/EventData/DataItem/LogFileName$
String:  $Data/EventData/DataItem/Params/Param[1]$

clip_image001[15]
  • Once you are done with editing the alert, click create.
  • We have not enabled the rule yet so we need to override the rule and just enable it for a specific computer on which the log is located

clip_image002
  • To reproduce the alert, I opened the log file and I typed a new line in it and saved the changes. See the below screenshot
clip_image001[17]
  • Now the alert is generated
clip_image001[19]

You can notice that the alert description includes the new entry which was logged in the log file

Jul 19, 2010

Download links for the 88 files that System Center Configuration Manager needs during install

When installing System Center Configuration Manager (SCCM aka SMS v4), it is not always possible to give internet access to the server involved. I like to have everything I need beforehand whenever doing an install.

When SCCM setup launches, it tries to download the ConfigMgr.Manifest.cab from here. Overall it is best to allow SCCM to grab all the files it needs automatically because the ConfigMgr.Manifest.xml file inside the ConfigMgr.Manifest.cab file can be updated by Microsoft to point to new locations when these files are updated or moved.


With that said, here are the links contained in ConfigMgr.Manifest.XML as of 12-15-07 for the RTM release of SCCM 2007, broken into groups:

Microsoft Remote Differential Compression Library
(x86, x64, ia64)

Windows Update Agent
(x86, x64, ia64)

WMI
(x86, x64, ia64)

BITS
Windows 2000 - KB 842773
(ARA, CHS, CHT, CSY, DAN, DEU, ELL, ENU, ESN, FIN, FRA, HEB, HUN, ITA, JPN, KOR, NLD, NOR, PLK, PTB, PTG, RUS, SVE, TRK)

Windows 2003 - KB 923845
x86: (CHS, CHT, CSY, DEU, ENU, ESN, FRA, HUN, ITA, JPN, KOR, NLD, PLK, PTB, PTG, RUS, SVE, TRK)
x64: (CHS, CHT, DEU, ENU, ESN, FRA, ITA, JPN, KOR, PTB, RUS)
ia64: (DEU, ENU, FRA, JPN)

Windows XP - KB 923845
x86: (ARA, CHS, CHT, CSY, DAN, DEU, ELL, ENU, ESN, FIN, FRA, HEB, HUN, ITA, JPN, KOR, NLD, NOR, PLK, PTB, PTG, RUS, SVE, TRK)

Save all of those files into a directory, and simply point SCCM to that directory for the updates instead of attempting to download them all.

The report server is not responding. Verify that the report server is running and can be accessed from this computer

After changing the websitename, hostheader or computername of a Microsoft Reporting Services Server, you get the error: The report server is not responding. Verify that the report server is running and can be accessed from this computer. 

This error occurs, because the UrlRoot element in the RSReportServer.config is not changed automaticly, when you change your computername or website hostheader.
Open the RSReportServer.config in the folder: C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer
Change the UrlRoot element to the correct name
Open RSWebApplication.config file and, if necessary, modify the ReportServerUrl setting to reflect the new server name. Note that this setting is not used in every installation. If it is empty, do nothing.
For example in: C:\Program Files\Microsoft SQL Server\MSSQL.#\Reporting Services\ReportServer open
RSReportServer.config
old value:
http://reportserver
new value:
http://reportserver
For example in: C:\Program Files\Microsoft SQL Server\MSSQL.#\Reporting Services\ReportManager open
RSWebApplication.config
old value:

ReportServer
new value:
http://reportserver

Note: It’s very important that only one of the two values is filled, else an error will occur.
Run iisreset /noforce and you’re now using multiple instance of Reporting Services on the same machine.

Jul 13, 2010

World Wide Web Publishing Service Missing

Start --> run --> cmd --> Regedit --> Expand and right-click HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION\SVCHOST and modify allow Full Access for administrator. Then uninstall and reinstall IIS.

Jul 5, 2010

Установка Microsoft SQL Server 2008 R2 в деталях


 Настройка Slipstream
Для этого мы сначала качаем дистрибутив SQL Server 2008 R2 и распаковываем ISO-шник SQL Server-а в локальную папку, например в C:\Install\SqlServer. Затем качаем Cumulative Update package 1 for SQL Server 2008 R2 (указываем на сайте свой E-mail и качаем пакет обновлений, по присланной ссылке). Распаковываем скачанный архив и получаем exe-шник вида: SQLServer2008R2-KB981355-x64.exe. После этого распаковываем и копируем файлы пакета обновлений в локальную папку CU, которая должна находиться в C:\Install\SqlServer\:
SQLServer2008R2-KB981355-x64.exe /x:C:\Install\SqlServer\CU
После этого копируем Setup.exe из папки с обновлениями в папку инсталляции самого SQL Server:



robocopy C:\Install\SqlServer\CU C:\Install\SqlServer Setup.exe
Следующим шагом копируем все файлы кроме Microsoft.SQL.Chainer.PackageData.dll из папки с обновлениями, в папку инсталляции самого SQL Server:
robocopy C:\Install\SqlServer\CU\x64 C:\Install\SqlServer\x64
/XF Microsoft.SQL.Chainer.PackageData.dll
В данной статье я работаю только с апдэйтами для x64 архитектуры. И если вы также планируете впоследствии ставить SQL Server только на машины с одинаковой архитектурой CPU, то одного пакета обновлений достаточно. Но для создания универсального пакета установки (для x64, x86 и IA) нужно качать и проделывать то же самое для всех архитектур процессоров. Пример такой установки рассматривается здесь — http://x2u.ms/21u0
Последним шагом, завершающим настройку Slipstream, является настройка DefaultSetup.ini. Если в папке C:\Install\SqlServer\x64 есть файл DefaultSetup.ini, то добавляете в него следующую строчку: CUSOURCE=».\CU". Если файла там нет, то создаёте файл DefaultSetup.ini со следующим контентом:
;SQLSERVER2008 R2 Configuration File

[SQLSERVER2008]

CUSOURCE=".\CU"
На этом настройка Slipstream установки закончена и можно переходить непосредственно к установке.

Установка SQL Server 2008 R2

Итак, приступаем! Запускаем Setup.exe и в приветственном диалоге выбираем Installation –> New installation or add features to an existing installation:
image_thumb_5C9DC8E0
image_thumb_5646CC85
При запуске инсталляции в первую очередь производятся проверки совместимости операционной системы, хватает ли прав у пользователя для установки SQL Server и т.п. Если у вас уже стоит экземпляр SQL Server 2008, то вы увидите предупреждение о том, что общие компоненты (SQL Server Management Studio, Integration Services, Books Online и т.п.) будут обновлены до версии до SQL Server 2008 R2. Если все проверки пройдены, можно переходить к следующему шагу. И после распаковки файлов, необходимых для инсталляции и ещё одного этапа проверок, начнётся самое интересное – конфигурация установки:
image_thumb_604B47E3
Первым этапом которой будет ввод лицензионного ключа продукта, либо выбора бесплатной редакции (Evaluation, Express, Express with Advanced Services). И если вы ставите редакцию SQL Server, где ключ уже вбит в поле «Enter the product key» (например Developer Edition), то советую сохранить его где-то. Он впоследствии пригодится при установке других компонент SQL Server 2008 R2:
image_thumb_4ADD6CAE
Затем подтверждаем, что мы принимаем условия лицензионного соглашения. И по желанию выбираем опцию отправлять отчёт в Майкрософт, содержащий информацию о вашем оборудовании:
image_thumb_3BE617C7
Следующим шагом будет выбор формата установки, где предлагается 3 варианта:
— SQL Server Feature Installation – здесь все настройки придётся делать самому (его выбираем мы).
— SQL Server PowerPivot for SharePoint – кроме самого SQL Server, будет поставлен и сконфигурирован PowerPivot плагин к SharePoint.
— All Features With Defaults – для установки будут выбраны все фичи (с возможностью убрать то, что не нужно) и проставлены аккаунты по умолчанию для сервисов
image_thumb_69A3BABF
На следующем экране выбираем те компоненты SQL Server, которые хотим установить. Здесь я предлагаю выбрать всё, и вкратце расскажу про каждый элемент, который можно выбрать для установки (более детальное описание компонентов можно получить нажав F1 на текущем шаге):
Database Engine Services – собственно сам SQL Server
SQL Server Replication – компоненты репликации SQL Server используются для синхронизации баз данных
Full-Text Search – компонент полнотекстового поиска позволяет организовать эффективный поиск по текстовым полям базы с учётов различных языков и различных форм слова
Analysis Services – позволяет строить многомерные (OLAP) хранилища данных и DataMining модели для проведения анализа и постороения прогнозов
Reporting Services – сервисы и инструменты для построения и управления отчётами
Shared Features (они ставятся 1 раз, и будут доступны всем экземплярам, которые установлены на машине)
Business Intelligence Development Studio – если стоит Visual Studio, то к ней добавляются новые типы проектов для разработки решений Analysis Services, Reporting Services и Integration Services. Если Visual Studio нет, то ставится «мини» Visual Studio, в которой доступны только эти, вышеперечисленные типы проектов
Client Tools Connectivity – провайдеры для соединения клиентов с сервером
Integration Services – сервисы, позволяющие организовать получение, преобразование и перенос данных из различных источников
Client Tools Backwards Compatibility — SQL Distributed Management Objects (SQL-DMO), Decision Support Objects (DSO), Data Transformation Services (DTS)
Client Tools SDK — SDK для разработчиков
SQL Server Books Online – документация по SQL Server
Management Tools – Basic – базовый вариант Management Studio, SQLCMD и SQL Server PowerShell provider
Management Tools – Complete – полноценная Management Studio (поддержка Analysis Serveices, Integration Services, Reporting Services), Profiler, Database Engine Tuning Advisor, SQL Server Utility
SQL Client Tools Connectivity SDK – на Microsoft Connect есть баг насчёт описания этого элемента :)  — SQL Client Connectivity SDK and Client Tools SDK DOCUMENTATION
Microsoft Sync Framework – многофункциональная платформа синхронизации, позволяющая интегрировать любое приложение с любыми данными из любого хранилища, по любому протоколу и в любой сети.
image_thumb_2C52E02B image_thumb_40A87FE9
И после прохождения очередного этапа проверок, переходим к настройке экземпляра SQL Server. Здесь мы выбираем какой тип экземпляра мы хотим ставить: Default Instance или Named Instance. Отличаются они тем, что экземпляр по умолчанию на машине может быть только один и что к экземпляру по умолчанию мы можем обращаться по имени машины. Например если имя машины WORK, то при подключении к экземпляру по умолчанию этой машины мы укажем имя сервера WORK, а для именованного экземпляра WORK\<имя_экземпляра>. Но это не всё. Ещё одним отличием является то, что экземпляр по умолчанию висит на статическом порту (по умолчанию 1433) и мы не указываем имя порта при подключении, в то время как именованный экземпляр использует динамический порт и подключение к нему происходит при помощи службы SQL Browser. На этом шаге я выбираю Default Instance:
image_thumb_3B961C6D
После проверки места на жёстком диске открывается следующий шаг «Server Configuration». Здесь мы задаём учётные записи, под которыми будут запускаться службы SQL Server и тип запуска службы (автоматом, вручную либо вообще не запускать). Общая рекомендация Майкрософт создавать под каждую службу свою учётную запись, и давать ей необходимые права по мере необходимости. Например надо снимать бэкап базы данных в папку C:\Backup, даёте право учётной записи, под которой запущен SQL Server на запись в эту папку. Но в принципе… если это домашний компьютер, то можно запускать все сервисы под админом и не думать о правах :)
image_thumb_1D1BB5B7
И Collation для Database Engine и Analysis Services. Collation определяет кодовую страницу для не Unicode типов данных (char, varchar, text) и порядок сортировки текстовых данных.
image_thumb_2DD33A98
На следующем шаге мы конфигурируем доступ к SQL Server: задаём тип аутентификации и административные учётные записи (обязательно должны указать хотя бы одну). Windows аутентификация включена всегда, а SQL Server аутентификацию вы можете включить выбрав Mixed Mode. Пароль который вы при этом задаёте будет паролем учётной записи sa.
image_thumb_2854A427
На этом же шаге вы можете задать размещение пользовательских баз данных, tempdb и бэкапов.
image_thumb_3BD1DDFB
И включить FILESTREAM на уровне экземпляра. FILESTREAM позволяет хранить файлы в БД, сохраняя скорость потокового доступа к файлу и возможность сохранения ссылочной целостности БД. В принципе включить FILESTREAM вы можете потом, после установки, используя Configuration Manager.
image_thumb_3EB71CE1
Затем следует выбор административной учётной записи и папок для хранилища Analysis Services.
image_thumb_7EBD869B
И выбор конфигурации Reporting Services:
— Native mode – установка и конфигурация по умолчанию
— SharePoint integrated mode – установка ReportServer в SharePoint integrated mode и конфигурация по умолчанию
— Install but do not configure the report server – сконфигурировать его можно уже после установки при помощи Reporting Sevices Configuration tool
image_thumb_20E56C55
На предпоследнем шаге можно выбрать отсылать или нет отчёты об ошибках в Майкрософт.
image_thumb_0DB419DC
И, наконец, в завершение всего, можно увидеть список того, что сейчас будет устанавливаться. В том числе можно проверить что это действительно Slipstream установка. Но перед тем как нажимать Install, скопируйте путь к конфигурационному файлу, который вы видите на экране. Зачем, я расскажу позже. Ну а теперь всё. Запускаем и включаем футбол, процесс это не быстрый :)
image_thumb_4BF991F5
Ну вот и всё :) Установка завершена.
image_thumb_6E8DAAA3
И теперь, в завершение статьи я хочу рассказать о том, зачем нам понадобился файл конфигурации, путь к которому мы скопировали на последнем шаге установки. При помощи инструкций, сохранённых в этом файле, вы можете устанавливать SQL Server Server в одинаковой конфигурации на нескольких компьютерах. Файл конфигурации можно использовать только при установке из командной строки. Поэтому для такого способа установки необходимо запустить Setup.exe c указанием файла конфигурации, путь в которому мы сохранили на предпоследнем шаге мастера установки:

Remote Restart


Have you ever needed to remotely restart a Windows XP or Windows 2003 machine? Several scripted options exist (e.g., in the Microsoft Windows 2003 Server Resource Kit). However, you can accomplish the same task from the Microsoft Management Console (MMC).
  1. Open a computer management console for the machine you want to restart. I usually right-click the My Computer desktop icon and select Manage, then right-click Computer Management and select Connect to another computer. From the list, select the remote system you want to restart. Click OK.
  2. In the new window, right-click Computer Management and select Properties.
  3. In the dialog box that opens, select the Advanced tab.
  4. Click the Startup and recovery Settings button.
  5. Click Shut Down. The dialog box that opens will give you some shutdown options (e.g., Restart, Power down). Select the option you want and click OK.