Monday, August 31, 2009

Wireless LAN หลุดบ่อยมากเลย

ใช้ Wireless LAN ของ True ทำไมหลุดย่อยจัง
  • อ่านจากหลายๆ ที่แต่เป็นข้อมูลหลายปีแหละ เค้าแนะนำให้ใช้ channel ที่ห่างจากคนอื่นประมาณ 3 ช่อง น้อยกว่า มากว่าก็ได้
  • หรือทดลองกำหนดค่าให้ใช้ 802.11g only อย่างเดียว คือ ปกติเค้าตั้งมาจะเป็น Mixed อ่ะนะ

ผลที่ได้
  • Wireless Router อยู่ชั้นล่างใช้เน็ต อยู่ชั้นบน แค่เนี๋ย
  • ก็โอเคนะ ไม่หลุดบ่อยๆ อย่างที่เคย คอนเฟิร์ม ตอนแรกใช้ channel 8 ก็ไม่มี WLAN ใหนใช้นะ ห่างจาก วงอื่นประมาร 2 - 5 ช่องด้วยซ้ำ
  • แต่พอลองเปลี่ยนจาก Mixed เป็น 802.11g Only อันเนี๋ยเห็นผลชัดเจนเลย
  • คือไม่ใช่ไม่หลุดเลยนะ แต่ น้าน... นานที หลุดที

ทิป
  • สแกน WLAN ข้างเคียงบน Windows Vista or 7 ด้วยคำสั่ง
netsh wlan show networks mode=bssid

เกี่ยวข้อง

อ้างอิง

How can I check the password of the IUSR and IWAM local accounts on a machine?

A. Usually the IUSR_ and IWAM_ passwords are set automatically and are never known. However, I've seen cases in which for some reason the passwords get out of sync or corrupted and need to be reset. The easiest way to reset these passwords is to extract the passwords that Microsoft IIS has in its metabase and update the accounts in Local Users and Groups to use that password.

You first need to update the adsutil.vbs script, which you'll find in the AdminScripts folder under the Inetpub folder, to display sensitive information (e.g., passwords) instead of just asterisks. Open the adsutil.vbs file in Notepad and search for the text "IsSecureProperty = True", replace this text with "IsSecureProperty = False" and save the file. Now run the following commands to return the passwords (/anonymoususerpass is the IUSR account; /wamuserpass is the IWAM_ account).

C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/anonymoususerpass

anonymoususerpass : (STRING) "/XEv`J01T"!69I"

C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/wamuserpass

wamuserpass : (STRING) "ikI37Q"W5[,uu%"
If you want to reset the passwords to match the passwords you had already set in Local Users and Groups, use the following command:
C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/anonymoususerpass "Pa55word"

anonymoususerpass : (STRING) "Pa55word"

C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/wamuserpass "Pa55word"

wamuserpass : (STRING) "Pa55word"

You should now run the command below to sync the password from IIS with Microsoft Transaction Server (MTS) and component services:

C:\Inetpub\AdminScripts>cscript.exe synciwam.vbs -v

IIS Applications Defined:
Name, AppIsolated, Package ID

You should now restart IIS via the "All Tasks" context menu option of the IIS server in the MMC Internet Information Services (IIS) Manager snap-in.


ที่มา


The MRTG 2.16.2 Windows Installation Guide

  • รู้สึกว่า หลังๆ เนี๋ยติดตั้ง และ คอนฟิกง่ายมากๆ บน Windows อ่ะนะ
  • ตอนแรก นึกว่าจะ ยุ่งยากอ่ะนะ แต่พอลองทำจริงๆ จะง่ายกว่า MRTG on Ubuntu อีกนะ

PREREQUISITES
  • ไปดาวน์โหลด Perl เวอร์ชั่นล่าสุดก่อนเลย ซึ่งตอนนี้โหลดได้ ActivePerl-5.10.1.1006-MSWin32-x86-291086.msi
http://www.activestate.com/store/activeperl/download/
  • ตามด้วย MRTG เวอร์ชั่นล่าสุดจาก ซื่งในขณะนี้จะเวอร์ชั่น mrtg-2.16.2.zip
http://oss.oetiker.ch/mrtg/pub
  • เราต้องทราบ snmp community string บนเครื่องเป้าหมายที่เราจะทำใช้ MRTG Monitor ซึ่งในที่นี้จะใช้เครื่องตัวเองเนี๋ยแหละ localhost ใช้ cms เป็น public

INSTALLING
  • แตกไฟล์ MRTG ที่เราโหลดมาไปที่ C:\mrtg-2.16.2
  • ติดตั้ง ActivePerl ที่เราโหลดมา แล้วก็ทำการเพิ่ม C:\Perl\bin; เข้าไปใน System path ซะ
[Control Panel]->[System]->[Environment]
  • ทดสอบว่า perl เราที่เพิ่มเข้าไปใน System path ใช้ได้หรือยังโดย cd เข้าไปที่ C:\mrtg-2.16.2\bin สั่งคำสั่ง perl mrtg ถ้าไม่มีปัญหาผลลัพธ์ก็จะได้ประมาณเนี๋ย
c:\mrtg-2.16.2\bin> perl mrtg
Usage: mrtg <config-file>
mrtg-2.16.2 - Multi Router Traffic Grapher
Copyright 1995-2006 by Tobias Oetiker
Licensed under the Gnu GPL.

CONFIGURING MRTG
  • เข้าไปที่ทำงานที่พาธเนี๋ยเลยโดย cd C:\mrtg-2.16.2\bin
  • สร้าง dir ด้วยคำสั่ง md C:\www\mrtg จากนั้นสั่งคำสั่งด้านล่างเพื่อสร้าง cfg ไฟล์ของ localhost คำสั่งเนี๋ยจะหมายถึงประมาณสร้างไฟล์ mrtg.cfg ไว้ที่ C:\mrtg-2.16.2\bin ซึ่งในคอนฟิกมีการกำหนดค่า C:\www\mrtg ไว้สำหรับเมื่อเราทำการสร้าง png, log, html จะไปวางที่พาธเนี๋ยซึ่งเราต้องสร้าง virtual host ชี้มาที่นี่ด้วย
c:\mrtg-2.16.2\bin> perl cfgmaker public@localhost --global "WorkDir: c:\www\mrtg" --output mrtg.cfg
  • เปิดไฟล์ mrtg.cfg ขึ้นมาแก้ไขเล็กน้อยเพื่อความสวยงานของ png โดยทำการเพิ่มบรรทัดด้านล่างไว้ ด้านล่าง ### Global Config Options ซึ่งจะเป็นบริเวณตั้ง option เค้าอ่ะนะ ซึ่งจะอยู่บน html tag ซึ่ง WorkDir: c:\www\mrtg และ RunAsDaemon: yes เราสามารถวางไว้ข้างล่าง html tag ได้ แต่ Options[_]: growright, bits หรือ options อื่นๆ เราต้องวางไว้ก่อน html tag เสมอนะจะบอกให้ ในที่นี้ Options[_]: growright, bits เป็นการสร้าง กราฟ png โดยให้ลูกศรชี้ไปทางขวา และ แกน Y หน่วยกำหนดให้ใช้ bit ซึ่งปกติถ้าเราไม่ใส่ กราฟจะชี้ไปทางซ้าย และ หน่วยแกน Y เป็น Byte ซึ่งไม่ค่อยสวยอ่ะ
WorkDir: c:\www\mrtg
Options[_]: growright, bits
RunAsDaemon: yes
* บางทีเราสั่ง perl cfgmaker ... แล้วไม่ได้ไฟล์ cfg ที่เรากำหนดอาจเป็นเพราะว่า community string ผิดหรือ remote snmp ไม่ได้ ต้องตรวจสอบ
  • หลังจากสร้าง cfg และปรับแต่งแหละ ต่อไปเราจะสร้าง html, png, log ด้วยคำสั่ง ด้านล่างซึ่งผลของคำสั่งด้านล่างจะได้ไฟล์ซึ่งจะอยู่ใน c:\www\mrtg ที่เราได้กำหนดไว้ในคอนฟิกไฟล์ไง และ กราฟจะถึงวาดใหม่ทุกๆ 300 วินาที ( 5 นาที) ซึ่งเป็นผลของ RunAsDaemon: yes นั่นเอง ซึ่งถ้าเราไม่ใส่ RunAsDaemon: yes กราฟจะไม่มีการวาดใหม่ (เราสามารถสั่งโดยใช้ perl แทน wperl ก็ได้ แต่ในที่นี้แนะนำให้ใช้ wperl)
c:\mrtg-2.16.2\bin> wperl mrtg --logging=eventlog mrtg.cfg
  • ทำการสร้าง index.html ไฟล์ซะหน่อยด้วยคำสั่งด้านล่าง ขี้เกียจอธิบาย จบ
c:\mrtg-2.16.2\bin> perl indexmaker --output=C:\www\mrtg\index.html --columns=1 mrtg.cfg
  • MRTG เราใช้ได้แหละ ต่อมาก็แค่กำหนด virtual host ให้ IIS หรือ web server ที่เราใช้ให้ชี้ไปที่ C:\www\mrtg\ แค่เนี๋ย
Tips
  • การสร้าง MRTG กราฟด้านบนเป็นการสร้างการแสดง Traffic นะซึ่ง CPU Load และ Memory Used ก็สามารถสร้างกราฟได้เช่นกันแต่ คนเขียนทำไม่เป็น
  • เมื่อมีการ shutdown เครื่องและบูตเครื่องใหม่ MRTG จะไม่ทำงานอัตโนมัตินะ ถ้าต้องการให้ทำเอง อัตโนมัติเราก็จะต้องสร้าง bat หรือ cmd ไฟล์ โดยในไฟล์ให้เขียนคำสั่ง
wperl c:\mrtg-2.16.2\bin\mrtg --logging=eventlog mrtg.cfg
  • เพิ่มเข้าไปใน startup folder (จะทำการเมื่อมีการ logon เข้าระบบ) หรือ สร้าง bat ไฟล์แล้วเพิ่มเข้าไปใน task schedule ก็น่าจะได้เหมือนกัน (ไม่เคยลอง) แต่แนะนำทำเป็น windows service น่าจะเหมาะที่สุดนะ
  • การใช้ wperl จะไม่มี console window ขึ้นมานะแต่ perl จะมี console ขึ้นมา เค้าว่างั้น
If you use wperl instead of perl, no console window will show. MRTG is now running in the background. If it runs into problems it will tell you so over the EventLog. To stop MRTG, open the Task Manager and terminate the wperl.exe process. If mrtg has anything to tell you these messages can be found in the event log.
  • การคอนฟิก หรือ การใช้ cfgmaker , indexmaker เราสามารถใช้ wperl แทน perl ก็ได้นะ แต่เราจะไม่เห็น ผลจากการสั่งว่าสำเร็จหรือป่าว ใน console อ่ะนะ
  • อีกทางเลือกในการสั่ง MRTG ทำการอัตโนมัติคือ ทำ service ให้ perl หรือ wperl ดิด้วย FireDaemon
  • อีกเรื่องที่อยากบอกคือ MRTG จะสร้าง png, html, log ใหม่ทุกๆ 5 นาที เราสามารถตั้งค่าให้นานกว่านี้ก็ได้โดยเพิ่ม options บางอย่างเข้าไปใน cfg ไฟล์โดยใส่เป็นตัวเลขวินาที แต่เราไม่สามารถตั้งในน้อยกว่า 5 นาทีได้นะเท่าที่เคยทำมา จนถึงตอนเนี๋ย หรือว่าเราทำไม่เป็นหว่า ^^' มั่วไปเรื่อย
  • ลืมบอกอีกเรื่อง คือ ในที่นี้ทดสอบเปิด service snmp บน localhost แต่ถ้าเราต้องการทดสอบกับ remote snmp ระวังเรื่อง firewall ด้วย ประเด็นมีอยู่ว่า ตอนนี้ใช้ windows 7 ในการคอนฟิก MRTG และก่อนหน้านี้ได้โหลด net-snmp มาทดสอบ snmpwalk บนเครื่อง localhost ก็ใช้ได้ แต่พอ walk ไปที่ remote snmp no response ซะงั้นซึ่ง remote snmp ก็ได้ตรวจสอบ service (snmp agent บน remote host) ให้ accept any host และ firewall เรียบร้อยแล้ว
  • ลองลง net-snmp บน remote snmp และทำการ walk ในเครื่อง remote snmp ก็ไม่มีปัญหา แต่ walk จาก เครื่องเราไม่ได้หว่า เลยลองปิด firewall ที่เครื่องซะเลย และทำการ walk อีกรอบ ปรากฏว่า walk ไปที่ remote snmp ได้หว่า
  • ซึ่งน่าจะอนุมาน อาไรบางอย่างได้นะ walk ไม่ได้ก็อาจะใช้ MRTG กับ remote snmp ไม่ได้เช่นกัน เข้าใจปะ (ถ้าเราไม่ปรับ firewall บนเครื่องเราให้ปล่อย เรื่องนี้อ่ะนะ)
  • การใช้ indexmaker เราสามารถสร้าง index.html ได้ในขณะที่ MRTG กำลังทำงานอยู่ โดย stop firedaemon mrtg service ทำการลบไฟล์ png, html, log และ start mrtg service อีกรอบ

Reference

Usage FireDaemon With MRTG


Reference

How To Run MRTG as a Windows Service with FireDaemon

Introduction
Multi Router Traffic Grapher (MRTG) is an excellent tool to monitor the traffic load on network-links (amongst other things). It achieves this by examining the various OID's of SNMP enabled devices that you specify to produce a range of graphs. It is written in Perl.

It is relatively easy to setup MRTG to run as a service under Windows NT/2K/XP/2K3. However, before you begin we recommend that your read ALL the documentation shipped with MRTG and available from the MRTG master web site: http://oss.oetiker.ch/mrtg/.

Detailed documentation on configuring MRTG under Windows can be found here: http://oss.oetiker.ch/mrtg/doc/mrtg-nt-guide.en.html

We strongly recommend that your get MRTG going manually before attempting to run it as a service (ie. make it the last step in your installation process). The example that we give below is very simple and concentrates on configuring MRTG and FireDaemon correctly.

Attempting to run MRTG off or generating output to network drives is not recommended. MRTG and FireDaemon should be installed locally. If you really have to use a network drives familiarise yourself with the use and limitations of UNC paths and install the service as a local or domain user. Refer to this article on configuring FireDaemon to use mapped drives or UNC paths.

You can also use Trinity to manage your MRTG services via a web browser.

Software
Download and install the latest version of the following software (adjust paths to suite your installation): SNMP Setup
Your SNMP configuration will be dependent on the device or software you are setting up. For example, on a Foundry Networks ethernet switch you might configure SNMP as follows:

Code:
aaa authentication snmp-server default local
snmp-server community public ro
snmp-server community private rw
snmp-server contact James Bourne
snmp-server location Cobbitty, NSW, Australia

interface ethernet 1/1
port-name External Interface
interface ethernet 1/2
port-name Internal Interface
On Astaro Security Linux you might configure it as follows:

This image has been resized. Click this bar to view the full image. The original image is sized 1020x770.


On a DLink DSL-G604T you might configure it as follows:

This image has been resized. Click this bar to view the full image. The original image is sized 841x634.


Web Server
You are going to need to setup a web server in order to serve the HTML pages MRTG generates. LightTPD, IIS or Apache all work fine under Windows. You will need to create a directory under your web server that MRTG can write to. For example: C:\Program Files\Apache2\htdocs\mrtg or C:\lighttpd\htdocs\mrtg.

MRTG Configuration File
Next step is to create an MRTG configuration file. Your community strings and IPs are specific to your installation. Do this as follows at a command prompt (Start/Run/cmd):

Code:
cd \program files\mrtg-2.14.3\bin
perl cfgmaker public@10.1.1.1 --output dlink.cfg
You then need to edit the configuration file that you just generated (in this case dlink.cfg). Use notepad or your favourite text editor and insert the the following lines at the start:

Code:
RunAsDaemon: yes
Interval: 5
WorkDir: C:\PROGRA~1\APACHE~1\APACHE2\HTDOCS\MRTG
Change WorkDir to where you want MRTG to generate it's HTML files and PNG graphs. MRTG won't accept a WorkDir with spaces in the name. Either use a WorkDir path with no spaces or use the 8.3 abbreviation. (ie. C:\PROGRA~1\APACHE~1\APACHE2\HTDOCS\MRTG). A quick way of determining the 8.3 naming of your path is to run a Command Prompt (Start/Run/cmd), then change directory to your WorkDir, then type "command" - the DOS prompt will display the path in 8.3 format.

Also, note that setting your Interval to less than 5 minutes will cause an error. Now run MRTG manually to test your configuration as follows (you might have to kill off MRTG via the Task Manager since it has been daemonised):

Code:
perl mrtg --logging=mrtg.log dlink.cfg
Check your WorkDir and confirm that the various HTML and PNG files have been generated and that there are no errors in the log file (mrtg.log). Alternately, you can log to the Windows EventLog by substituting "eventlog" for "mrtg.log" above.

FireDaemon Configuration
Once you are satisfied that your MRTG configuration is doing what you want and generating the appropriate graphs, you need to set it up as a service with FireDaemon. Start the FireDaemon Service Manager from the Start/Programs menu or desktop icon.

Click on the Create A New Service Definition button in the Toolbar or press Ctrl+N. Fill out the panel as per the screen shot below (adjust your paths and configuration file names to suite) - you can use the TAB or SHIFT+TAB keys to move between fields:



Now click on the Settings tab and uncheck Interact with Desktop:



Then install the service by clicking on the Install button. The service should install without errors and start automatically. Check that the service has been started correctly by examining the process list in the Task Manager (look for firedaemon.exe and perl.exe) and that the MRTG statistics are being updated (point your browser at http://localhost/mrtg/). You can also check the NT/2K/XP/2K3 event log for FireDaemon events and errors.

Running Multiple MRTG Instances
You can run multiple instances of MRTG on the same machine. Just ensure that you create a service with a differing name (eg. mrtg1, mrtg2 etc.). It is also advisable to configure each MRTG instance independantly of each other (ie. differing configuration files, target HTML directories and so forth).

Exporting FireDaemon Service Configurations
FireDaemon service configurations can be exported to XML. Simply drag and drop the service definition from the main FireDaemon GUI onto your desktop. Alternately, you can bulk import/export via batch script.

Troubleshooting
OK, so you have installed MRTG, tested the installation to the n-th degree and you now notice that your Application Event Log is filling up with a three FireDaemon error messages:
  • The FireDaemon Process was Started
  • The Service Failed To Shutdown Correctly ...
  • SubProcess Monitoring Failed ...
The error messages are generated by FireDaemon's Service Monitoring Facility (SMF). In a nutshell: MRTG is dying because of a misconfiguration. So how do you debug your configuration? There are several approaches but you are going to need: a text editor that handles Unix end of line characters (eg. VIM), your trusty Perl reference manual and some patience.

MRTG from versions 2.9.17 onwards include a command line switch: --logging, which allows all debugging and other output to be written to a file.

The most common error is that the MRTG configuration file is broken. For example, spaces in front of configuration directives (as listed above) will break your MRTG installation. If you are writing your output to a directory located on a network drive then you are going to have to setup your service to run as a local or domain user in order to access shares via mapped drive letter or UNC path.

Below is one approach to track down MRTG errors.
  • Ensure that your MRTG Service has been stopped via FireDaemon Service Manager, Services Applet or command line: net stop mrtg
  • Ensure that you have read _ALL_ the MRTG documentation
  • Ensure that you have followed this guide to letter!
  • Open a console window (command prompt - Start/Run/cmd.exe)
  • Change directory to your MRTG bin folder (eg. C:\Program Files\mrtg-2.14.3\bin)
  • Edit the file 'mrtg' with your text editor (eg. gvim mrtg)
  • Look for the following line: @main:EBUG=qw();
  • Modify this line to read the following: @main:EBUG=qw(base);
  • Save and quit out of your text editor
  • Now attempt to run MRTG damonised manually: perl mrtg -logging=mrtg.log astaro.cfg
  • If you want even more debugging: perl -w mrtg --logging=mrtg.log dlink.cfg (or -W)
  • Any configuration or processing errors will be easy to spot
  • Review the contents of your log file if you specified the --logging option
If your MRTG configuration is good then you should see something like this in the log file:

Code:
2006-05-22 03:31:54 -- Started mrtg with config 'dlink.cfg'
2006-05-22 03:31:54 -- --base: Creating Lockfiles dlink.cfg_l,dlink.cfg_l_932
2006-05-22 03:31:54 -- --base: Reading Config File: dlink.cfg
2006-05-22 03:31:54 -- --base: Reading Interface Config cache
2006-05-22 03:31:54 -- --base: Checking Config File
2006-05-22 03:31:54 -- --base: Loading default Locale
2006-05-22 03:31:54 -- --base: Starting main Loop
2006-05-22 03:31:54 -- --base: Populate Target object by polling SNMP and external Datasources
2006-05-22 03:31:54 -- --base: Act on Router/Target 10.1.1.1_2
2006-05-22 03:31:54 -- --base: Get Current values: in:0, out:453298, up:8 days, 13:03:55, name:DSL-G604T, time:1148232714
2006-05-22 03:31:54 -- --base: Create Graphics
2006-05-22 03:31:54 -- --base: Check for Thresholds
2006-05-22 03:31:54 -- --base: Check for Write HTML Pages
2006-05-22 03:31:54 -- --base: Act on Router/Target 10.1.1.1_3
2006-05-22 03:31:54 -- --base: Get Current values: in:52374150, out:19040990, up:8 days, 13:03:55, name:DSL-G604T, time:1148232714
2006-05-22 03:31:54 -- --base: Create Graphics
2006-05-22 03:31:54 -- --base: Check for Thresholds
2006-05-22 03:31:54 -- --base: Check for Write HTML Pages
2006-05-22 03:31:54 -- --base: Act on Router/Target 10.1.1.1_5
2006-05-22 03:31:54 -- --base: Get Current values: in:0, out:0, up:8 days, 13:03:55, name:DSL-G604T, time:1148232714
2006-05-22 03:31:54 -- --base: Create Graphics
2006-05-22 03:31:54 -- --base: Check for Thresholds
2006-05-22 03:31:54 -- --base: Check for Write HTML Pages
2006-05-22 03:31:54 -- --base: Act on Router/Target 10.1.1.1_6
2006-05-22 03:31:54 -- --base: Get Current values: in:15392606, out:52639324, up:8 days, 13:03:55, name:DSL-G604T, time:1148232714
2006-05-22 03:31:54 -- --base: Create Graphics
2006-05-22 03:31:54 -- --base: Check for Thresholds
2006-05-22 03:31:54 -- --base: Check for Write HTML Pages
Search throught this file looking for any errors. For example:

Code:
2006-05-22 03:34:34 -- Started mrtg with config 'dlink.cfg'
2006-05-22 03:34:34 -- --base: Creating Lockfiles dlink.cfg_l,dlink.cfg_l_1164
2006-05-22 03:34:34 -- --base: Reading Config File: dlink.cfg
2006-05-22 03:34:34 -- --base: Reading Interface Config cache
2006-05-22 03:34:34 -- --base: Checking Config File
2006-05-22 03:34:34 -- ERROR: CFG Error in "Interval": should be at least 5 Minutes (unless you use rrdtool) at c:/program files/mrtg-2.14.3/bin\..\lib\mrtg2/MRTG_lib.pm line 737.
2006-05-22 03:34:40 -- Started mrtg with config 'dlink.cfg'
2006-05-22 03:34:40 -- --base: Creating Lockfiles dlink.cfg_l,dlink.cfg_l_1844
2006-05-22 03:34:40 -- --base: Reading Config File: dlink.cfg
2006-05-22 03:34:40 -- --base: Reading Interface Config cache
2006-05-22 03:34:40 -- --base: Checking Config File
2006-05-22 03:34:40 -- ERROR: CFG Error in "Interval": should be at least 5 Minutes (unless you use rrdtool) at c:/program files/mrtg-2.14.3/bin\..\lib\mrtg2/MRTG_lib.pm line 737.
Now attempt to restart your MRTG Service: net start mrtg. If you are still seeing error messages in your Application Event Log then review your debug log files. Also it is highly likely that the arguments you stipulated when you installed MRTG as a service with FireDaemon are erroneous. We suggest you do the following:

- Remove your existing service via the FireDaemon Service Manager or command line: "%FIREDAEMON%" --uninstall mrtg
- Reinstall the service with FireDaemon checking that the arguments you are passing to it are correct.

For example, if your MRTG configuration file is myrouter.cfg then when you specify your Application Options type: mrtg myrouter.cfg. DON'T TYPE: mrtg dlink.cfg because THIS WILL NOT WORK because you do not have a configuration file called dlink.cfg.

Issues When Running Multiple FireDaemon / MRTG Services
You may run into Application Initialization errors when running extremely large numbers of non-interactive FireDaemon/MRTG services (30-40+).

Whilst at first this might seem like a problem with FireDaemon it is actually because the default size of the non-interactive window station desktop heap is too small. In order to fix this we need to increase the size of the desktop heap for each desktop that is associated with a "noninteractive" window station.

Read this article for more information on how to increase the size of the desktop heap.

Summary
In summary, MRTG is a comprehensive yet complicated product. Breaking it via misconfiguration is extremely easy. We urge you to read the MRTG documentation carefully and fully test your configuration of MRTG in daemonised and non-daemonised modes employing the debugging tips listed above before attempting to convert it to a service with

From

Sunday, August 30, 2009

มาป้องกันการบาดเจ็บจาก (RSI) กันเถอะ

  • เป็นบทความที่ดีมากๆ ต่อคนที่ชอบนั่งหน้าคอมบ่อยๆ อย่างพวกเรา
  • ที่มา: http://www.ubuntuclub.com/node/1469

มาป้องกันการบาดเจ็บจาก repetitive strain injury(RSI) กันเถอะ


นายแพทย์กำจร ตติยกวี ผู้อำนวยการศูนย์สารสนเทศทางการแพทย์เพื่อประชาชนจุฬาลงกรมหาวิทยาลัย กล่าวว่า RSI หรือ repetitive strain injury เป็น อาการที่เกิดจากการนั่งทำงานอยู่หน้าเครื่องคอมพิวเตอร์นานๆ เกิดขึ้นจากการนั่งทำงานแบบไม่ถูกสุขลักษณะ เช่น ลักษณะการวางมือบนแป้นพิมพ์ การบาดเจ็บซ้ำซาก (RSI: repetitive stress injury, repetitive strain injury) สามารถเกิดได้ทุกส่วนของร่างกาย ตั้งแต่แขน ข้อมือ ข้อนิ้ว แผ่นหลัง ต้นคอ หัวไหล่และสายตา หากปล่อยไว้นานๆ อาจต้องผ่าตัดเอ็น [1]

Workrave logo.png

Workrave เป็นโปรแกรมที่ช่วยป้องกันการเกิด Repetitive Strain Injury (RSI) โดยทำการเตือนคุณในแบบ micro-pauses(พักครู่เดียว), rest breaks(ยืดเส้นยืดสาย มีตัวอย่าง exercise ด้วย) และ daily limit(วันนี้พอแล้ว) ตัวโปรแกรมสามารถติดตั้งได้ทั้งระบบ GNU/Linux and Microsoft Windows. และที่สำคัญ โปรแกรมนี้ฟรีครับ (GNU General Public License)

Linux Screen Shots

main window

micro-pause


มีท่าบริหารด้วยนะ

การติดตั้งสำหรับ ubuntu

$ sudo aptitude install workrave

หวังว่าโปรแกรมนี้คงมีประโยชน์ไม่มากก็น้อยสำหรับทุกๆคนที่นั่งหน้าคอมพ์ทั้งวันนะครับ

NOTE: สำหรับ windows http://www.workrave.org/download/

windows screen shots http://www.workrave.org/screenshots/windows/

คัดลอกมาจาก: [1] http://gotoknow.org/blog/microcosm/269881

อ้างอิง: www.thnic.or.th/activity/project04/project04-seminar.doc

http://en.wikipedia.org/wiki/Repetitive_strain_injury

http://eeshop.unl.edu/rsi.html

http://www.safecomputingtips.com/blog/healthy-computing/are-you-at-a-risk-of-repetitive-strain-injury/

http://en.wikipedia.org/wiki/Workrave

http://www.workrave.org/welcome/

Friday, August 28, 2009

Mobile Media Converter

  • The Mobile Media Converter is a free video and audio converter that uses ffmpeg to convert between popular desktop formats like MP3 audio, WMA, OGG audio, WAV audio, MPEG video, AVI video, WMV, FLV and commonly used mobile phones formats like AMR audio and 3GP video.
<-> format table:
from and to
Desktop Audio: mp3, wma, ogg, wav
Mobile Audio: amr, mp4
Desktop Video: wmv, mpeg, avi, flv, mov
Mobile Video: 3gp, mp4
  • ที่สำคัญคือ ใช้กะ ubuntu เราได้ด้วยแหละ
  • Get it...

From

Install twhirl (twitter client) on ubuntu 9.04

  • ติดตั้ง Adobe AIR ก่อนเลย ดาวน์โหลดที่นี่ เราจะได้ไฟล์ AdobeAIRInstaller.bin
  • เปลี่ยนสิทธิ์ใหม่หน่อยโดยเพิ่ม excute ไฟล์ได้ และ ทำการติดตั้ง
sudo chmod 777 AdobeAIRInstaller.bin && sudo ./AdobeAIRInstaller.bin
  • เมื่อเครื่องเรามี Adobe AIR แหละ ติดตั้ง twhirl ต่อเลย ไปดาวน์โหลดได้จากที่นี่
  • เราจะได้ไฟล์ twhirl-0.9.2.air (ชื่อประมาณนี้แหละ) ทำการ ดับเบิ้ลคลิกติดตั้งได้เลย
  • ติดตั้ง twhirl เสร็จโปรแกรมจะอยู่ที่ applications => accessories เราจะเห็น Adobe AIR อยู่ด้วย
  • ถ้ามีปัญหาเรื่องภาษาไทยเรา ก็ให้คลิกที่ รูปปะแจ แล้วก็เลือก font ได้ตามชอบ ปิดและเปิด twhirl ใหม่ หรือ ลองเลื่อนบาร์ขึ้นลง น่าจะเห็นภาษาไทยแหละ
ทิป
  • เราสามารถเข้าไปที่ http://www.twhirl.org/ จะเห็นกรอบอยู่ทางด้านขวา
  • ซึ่งจะมีลิ้งดาวน์โหลด Adobe AIR และ Twhirl อยู่ด้วยกัน

อ้างอิง

Local Mode Reporting in Desktop Applications

1. Architetcure

2. Abstract

Report Viewer control can be configured to process reports locally so that they use the built-in processing provided by the control. When we configure the Report Viewer control for local processing, all report processing is performed on the computer that hosts the application. All data used by the report must be retrieved from data that the client application provides.

Data sources that are used in the reports must be defined in advance, during report design. At run time, application must generate the data table or retrieve the data that is used in the report. Locally processed reports can get data from data tables and Business objects. The steps for configuring a data source for a locally processed report vary depending on whether we are using the Web server control or the Windows Forms control.

2.1 Local Mode

In local mode, the Report Viewer morphs itself into a mini-Report Server. In this configuration, the Report Viewer control handles the report processing and rendering, not the Report Server. In fact, if we plan to use local mode only, we don't need Reporting Services at all (neither at design nor at runtime). That's because the Report Viewer controls don't have any dependencies to the Report Server. Local mode offers the following advantages:

Easy report distribution. Can package the report definitions with the application and distribute them without requiring the customers to have the Report Server installed.

Flexible data binding scenarios. The application can bind the local report to an ADO.NET dataset or a business object. As with RS 2000, binding datasets to server reports is not supported and may require a custom data extension.

Before we get too excited about not needing the Report Server (and a SQL Server 2005 license), take some time to compare and evaluate remote and local modes. We shouldn't view the Report Viewer local mode as a replacement for Report Server; its features are limited to report processing and rendering only, which means no report catalog, no caching, no subscribed delivery, no security, etc. In addition, it limits export formats to PDF and Excel only. Therefore, the Report Server and the Report Viewer are not competing products, they're complementary technologies. The Report Server gives a server-based reporting platform; the Report Viewer makes it easy to distribute the reports with custom applications.

In the absence of Report Server, the Report Viewer must obtain its data from the application. In local mode, the application is responsible for providing the necessary input to the report. That's why the Report Viewer doesn't display the parameter prompt area with local reports. Parameters and data are external to Report Viewer.

2.2 Steps

Authoring a local report consists of three steps:

Configure the report data source

Design the report layout

Request the local report programmatically

Note: To differentiate remote from local reports, the RS team introduced a RDLC file extension where "C" stands for client-side processing; a logical difference only. We describe both server (RDL) and client-side reports (RDLC) in the same XML schema-Report Definition Language. The RDLC definitions are more flexible because the Report Server doesn't validate them.

2.2.1 Configuring the Report Data Source

If we have a server report that we need to convert to a local report, we can skip this step. That's because the report definition already describes the dataset(s) that will feed the report. The only thing left is to bind the local report to an application dataset with an identical schema at runtime. If we create a local report from scratch, there are two ways to create a data source in Visual Studio.NET—inside the local report itself or as an external dataset.

Selecting a Report Data Source

To try this option, create a new local report (right-click on the project node in the Solution Explorer and choose Add-->New Item-->Report. Next, click on the Add New Data Source button inside the Data Source window. This starts the Data Source Configuration Wizard which allows creating a data source from a database (table, view, or stored procedure), Web service, or an application object. However, as it stands, the Data Source Configuration Wizard does not support free-form SQL queries.

Project-level Dataset

A second (and recommended) way is to add a new dataset to the project. For example, here is how we can create an identical dataset definition to the one used by the Customer Orders server-side report.

1. Right-click on the project and choose Add-->New Item-->Dataset.

2. Right-click on the Dataset Designer canvas and choose Add-->TableAdapter. This launches the TableAdapter Configuration Wizard

3. Create a connection to the database or create a new one if it doesn't already exist. Save the connection string in the application configuration file if required.

4. In the "Choose a Command Type" step, select appropriate type and proceed further.

5. In the "Choose Methods to Generate" step, accept the defaults and finish the wizard.

6. Rename Data Table and datasets as required.

The end result of running the Table Adapter Configuration Wizard is a typed dataset as shown in Figure.

With either approach, all typed datasets defined in the project are made available to the report, so we can proceed to authoring the report from these datasets.

2.2.2 Designing a Local Report

With the report data source in place, we can proceed to author the actual report. (Don't need to worry even if the Reporting Services aren’t installed and cannot use the Report Designer).

VS.NET 2005 includes a scaled-down version of Report Designer (for the lack of better term, let's call it Local Report Designer) which we can use to design local reports right inside the code project. To do so, just double-click on the report definition file that we've already added to the project. We will undoubtedly find the Local Report Designer as shown in the figure. However Local Report Designer features are more limited. For example, the Local Report Designer doesn't have Data and Preview tabs because a local report doesn't know where to get its data from. Remember, in local mode, the application supplies data and parameters at runtime.

When we are done authoring the report, we can remove the report definition file from the project. Upon deployment, the application setup program could copy the report definition to a known location where the Report Viewer can find it.

2.2.3 Requesting a Local Report

The final step to implement local report processing is writing some code to request the report using the Local Report object.

private void GenerateReport(enumReportType reportType)

{

rptVwr.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;

rptVwr.LocalReport.EnableHyperlinks = true;

localReport = rptVwr.LocalReport;

LoadDataSets(reportType);

localReport.ReportPath = reportPath;

this.rptVwr.RefreshReport();

}

private void LoadDataSets(Guid paramGuid)

{

reportDataSource = new ReportDataSource();

switch (reportType)

{

case (ReportTypes.EntityDetailsReport):

Report.GetEntityDetails(dataBase, ref dataSet);

this.reportPath = Properties.Resources.REPORT_ENTITYDETAILS_RDLC_PATH;

reportDataSource.Name = "EntityDetailsReportDataSet_EntityDetails";

reportDataSource.Value =dataSet.Tables["EntityDetails"];

localReport.DataSources.Add(reportDataSource);

break;

case (ReportTypes.EntityPropertyReport):

Report.GetPropertySheetInfo(dataBase, ref dataSet);

this.reportPath = Properties.Resources.REPORT_ENTITYPROPERTYSHEET_RDLC_PATH;

reportDataSource.Name = "EntityDetailsReportDataSet_PropertySheet";

reportDataSource.Value = dataSet.Tables["PropertySheet"];

localReport.DataSources.Add(reportDataSource);

break;

}

}

First, the code configures the ReportViewer for local processing. Next, the code sets LocalReport.ReportPath to the local report definition file (by default, it will try to find it from the executable folder). As a security measure, if the local report uses navigation actions (hyperlinks), we need to explicitly enable hyperlinks (more on this in a moment). In addition, we'll need to elevate the CAS permissions of the local report by running the report in the current application domain. That's because the GetAppPath() embedded function needs FileIOPermission to get the application path where the external image is located.

2.3 Handling ReportViewer Events

The ReportViewer supports a number of events that the code can handle at runtime. For example, the Windows Forms ReportViewer always processes the report request on a background thread to keep the main application thread responsive. If the application needs to be notified when the report is ready, it can sink the RenderingComplete event. It is important to note that these events are raised by the control, not by the report processor. Therefore, we cannot use these events to change the report definition. Instead, the ReportViewer raises events when the control state changes, giving the application a chance to do some pre- or post-processing of remote and local reports.

Although the ReportViewer raises events in both modes, we will probably find them more useful in local mode. That's because in local mode, the application handles additional reporting tasks, e.g. passing data to a drillthrough report or subreport, collecting parameters, etc. The example demonstrates how the application can handle two of the most useful events—Drillthrough and Hyperlink.

2.4 Implementing Report Drillthrough

As with its server counterpart, the EntityDetails local report allows the end user to click on an Entity to drill through to the EntityDetails.rdlc report and see the Entity details. However, as with any local report, the application has to supply the data for the drillthrough report. This happens in the Drillthrough event.

private void rptVwr_Drillthrough(object sender, DrillthroughEventArgs e)

{

localReport = (LocalReport)e.Report;

IList paramList = localReport.OriginalParametersToDrillthrough;

if (paramList.Count > 0)

{

if (Properties.Resources.REPORT_ENTITYPROPERTYSHEET_RDLC_PATH.Contains(e.ReportPath))

{

if (string.Compare(paramList[0].Name, PARAM_ENTITY_ID, true) == 0)

{

if (paramList[0].Values.Count > 0)

{

Guid entityId = new Guid(paramList[0].Values[0]);

if (entityId != Guid.Empty)

{

reportType = ReportTypes.EntityPropertyReport;

LoadDatasetAndReportPath(entityId);

}

}

}

}

}

}

The ReportViewer passes the drillthrough target report in the DrillthroughEventArgs argument. First, the code checks the source of the drillthrough event. In this case, we need handle only drillthrough events, and only those from local reports. The application gets the selected Entity Id from the OriginalParametersToDrillthrough property. Finally, the application passes the two datasets to the Entity Details report.

Building a report-enabling custom application doesn't have to be a tedious chore. If we are tasked to report-enable.NET 2.0 Windows Forms applications and we target RS 2005, do yourself a favor and use the Windows Forms ReportViewer. Configure the ReportViewer in remote mode when requesting server reports, and consider local mode, when we need to distribute reports with the application or bind the report to an application dataset.

อ่านดูเค้าบอกว่า
  • Therefore, the Report Server and the Report Viewer are not competing products, they're complementary technologies. The Report Server gives a server-based reporting platform; the Report Viewer makes it easy to distribute the reports with custom applications.
  • Report Server = Server mode, Report Viewer = Local mode

From

Using SQL Server 2005 Reporting Services with SQL Server 2005 Express Edition

From: http://msdn.microsoft.com/en-us/library/cc966542.aspx

Published: June 26, 2006

SQL Server Technical Article

Writers: Anthony T. Mann, President, Mann Publishing Group

Applies To: SQL Server 2005

Summary: This paper introduces using SQL Server 2005 Reporting Services with SQL Server 2005 Express Edition. It discusses key scenarios for using each product and how to design and develop Reporting Services solutions.

On This Page

Introduction
Downloading SSE and SSRS
Scenarios
Administration
Report Development
Testing and Staging SSRS Applications
Deploying SSRS Solutions
Report Packs
Uninstalling SSE and SSRS
Conclusion

Introduction

Microsoft® SQL Server™ 2005 Express Edition (commonly referred to as SQL Express, or SSE) is a free version of SQL Server 2005. It contains many of the important advances in SQL Server 2005 over its predecessor, SQL Server 2000, including SQL Server Reporting Services (SSRS).

This white paper introduces you to the SQL Server 2005 Reporting Services features that are available with SQL Server 2005 Express Edition. This white paper focuses on downloading, installing, configuring, designing, and deploying reports.

What is SQL Server 2005 Reporting Services?

SQL Server 2005 Reporting Services (SSRS) is a robust reporting solution that runs on Microsoft Internet Information Services (IIS) on Microsoft Windows® XP, Windows 2000, and Windows Server™ 2003. It works with data that resides on the SQL Server 2005 platform, as well as other data sources. SSRS can deliver reports in a variety of formats. The reports can be delivered on paper or through interactive Web-based reports.

SQL Server Reporting Services supports the full reporting life cycle, including:

  • Report authoring. Report developers can create reports to be published to the report server by using design tools that use Report Definition Language (RDL), an XML-based industry standard used to define reports.

  • Report management. Report definitions, folders, and resources are published and managed as a Web service. Managed reports can be executed either on demand or on a specified schedule, and are cached for consistency and performance.

  • Report delivery. SQL Server Reporting Services supports both on-demand (pull) and event-based (push) delivery of reports. Users can view reports in a Web-based format or in e-mail.

  • Report security. SQL Server Reporting Services implements a flexible, role-based security model to protect reports and reporting resources. The product includes extensible interfaces for integrating other security models as well.

Because you can configure security into reports, your sensitive data is protected. Report security specifies which reports a user can access. At a more granular level, report security uses Windows or SQL Server Authentication for data sources. You can use SSRS in SSE to create very robust reports that can be redistributed to other users, while allowing connections only to data sources that reside on the same computer as the one that runs SSRS.

There are two basic components for SSRS: Report Server and the Business Intelligence Development Studio (BIDS). Report Server is the run-time component that comes in the SQL Server 2005 Express Edition with Advanced Services. Report Server is the component that enables reports to run using SSRS. BIDS is the component that enables you to design, develop, and deploy reports to Report Server. BIDS is available in the SQL Server 2005 Express Edition Toolkit download.

Key benefits

Key benefits of using SSRS include:

  • Reporting for ISV applications – Custom reports can be distributed along with SSE for a complete robust platform.

  • Multiple report types – SSRS enables you to define reports as Microsoft Excel worksheets, PDF documents, images, and DHTML pages.

  • Multiple reporting elements – SSRS enables you to add one or more data regions to a report to display tables, charts, graphs, and images.

  • Parameterized reports – Using parameters that can be configured at runtime, reports can be customized to display data that is filtered based on those parameters.

  • VBScript – Using Microsoft Visual Basic® Scripting Edition (VBScript), you can make very complex reports that contain custom functionality.

  • Ad-Hoc Reporting- In SQL Server 2005 Workgroup Edition and above, SSRS includes Report Builder, a new ad-hoc reporting tool that enables business users to create their own reports. This feature is not available in SQL Express Edition.

Server 2005 Reporting Services features

SSRS is included in all editions of SQL Server 2005. Which features are available to SSRS is dictated by the edition of SQL Server 2005 that you are using. SQL Express contains a subset of the overall SSRS features.

The following table outlines the features that are available in the Express edition of SQL Server 2005, as well as features in the other editions of SQL Server 2005 and features supported by the Report Controls shipped in Microsoft Visual Studio® 2005.

Feature

Report Controls

Express

Workgroup

Standard

Enterprise

Web Service

No

Yes

Yes

Yes

Yes

Report Builder

No

No

Yes

Yes

Yes

Report Data Sources

.NET data sets

Local SQL only

Local SQL only

Extensible

Extensible

Number of export formats

Excel, PDF, Image (RGDI, Print), DHTML

Excel, PDF, Image (RGDI, Print), DHTML

Excel, PDF, Image (RGDI, Print), DHTML

Extensible

Extensible

SQL Server Agent

No

No

Yes

Yes

Yes

Maximum CPUs

Application specific

1

2

4

No limit

Maximum RAM

Application specific

1 GB

3 GB

OS Max

OS Max

Subscriptions

No

No

No

Yes

Yes

Data-driven subscriptions

No

No

No

No

Yes

SharePoint Integration

No

No

No

Yes

Yes

Caching

No

No

No

Yes

Yes

History

No

No

No

Yes

Yes

Delivery

No

No

No

Yes

Yes

Features Available in SQL Server 2005 Editions

For more information about SQL Server 2005 Reporting Services, please see http://www.microsoft.com/sql/technologies/reporting/default.mspx.

Downloading SSE and SSRS

Obtaining SQL Server 2005 Reporting Services for SQL Server 2005 Express Edition is as simple as a download.

To download SSE and SSRS

  1. Decide which download you need by reviewing the list of features in the previous table.

  2. Go to http://msdn2.microsoft.com/en-us/express/bb410792.aspx.

  3. Download the following:

    1. SQL Server 2005 Express Edition with Advanced Services

    2. SQL Server 2005 Express Edition Toolkit

  4. For information on installing, see Installing SSE and SSRS.

Scenarios

This section presents some ideas for scenarios under which SSE and SSRS can be used together.

Point of Sale applications

Point of Sale (POS) applications are a perfect scenario for using SSE and SSRS together. An example of a POS application is that of a retail store. Each cash register might contain a POS application that runs on SSE and provides SSRS reports. Each cash register could send its data to a centralized server each night.

SSRS reports could be used to generate real-time data stored in the local database, such as sales transactions, numbers of sales and returns, customer traffic volumes, and more.

ISV applications

Most Independent Software Vendor (ISV) applications use a database to store application data or configuration data. ISVs could distribute SSE and SSRS along with their applications.

Distributing SSE and SSRS is very simple. SSE can be distributed by using ClickOnce technology. SSRS is also simple to deploy by publishing reports to a Web service.

Web applications

Basic Web applications can benefit from SSE and SSRS applications. For example, a basic site that does not get many daily hits can store data in SSE. Then, SSRS reports can be used to generate nearly all kinds of data, such as site traffic reports, user profiles, user registration information, and more.

Administration

Administering SSRS is easy. This section outlines how to install and configure SSE and SSRS.

Installing SSE and SSRS

SSRS is available as a free download. Before you install either SSE or SSRS, you must meet the basic prerequisites. They are:

  • .NET Framework 2.0 – You can install the .NET Framework 2.0 by downloading it from http://msdn2.microsoft.com/netframework/default.aspx.

  • Internet Information Services – This is required only if you are going to use SSRS, but not if you are going to use SSE by itself.

  • Internet Explorer 6.0 SP1

  • 512 MB RAM

  • 600 MB Hard Disk Space

To install SSE and/or SSRS

Note If you have a beta version of SSE installed on your computer, you must first uninstall it. For instructions, see Uninstalling SSE and SSRS later in this paper.

  1. Download SSE and/or SSRS. For instructions, see Downloading SSE and SSRS earlier in this document.

  2. Run the executable associated with the download.

  3. Install the required components for all downloads of SSE. This is shown in Figure 1.

    Cc966542.UsRSwExpFig1(en-us,TechNet.10).jpg

    Figure 1 Installing required prerequisites
  4. The installation program runs the system configuration checker. This tool automatically checks to see if you have all required prerequisites. If you don’t, an error message appears. You must fix any errors before continuing. One common error is to not have Internet Information Services installed first.

  5. Choose which features to install. Figure 2 shows Feature Selection options for SQL Server 2005 Express with Advanced Services.

    Cc966542.UsRSwExpFig2(en-us,TechNet.10).jpg

    Figure 2 Feature selection
  6. After you choose which features to install, select the authentication mode for SSE. Select one of the following:

    • Windows Authentication Mode – All security permissions are assigned according to Windows accounts (either local or domain accounts).

    • Mixed Mode – Security permissions are assigned according to Windows accounts or accounts that are stored in SSE.

  7. By default, Reporting Services is not marked for installation. To install it, click the arrow next to the red X and select Install this Component from the drop-down menu.

  8. Specify how to install and configure Reporting Services. If IIS is installed, the default option is to install and configure SSRS. If IIS is not installed, the default option is to install only SSRS. In the latter case, you must manually configure SSRS.

    By default, SSE is installed as a named instance called SQLExpress. Therefore, the SSRS Web sites will be as follows:

    • Report Server – http:///ReportServer or http://localhost/ReportServer$SQLExpress

    • Report Manager – http://localhost/reports$SQLEXPRESS or http:///reports

  9. The final step is to select whether you want to report setup errors to Microsoft and whether you wish to collect and remit usage data to Microsoft. By providing this information to Microsoft, you give valuable feedback that helps the SQL Server Express development team. By default, neither option is selected.

Configuring SSRS

After you install SSRS, you must configure it to ensure that it functions properly. Configuration is performed using ten separate steps in the Reporting Services Configuration Manager. To run this tool, open the Start menu and select Programs. Select Microsoft SQL Server 2005, then Configuration Tools, then Reporting Services Configuration. This displays the screen shown in Figure 3.

Cc966542.UsRSwExpFig3(en-us,TechNet.10).jpg

Figure 3 Reporting Services Configuration Manager

The ten areas of that you can configure are as follows:

  • Server Status – Controls the state of the Report Server service. This page provides a quick glance at the overall status of SSRS. It shows a legend of icons that are used on the left-hand part of the page. It shows the following legend:

    • Configured – These items are configured correctly and are operational. Items that must be configured include the service running, virtual directories, Windows and Web service identities, and the SSRS database.

    • Not configured – These items are not yet configured, but must be configured prior to running SSRS.

    • Optional configuration – These items are optional, depending on your business requirements. Typically, encryption keys are the only optional configuration for SSRS running on SSE.

    • Recommended configuration – Configuring these items is recommended but not required for SSRS operation. Email Settings for notifications and delivery options is one recommended configuration option. Execution Account is another recommended configuration setting—use it to specify the security account to use for SSRS unattended operations.

  • Report Server Virtual Directory – Controls the virtual directory for the report server, including the Web site under which the report server resides. The Report Server is the Web service that SSRS tools use to communicate with the reporting server. By default, the virtual directory name is either ReportServer or ReportServer$SQLExpress. If an SSL certificate is installed on the SSRS server, you can also require that all HTTP communication go through SSL (HTTPS). It is a good idea to use SSL if your reports contain sensitive information.

  • Report Manager Virtual Directory – Controls the virtual directory for Report Manager, including the Web site under which the Report Manager web site resides. Report Manager is a graphical tool to navigate reports.

  • Windows Service Identity – Manages the security account under which the ReportServer service runs. By default, this service runs under the NT Authority\NetworkService account. You might want to use a domain account instead of a built-in account.

  • Web Service Identity – Manages the security account under which the Web server runs. By default, this service runs under the \ASPNET account.

  • Database Setup – Configures the server, database, and credentials used to store SSRS metadata. SSE requires that the database be stored on the same computer as SSRS. You can specify the credentials used to connect to the database, as follows:

    • Windows Credentials – A local Windows or domain account is used to connect to the database.

    • SQL Server Credentials – A SQL Server account is used to connect to the database.

    • Service Credentials – A built-in Windows service account is used to connect to the database. This is the default option that is automatically selected when you install SSRS.

  • Encryption Keys – Manages the encryption keys used for SSRS to make it more secure. Encryption keys enable SSRS to encode and decode sensitive data in the SSRS database, such as credit cards and social security numbers. This page enables you to perform the following actions:

    • Backup – Backs up encryption keys in case of disaster. It is a good idea to keep an encryption key backup (stored in an .snk password-protected file) in a safe place.

    • Restore – Enables you to restore encryption keys from a backup.

    • Change – Enables you to change the encryption keys used to encrypt sensitive information. If you change the encryption keys, encrypted data in the database will be reencrypted using the newly generated key. Make a backup of the keys after you select this option.

    • Delete – Removes encrypted information from the database.

  • Initialization – Not available for SSE.

  • Email Settings – Enables you to configure the reporting server administrator’s e-mail address and server for e-mail notifications. This option is recommended if you wish to receive reports via e-mail or to receive other notifications. Specify the account and SMTP server to use. You can use any server that is running the SMTP service or an Exchange server.

  • Execution Account – Controls the security account that is used for SSRS unattended operations. Under most circumstances, when it executes or manages reports SSRS uses the account of the currently logged in user. However, there are circumstances where the user’s account cannot be used, such as when retrieving resources from an external server or when a data source is configured to not use any credentials. Under these circumstances, the account credentials to use are specified on this page. Setting the execution account is optional.

Report Development

The components installed from the SQL Server Express Toolkit that work with Visual Studio 2005 are known as the Business Intelligence Development Studio (BIDS). Report development is done in BIDS. Reporting Services is installed after SQL Server Express Advanced Services is downloaded, while BIDS is installed after the SQL Server Express Toolkit is downloaded.

Creating new SSRS reports

To launch BIDS and start a new Reporting Services project

  1. To launch BIDS, open the Start menu and select Run, Programs, Microsoft SQL Server 2005, SQL Server Business Intelligence Development Studio.

  2. To start a new Reporting Services project, select File, New, and then Project. This displays the screen in Figure 4.

    Cc966542.UsRSwExpFig4(en-us,TechNet.10).jpg

    Figure 4 Creating a new project in Business Intelligence Development Studio
  3. Select the Report Server Project project type.

    In SSE, you have two choices for creating Reporting Services projects, whereas in other editions of SQL Server 2005, you have additional project types. The choices in SSE are:

    • Report Server Project Wizard – Guides you through creating a basic report.

    • Report Server Project – Creates a Reporting Services project, but gives you more control over your projects.

    This example shows how to create a report by using the Report Server Project type.

  4. Type the name of your project and click the OK button.

  5. Once the new project is created, you will see two folders in Solution Explorer: Shared Data Sources and Reports. Solution Explorer is shown in Figure 5. The Shared Data Sources folder contains a list of data sources that are shared among all reports. You use it to define a single data source that can be reused. The Reports folder contains all reports that you define. Using the Shared Data Sources folder to add a data source is covered in the next section, Adding new data sources. Using the Reports folder is covered in Creating new reports, right after the next section.

    Figure 5   Solution Explorer showing folder structure

    Figure 5 Solution Explorer showing folder structure
Adding new data sources

To create a new shared data source, right-click the Shared Data Sources folder and select Add New Data Source on the shortcut menu. This displays a dialog box that you use to define the data source. To define the data source, specify the following:

  • Name – The name of the data source that will be used in your reports.

  • Type – The type of data source. While you can choose from multiple data sources, SQL Server 2005 Express can only execute reports that are run against relational databases on the local server only.

  • Connection String – The connection string used to connect to the selected data source. If you wish to have BIDS generate the connection string for you, click the Edit button and fill in the desired parameters.

  • Credentials – Specifies the security credentials passed to the data source. Select from these options:

    • Use Windows Authentication – Uses the credentials of the user who executes the report. This is the preferred credential setting, as it is the most secure.

    • Use a specific name and password – Uses the credentials of a specific user name and password.

    • Prompt for credentials – Forces Reporting Services to ask for login credentials from the report user.

    • No credentials – Security is not specified for a report.

Creating new reports

To create a new report, right-click the Reports folder and select Add New Report on the menu. This starts the Report Wizard, which guides you through creating the report in these steps:

  • Select the Data Source – Select from a shared data source that you created earlier, or create a new data source.

  • Design the Query – Specify a query to use as the data set from the data source. You can copy/paste a query that you have saved, or design a new query by clicking the Query Builder button.

    Note: The Report Wizard only lets you design a query where you specify table names or views. You cannot specify a stored procedure. However, once you exit the Report Wizard, you can change the query to a stored procedure.

  • Select the Report Type – Choose from a tabular report or a matrix report. A tabular report displays data in groupings, according to the grouping field that you select. A matrix report is presented as a table without groupings.

  • Design the Table (or Matrix) – Select from the fields that are returned from your query and that will be used in the different areas of your report. These areas are available:

    • Page – The fields that are displayed in the header of each page. Page fields can be used in both tabular and matrix reports.

    • Group – The fields that group data on tabular reports only.

    • Details – The fields that are used in the details section of tabular and matrix reports.

    • Columns – The fields that display columns across the top of the report on matrix reports.

    • Rows – The fields that display rows down the side of the report on matrix reports.

  • Choose the Table Layout – For tabular reports only. Select from these options:

    • Stepped – Displays hierarchy of data in such a way that repeated values are not shown, but only the first occurrence is shown. This results a report that looks like it is “stepped.”

    • Block – Displays the hierarchy of data where values are repeated.

    • Include Subtotals – Includes subtotals for each grouping.

    • Enable drilldown – Enables the user to drill down into the details of a grouping. This option is only available for Stepped reports.

  • Choose the Table Style (or Matrix) – Select from specific predefined styles.

  • Report name – Name your report. This name appears in Report Manager menus, or in the URLs that you give your users.

After you finish the wizard, a report with an .rdl file extension is created. RDL stands for Report Definition Language. This is an XML file that contains all the elements necessary to represent the definition of the report. Opening this file in BIDS, displays a screen similar to the one shown in Figure 6.

Cc966542.UsRSwExpFig6(en-us,TechNet.10).jpg

Figure 6 Finished report shown in the BIDS Designer

Designing SSRS reports

Once you create a report by using the BIDS Report Wizard, you can customize and design it to suit your own needs. You can alter almost anything on the report. For example, you can:

  • Change the query from an SQL statement that uses tables and views to a stored procedure.

  • Change fonts and the general look and feel of your reports.

  • Rearrange elements such as text boxes and logos.

  • Add interactive elements, such as subreports, charts, and conditional formatting.

  • Add code to your reports in VBScript.

The Reporting Services design surface, called the Report Designer, is divided into three parts, which you access by clicking the corresponding tabs at the top of the screen. Following are the three Report Designer parts.

  • Data – Defines the data source and data set used in the report.

  • Layout – Defines the layout of the elements on the report.

  • Preview – Use to preview a rendering of the report in HTML format.

As with other Visual Studio 2005 projects, you add items to a report by dragging tools from the toolbox onto the Report Designer when the Layout tab is selected. The Reporting Services toolbox is shown in Figure 7.

Figure 7   Reporting Services toolbox

Figure 7 Reporting Services toolbox

To design a Reporting Services report, drag the elements you want to use onto the Report Designer.

Testing and Staging SSRS Applications

It’s easy to test and stage your SSRS applications. Your approach to testing and staging depends on your company’s policy for testing and staging any application. Some companies simply test on a development workstation and publish right to a server. Others have more rigorous testing requirements, which is recommended.

The first step to testing is to preview your reports. The Report Designer has a Preview tab. Click this tab to display your report. Figure 8 shows an example in the Business Intelligence Development Studio.

Cc966542.UsRSwExpFig8(en-us,TechNet.10).jpg

Figure 8 Previewing a report in BIDS

Once you know that the report behaves the way you expect, you are ready to move the report onto a staging server or into production, depending on how your organization manages its testing and staging environments. If you plan to deploy your SSRS applications to a staging server, follow the instructions in the next section.

Deploying SSRS Solutions

When you make your SSRS reports available on a staging or production server, you do so by deploying them. Your reports will need the data sources that supply data to the reports. You can choose whether to overwrite a data source of the same name on the SSRS server during deployment. The default behavior is to not overwrite existing data sources, but to overwrite existing reports.

Before you deploy your reports, you must configure the deployment properties for your SSRS project. Right-click the name of your project in the BIDS Solution Explorer to display the screen shown in Figure 9.

Cc966542.UsRSwExpFig9(en-us,TechNet.10).jpg

Figure 9 SSRS Reporting project properties

You must configure these properties before you can deploy the report:

  • OverwriteDataSources – Enables you to overwrite the shared data sources that you have configured in your project. The default is False.

  • TargetDataSourceFolder – Folder to create on the server where your shared data sources will reside.

  • TargetReportFolder – Folder to create on the server where your reports will reside. This lets you classify the reports however you wish.

  • TargetServerURL – URL of the SSRS Web service. This is probably the ReportServer virtual directory on your target server.

After you configure the properties for your deployment target, you can deploy the target. Right-click the name of your project in BIDS Solution Explorer and select Deploy. Your reports (and optionally data sources) will be deployed to the specified target server.

Viewing reports

There are two ways to users can view reports:

  • Report Manager – Users can view reports by using Report Manager, a Web-based application that is included with Reporting Services. By default, Report Manager is available at http://localhost/reports$SQLEXPRESS.

    Important Note: If you have named your database instance other than SQLEXPRESS, replace the text SQLEXPRESS in the above URL with the name of your instance.

  • The Report Viewer control – This control enables you to embed reports in your applications by using Visual Studio 2005. The Report Viewer control is available for both Windows applications and Web applications.

The Report Viewer control has two operating modes. The first displays reports that are hosted on a Reporting Services Web service. The second displays embedded client-side reports that are not hosted on the Web service, similar to the way you embed Crystal Reports into Visual Studio applications.

The version of SSRS that is included with SSE makes reports available via the Report Server Web service. To use the Report Viewer control for developing client-side reports, you can use Visual Studio Web Developer Express or Visual Studio 2005 Standard Edition or higher.

The example presented here covers the following operations:

  1. Use SQL Server 2005 Express with Advanced Services to create a report.

  2. Publish the report to the Reporting Services Web service. For more information about publishing a report, see Deploying SSRS Solutions later in this paper.

  3. Open Visual Studio 2005 and create a Windows application.

  4. Embed an instance of the Report Viewer control onto a form and bind it to the Web service.

Figure 10 shows a Visual Studio 2005 solution with a Windows project. This project contains a single blank form.

Cc966542.UsRSwExpFig10(en-us,TechNet.10).jpg

Figure 10 Selecting the Report Viewer control

Drag the Report Viewer control onto the form. Then, set the properties of the report to execute, as shown in Figure 11. Remember that SSRS that comes with SSE can publish reports that the Report Viewer control can use.

Figure 11   Selecting Report Server properties

Figure 11 Selecting Report Server properties

To select a specific report, select from the Choose Report menu. Specify the Report Server Url and the Report Path. The Report Server Url is the URL of the SSRS Web service. This is typically, http:///reportserver. The Report Path is the path to which you publish your reports. Figure 11 shows a top-level folder called DailyReports, with a report name of Report1. The first character of the report path must always be a slash.

Note If you are using Visual Web Developer Express, the Report Viewer control add-in is a separate download available from Microsoft at the Visual Web Developer Express page ( http://www.microsoft.com/express/download/).

Setting report security

Report security is configured by using role-based settings. In role-based security, you use roles that are assigned sets of permissions. You assign specific users or groups to those roles. Role-based security is very easy to implement.

SSE comes with predefined roles. You cannot change these roles nor can you create new ones. The following predefined roles are available to SSRS in SSE.

  • Browser – Use to view folders, reports, and to subscribe to reports.

  • Content Manager – Use to manage all aspects of content, including creating folders, reports, and data sources.

  • My Reports – Use to publish reports, create folders, and manage resources in the My Reports folder.

  • Publisher – Use to publish reports.

  • Report Builder – Use to view report definitions (RDL).

To assign a Windows user or group to a predefined role

  1. In Internet Explorer, open Report Manager by going to: http://localhost/reports$SQLEXPRESS.

  2. Ensure that you are viewing the Report Manager home page.

  3. Click the Properties tab to display the screen shown in Figure 12.

    Cc966542.UsRSwExpFig12(en-us,TechNet.10).jpg

    Figure 12 Viewing users and roles
  4. To assign a user to a role, click the New Role Assignment button. This displays the screen shown in Figure 13.

    Cc966542.UsRSwExpFig13(en-us,TechNet.10).jpg

    Figure 13 Adding users to a role

By default, report security is inherited from the assignments that you set here. To change the security settings for an individual report, navigate to the report, click the Security tab, and making the desired changes. However, if you do this, the report will no longer inherit from its parent.

Report Packs

Microsoft periodically releases add-ons to SQL Server Reporting Services that give you sets of prebuilt reports. These reports enable you to extend your environment in a variety of ways, depending on the software you have installed in your organization. Report packs are available at no charge. They can be freely downloaded from the SQL Server Report Packs page ( http://www.microsoft.com/downloads/details.aspx?FamilyId=D81722CE-408C-4FB6-A429-2A7ECD62F674). The following report packs are available at the time of this writing:

  • SQL Server 2005 Report Pack for SQL Server Integration Services

  • SQL Server 2005 Report Pack for Microsoft SharePoint® Portal Server 2003

  • SQL Server 2005 Report Pack for Microsoft Dynamics Axapta 3.0

  • SQL Server 2005 Report Pack for Microsoft Dynamics Navision 4.0

  • SQL Server 2005 Report Pack for Microsoft Dynamics Great Plains 8.0

  • SQL Server 2005 Report Pack for Microsoft Dynamics Great Plains 9.0

  • SQL Server 2005 Report Pack for Microsoft Internet Information Services (IIS)

  • SQL Server 2005 Report Pack for Financial Reporting

For example, if you are running IIS, you can report from the logs by installing the IIS report pack, changing a couple of parameters, and then running or deploying these reports.

To run these reports on SQL Server Express, you need to attach the included databases (.mdf files) included with the report packs to SQL Server Express (hint: you can use SQL Server Management Studio Express, where you can also easily browse the database schemas and get a better understanding of how the report packs work).

Make the following changes in Business Intelligence Development Studio (BIDS).

  1. On the Project menu, select Properties.

  2. Set the TargetServerURL field to http://localhost/reportserver$SQLEXPRESS.

  3. To close the Properties page, click OK.

  4. To display the Solution Explorer pane, on the View menu, select Solution Explorer.

  5. In Solution Explorer, expand the Shared Data Sources list by clicking on the + symbol next to the folder icon.

  6. Double-click the .rds file.

  7. In the Connection String field, replace (local) with .\SQLEXPRESS.

  8. Click OK.

After you complete these steps, you can preview your reports in BIDS and then deploy them to your report server.

Once you have downloaded and installed a report pack, a new project folder is created that you can modify as you wish. For example, the IIS Report Pack is installed by default in C:\Program Files\Microsoft SQL Server Report Packs\Microsoft SQL Server Report Pack for Internet Information Services. There is a solution file in the Reports folder in the same hierarchy. The project contains numerous reports that work out-of-the-box. Figure 14 shows what the solution looks like at design-time in BIDS.

Cc966542.UsRSwExpFig14(en-us,TechNet.10).jpg

Figure 14 IIS Report Pack at design time in BIDS

Uninstalling SSE and SSRS

If you installed a beta version of either product prior to the final release outlined in this paper, the easiest way to uninstall it is to use a special uninstall tool that Microsoft has released. It is located at http://msdn2.microsoft.com/express/aa718398.aspx. The uninstall tool removes any previous beta versions of SSE and Visual Studio 2005.

If you are removing the final version of SSE or any of its components, open Add/Remove Programs in Windows Control Panel. Select Microsoft SQL Server 2005 to change or remove any components. Select what to uninstall or remove as shown in Figure 15.

Cc966542.UsRSwExpFig15(en-us,TechNet.10).jpg

Figure 15 Selecting a SQL Server 2005 Express component to remove

Conclusion

The version of SQL Server 2005 Reporting Services that is available with SQL Server 2005 Express with Advanced Services provides powerful reporting functionality for your applications. Now you can embed interactive reporting capabilities into your data-driven applications and provide a rich presentation of the data to users.

For more information:

http://www.microsoft.com/technet/prodtechnol/sql/default.mspx

Did this paper help you? Please give us your feedback. On a scale of 1 (poor) to 5 (excellent), how would you rate this paper?

!href(mailto: sqlfback@microsoft.com?subject=Feedback: Developing Custom Components in SQL Server Integration Services for Project REAL)

Download

Cc966542.icon_Word(en-us,TechNet.10).gif UsingSSRSwith SQLExpress.doc
1.6 MB
Microsoft Word file
Get Office File Viewers

Popular Posts